I have a similar problem but it's not in my theme or the root index.php. These spam links even show up on my admin screens! I got swamped with spam ads a few days ago, so I erased my 2.3 install and replaced it with 2.3.1. That got rid of roblem for a day but now it's back again. Also my WP login and logout don't work from the sidebar I have to go manually to the wp-admin directory. I don't know if that's connected with this problem or just an error from the upgrade to 2.3.1.
Any ideas? You can see the issue here: http://www.engelmania.com