I still haven’t been able to track down the exact exploit used to compromise all these WordPress blogs. All the compromised blogs that I’ve examined run older versions of WordPress (<= 2.0.6). There are several older vulnerabilities that allow an attacker to assume admin privileges.
With admin privileges the attacker can use the Theme Editor to add their spam links to the footer template. Using the Theme Editor gets around the problem of knowing which file to edit since each theme is installed in a separate directory. If the attacker only had access to the file system (e.g. via ftp), then there is no easy way to know which is the active WordPress theme.
In a most likely unrelated note, GigaOM has a post about security issues in WordPress Themes. It turns out that some bad guys are taking free WordPress themes and modifying them slightly so that they can run arbitrary code on each web server running that WordPress theme. This is a huge security risk!
Follow the basic security rule: Don’t download files from untrusted sources. Just because someone is advertising their free WordPress template site on AdWords doesn’t mean that the site is legitimate.
The reason I say that the two security issues are unrelated is because the compromised blogs do not share a common WordPress theme.
If anyone who has been compromised would be willing to share their web access logs, I would be very interested in examining them.
After closer examination I realized that all compromised sites had the exact same AdSense code:
getme('http://pagead2.googlesyndication.com/pagead/show_ads.js? 636D6071685F676C255D5A68385E565D545C612E64334D100E4D5 45652090A0E5252564840083D414A4641354C0FF83E3E3C32F306');
Someone at Google should be able to find out who is benefiting financially from that AdSense code. Money always leaves a trail.