Archive for March, 2003

Defending yourself against HTTP floods

A colleague of mine was recently attacked by a fairly well-known hacker. For reasons known only to the hacker, he decided he would just periodically bring down my colleague’s website by flooding it with HTTP/CGI requests. As far as the server was concerned, these were legitimate requests, and defending them wasn’t going to be simple.

If these had been half-open SYN attacks from spoofed addresses, it would have been fairly easy to take care of them. More likely, he had a script running which generated repeated requests, via cURL or wget, for a file which caused some resources to be used up, and just turned up the volume until the server stopped responding.

Investigation showed that the requests were coming from a good number of hosts, but not completely random. I wrote a script which pulled the most recent Apache access log into a MySQL table, then created a second table from that data, containing only IP address and number of requests. I quickly determined that 87 hosts were responsible for the attacks, and most were located in far-off and untouchable regions such as Korea, Portugal, etc. Looks like our hacker friend had a decent number of drones at his command.

I modified the script to regenerate the data and spit out the commands to route traffic bound for those addresses to nowhere. In this case, since I had a provider willing to work with me, I generated them for a Cisco router (ip route xxx.xxx.xxx.xxx 255.255.255.255 null0), but if I didn’t have a willing provider, I could have modified the script to use the server’s own routing tables to route the traffic to nowhere.

After applying these null routes, the attack immediately stopped. And the script is still there, in case he finds more drones and tries it again.

Syndicated Content Tutorial

Suppose you have a website, and you want to give that website your industry’s “street cred” by providing timely industry-related articles to your website viewers, but you’re not much of a writer and can’t afford to hire one.

Alternately, suppose you have written a number of useful articles for a limited audience, and are looking for ways to leverage your content to enhance your personal or business recognition and reputation.

In either case, content syndication may be exactly what you’re looking for. Many small-time web gurus are now finding out what the portal industry has already known — in the information world, CONTENT IS KING. You have to be able to offer your viewers something, or they have no reason to return.

Thanks to RSS (formerly RDF), this is now simple. Increasingly, large content providers are providing headlines in this easily-shared, XML-based format which is already understood by portal software such as phpNuke and others. When you go to your favorite news site, and see feeds from Slashdot, Freshmeat, CNet, and other news sites, this is what’s going on behind the scenes. And it works both ways. Some portal software not only presents content from RSS-based content providers, it also generates an RSS file for your own content, allowing you to syndicate your content as well.

Syndication is win-win for the content provider and presenter. For the presenter, it enhances the information available on their portal or industry site. For the content provider, it draws traffic back to the source of the content.

Resources:

  • Syndic8.com, a content aggregator

  • Webref and the future of RSS

  • Meerkat, an Open Wire Service by O’Reilly