• Diplomats ordered to gather intelligence on Ban Ki-moon • Secret directives sent to more than 30 US embassies • Call for DNA data, computer passwords and terrorist links

Washington is running a secret intelligence campaign targeted at the leadership of the United Nations, including the secretary general, Ban Ki-moon and the permanent security council representatives from China, Russia, France and the UK.

A classified directive which appears to blur the line between diplomacy and spying was issued to US diplomats under Hillary Clinton's name in July 2009, demanding forensic technical details about the communications systems used by top UN officials, including passwords and personal encryption keys used in private and commercial networks for official communications.

It called for detailed biometric information "on key UN officials, to include undersecretaries, heads of specialised agencies and their chief advisers, top SYG [secretary general] aides, heads of peace operations and political field missions, including force commanders" as well as intelligence on Ban's "management and decision-making style and his influence on the secretariat". A parallel intelligence directive sent to diplomats in the Democratic Republic of the Congo, Uganda, Rwanda and Burundi said biometric data included DNA, fingerprints and iris scans.

Washington also wanted credit card numbers, email addresses, phone, fax and pager numbers and even frequent-flyer account numbers for UN figures and "biographic and biometric information on UN Security Council permanent representatives".

The secret "national human intelligence collection directive" was sent to US missions at the UN in New York, Vienna and Rome; 33 embassies and consulates, including those in London, Paris and Moscow.

The operation targeted at the UN appears to have involved all of Washington's main intelligence agencies. The CIA's clandestine service, the US Secret Service and the FBI were included in the "reporting and collection needs" cable alongside the state department under the heading "collection requirements and tasking".

The leak of the directive is likely to spark questions about the legality of the operation and about whether state department diplomats are expected to spy. The level of technical and personal detail demanded about the UN top team's communication systems could be seen as laying the groundwork for surveillance or hacking operations. It requested "current technical specifications, physical layout and planned upgrades to telecommunications infrastructure and information systems, networks and technologies used by top officials and their support staff", as well as details on private networks used for official communication, "to include upgrades, security measures, passwords, personal encryption keys and virtual private network versions used".

The UN has previously asserted that bugging the secretary general is illegal, citing the 1946 UN convention on privileges and immunities which states: "The premises of the United Nations shall be inviolable. The property and assets of the United Nations, wherever located and by whomsoever held, shall be immune from search, requisition, confiscation, expropriation and any other form of interference, whether by executive, administrative, judicial or legislative action".

The 1961 Vienna convention on diplomatic relations, which covers the UN, also states that "the official correspondence of the mission shall be inviolable".

The emergence of the directive also risks undermining political trust between the UN leadership and the US, which is the former's biggest paying member, supplying almost a quarter of its budget – more than $3bn (£1.9bn) this year.

Washington wanted intelligence on the contentious issue of the "relationship or funding between UN personnel and/or missions and terrorist organisations" and links between the UN Relief and Works Agency in the Middle East, and Hamas and Hezbollah. It also wanted to know about plans by UN special rapporteurs to press for potentially embarrassing investigations into the US treatment of detainees in Iraq, Afghanistan and Guantánamo Bay, and "details of friction" between the agencies co-ordinating UN humanitarian operations, evidence of corruption inside UNAids, the joint UN programme on HIV, and in international health organisations, including the World Health Organisation (WHO). It even called for "biographic and biometric" information on Dr Margaret Chan, the director general of WHO, as well as details of her personality, role, effectiveness, management style and influence.

The UN is not the only target. The cables reveal that since 2008 the state department has issued at least nine directives to embassies around the world which set forth "a list of priorities intended to guide participating US government agencies as they allocate resources and update plans to collect information".

They are packed with detailed orders and while embassy staff are particularly encouraged to assist in compiling biographic information, the directive on the mineral and oil-rich Great Lakes region of Africa also requested detailed military intelligence, including weapons markings and plans of army bases. A directive on "Palestinian issues" sent to Cairo, Tel Aviv, Jerusalem, Amman, Damascus and Riyadh demanded the exact travel plans and vehicles used by leading members of Hamas and the Palestinian Authority, without explaining why.

In one directive that would test the initiative, never mind moral and legal scruples, of any diplomat, Washington ordered staff in the DRC, Uganda, Rwanda and Burundi to obtain biometric information of leading figures in business, politics, intelligence, military, religion and in key ethnic groups.

Fingerprints and photographs are collected as part of embassies' consular and visa operations, but it is harder to see how diplomats could justify obtaining DNA samples and iris scans. Again in central Africa, embassy officials were ordered to gather details about countries' military relations with China, Libya, North Korea, Iran and Russia. Washington assigned high priority to intelligence on the "transfer of strategic materials such as uranium", and "details of arms acquisitions and arms sales by government or insurgents, including negotiations, contracts, deliveries, terms of sale, quantity and quality of equipment, and price and payment terms".

The directives, signed simply "Clinton" or "Rice", referring to the current and former secretaries of state, Hillary Clinton and Condoleezza Rice, form a central plank of America's intelligence effort and reveal how Washington is using its 11,500-strong foreign service to glean highly sensitive information on both allies and enemies.

They are compliant with the National Intelligence Priorities Framework, which is approved by the president, and issued by James Clapper, the director of national intelligence who oversees the CIA, the Defence Intelligence Agency, FBI and 13 other intelligence agencies.

Washington circulated to its Middle Eastern embassies a request for what was effectively a counter-intelligence operation against Mukhabarat, the Palestinian Authority's secret service, and Istikhbarat, its military intelligence.

The directive asked for an assessment of the foreign agencies' "signals intercept capabilities and targets, decryption capabilities, intercept sites and collection hardware, and intercept operation successes" and information of their "efforts to illicitly collect classified, sensitive, commercial proprietary or protected technology information from US companies or government agencies".

Missions in Israel, Jordan, Syria, Saudi Arabia and Egypt were asked to gather biometric information "on key Palestinian Authority and Hamas leaders and representatives, to include the young guard inside Gaza, the West Bank", as well as evidence of collusion between the PA security forces and terror groups.

Taken together, the directives provide a vivid snapshot of America's perception of foreign threats which are often dazzlingly interconnected. Paraguayan drug traffickers were suspected of supporting Hezbollah and al-Qaida, while Latin American cocaine barons were linked to criminal networks in the desert states of west Africa, who were in turn linked to Islamist terrorists in the Middle East and Asia.

High on the list of requests in an April 2009 directive covering the Saharan west African countries, including Burkina Faso, Chad, Mali, Mauritania, Niger and Senegal, was information about the activities of fighters returning from Iraq and Afghanistan. Information was wanted on "indications that international terrorist groups are seeking to take advantage of political, ethnic, tribal or religious conflict".

Diplomats were told to find out about the links between drug traffickers in the region to Latin American cocaine cartels, as well as terrorist or insurgent groups' income derived from the drugs trade.

Sometimes the directives appear linked to forthcoming diplomatic obligations of the secretary of state. In a cable to the embassy in Sofia last June, five months before Clinton hosted Bulgaria's foreign minister in Washington, the first request was about government corruption and the links between organised crime groups and "government and foreign entities, drug and human trafficking, credit card fraud, and computer-related crimes, including child pornography".

Washington also wanted to know about "corruption among senior officials, including off-budget financial flows in support of senior leaders … details about defence industry, including plans and efforts to co-operate with foreign nations and actors. Weapon system development programmes, firms and facilities. Types, production rates, and factory markings of major weapon systems".

Top tips for dealing with defectors and turncoats

One cable offered a detailed and practical guide for embassies on how to handle possible defectors, known as "walk-ins", who turned up at embassies offering to switch sides. It called for them to be treated with considerable care because they "may be sources of invaluable intelligence".

"Walk-ins may exhibit nervous or anxious behaviour, particularly because access controls and host nation security forces around many of our diplomatic posts make it difficult for walk-ins to approach our facilities discreetly," it warned. "All briefings should also stress the importance of not drawing attention to the walk-in or alerting host nation security personnel."

Embassy staff should immediately copy the person's identification papers or passport, in case they got cold feet and ran off, it said. A walk-in who possessed any object that appeared potentially dangerous should be denied access even if the item was presented "as evidence of some intelligence he offers, eg, red mercury [a possibly bogus chemical which has been claimed to be a component of nuclear weapons] presented as proof of plutonium enrichment".