The US war on Afghanistan during the 1980s was counterrevolutionary not because the invading Russian tanks were themselves the agents of socialism, but because it was, like the Russian invasion, an attempt to subsume the people of Afghanistan into an exploitative, tutelary relationship that could under no interpretation mean liberation. So let's call it a counterrevolutionary war. As such, it was far larger and more significant than the war on the actual indigenous revolution in Nicaragua, and it required much more funding to carry off. Not only did Congress ultimately provide $3bn to the empire's surrogates throughout the 1980s, but like the Air America programme in Laos, it required a massive subsidiary drugs empire, way above the transport of crack to south-central Los Angeles. The CIA supported this, because a) narco-capitalists in Afghanistan were in open rebellion agains the Soviet Union, and b) they knew from past experience of supporting the counterrevolutionary forces in the Golden Triangle, particularly the Nationalists in China, that there is no better way to fund a privatised war.
When Washington's fighters conquered territory, they obliged the peasants to grow opium as a 'revolutionary tax', and then moved the substance to ISI backed laboratories in Pakistan. Subsequently, CIA-armed convoys would transport it to its various global destinations. Prior to that war, there was no known opium production in either Afghanistan and Pakistan, so it was entirely an effect of the secret war. By the end of combat, the Pakistan/Afghanistan border was the source of an estimated 75% of the world's opium trade. One of the biggest beneficiaries of this, and also the recipient of most Congressional aid, was Gulbuddin Hekmatyar who - in his war against the former king's secularising reforms - had encouraged his men to throw vials of acid in the faces of women who did not wear the veil. His outfit, the Hizb-i-Islami, was entirely a confection of the Pakistani secret services, themselves effectively sub-contractors for the CIA. Worth mentioning that the bulk of the ISI's activities with regard to the madrassas were domestic - it was part of an internal class war, nurturing ultra-conservatives within the state as a bulwark against socialist reform. But they introduced Hekmatyar to the CIA, and for a decade he became Washington's key man in Afghanistan, terrorising refugee camps and trying to take over rival resistance groups.
The bankers for this, of course, were the BCCI, set up by Agha Hassan Abedi. With capital from the Bank of America, and the specific connivance of the Bank of England among others, BCCI engaged in a now notorious 19-year heist from 1972 to 1991, funding all sorts of criminal activity, nuclear weapons for Qadaffi, money-laundering and so on, but most significantly of all supporting covert CIA and DIA operations. BCCI branches were used to pay the CIA's informants and operatives in London, and to channel money to the 'mujahideen'. Saudi funds were deposited in BCCI branches to assist the CIA's counterrevolutionary operations in southern Africa and Central America. The bank had been set up in two offshore tax havens and kept two sets of accounts, thus escaping centralised government regulation. It was discovered in the end to be worthless, with $13bn of its supposed assets unaccounted for.
This is simply an aspect of Empire - the imperial state needs to maintain illicit means of control and intervention and uses the secret state for this purpose, and criminalises itself for that purpose. The ruling classes of several advanced capitalist countries were implicated in the BCCI scandal, and also in the Afghanistan drugs empire. It's probably naive therefore to think that the massive expansion in the Afghanistan opium trade recently has nothing whatever to do with the ongoing American assault that specifically uses opium-funded warlords as auxiliaries to the occupation.