The U.S. National Security Agency (NSA) has been planting surveillance software deep within hard drives made by top manufacturers, allowing it to eavesdrop on almost every computer in the world, according to Kaspersky Lab, a Moscow-based software security company that announced its findings Monday.

Kaspersky did not explicitly name from which country or intelligence agency the spying software was found, but former operatives from the NSA confirmed that the findings correlated with NSA activity, Reuters reported.

The NSA’s spyware lies within drives manufactured by Western Digital and Seagate, who deny that they had any knowledge of such programs. Samsung and Toshiba drives also contained the code, but both declined to comment.

equation-650-38010-260926 The NSA hacking team, called "Equation group" by Kaspersky, had infected computers with spyware since as early as 2001. Photo: Kaspersky Lab

Kaspersky said that PCs in 30 different countries were infected by the most advanced hacking operation ever uncovered, with the most in Iran, Russia, Pakistan, Afghanistan and China. The NSA has a number of ways in which it can obtain the drives’ source code, which it requires to embed the spyware. The NSA’s methods include posing as software companies or asking for it directly, Reuters reported. The government can also request it for a security audit from manufacturers who wish to sell hard drives to the Department of Defense, and then use it to infect the manufacturer’s products.

The NSA also would intercept mailed items, such as CDs or USB drives, to infect them, according to a report from Ars Technica. The infections also affect iPhones and other Apple products.

The NSA is targeting a number of organizations, including government and military offices, telecommunication, energy and media companies as well as nuclear research facilities and Islamic activists. Institutions with infected hard drives should be able to detect the NSA spyware using technical details that Kaspersky published Monday.

Those details could impair the NSA’s surveillance programs, which were already affected by the revelations made by former NSA contractor Edward Snowden. The disclosures have already slowed sales of U.S. technology products internationally, especially in China.