Hundreds of thousands of websites - including several at the United Nations and in the UK government - have been hacked and seeded with code that tries to exploit security flaws in Microsoft Windows to install malicious software on visitors' machines,

Attacks have expanded dramatically, security researchers said Friday, with hundreds of thousands of pages hacked by Friday. It's thought the sites have been compromised by exploiting a security flaw in Microsoft's web browser software.

On Wednesday, several security companies, including California-based Websense, said large numbers of legitimate sites, including URLs for the UN, had been hacked and were serving up malware. These latest site compromises were only the most recent SQL injection attacks, however; similar attacks have been launched since the first of the year, and were last detected in large numbers in March.

Ryan Sherstobitoff, a corporate evangelist for Panda, said his company had reported a problem with Internet Information Services (ISS) to Microsoft that was probably responsible for the hacks. "We reported a security issue, but I don't have any specific details on whether it's a vulnerability," Sherstobitoff said.

"It's not like this is a brand-new problem," he said, referring to legitimate site compromises. "But Microsoft has already issued a security advisory that said they are investigating public reports of problems with IIS. This seems to be related to that advisory."

That advisory was published 17 April, and warned users of a bug in most versions of Windows that could be exploited through custom web applications running in IIS. It could also be exploited via SQL Server, Microsoft said.

On Friday, Microsoft said it did not know whether the ongoing site attacks were linked to the bug described in the advisory. "We have not yet determined whether or not these reports are related to Microsoft Security Advisory 951306 released last week," a company spokesman said in an email.

When a visitor reaches one of the hacked sites, malicious JavaScript loads an IFRAME from a malware-hosting server; the IFRAME redirects the browser to a different page, also hosted on the hacker's server. Next, a multiple-strike attack kit is downloaded to the visitor's Windows PC. The kit tries eight different exploits, and if it finds one that works, hijacks the system.

"Users should be extremely wary when visiting sites, even those typically trusted," was about all Symantec could come up with in an alert to customers of its DeepSight threat notification service.

Disabling JavaScript can also protect against such attacks, Symantec added. Users, however, are often reluctant to switch off JavaScript because without it, many sites are crippled or won't display properly.