Thread: pf by content?
View Single Post
  #3   (View Single Post)  
Old 7th February 2013
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

We use Varnish.

In our vcl_recv

Code:
  if (
    req.url ~ "(?i)^/(\?mod=|site.php\?a=|index\.php\?option=com_simpledownload|\?(page|file)=\.\.)" ||
    req.url ~ "(?i)(awstats|phpthumb|phpmyadmin|phpalbum|main.php\?cmd=setquality)" ||
    req.url ~ "\.\./\.\./\.\./\.\./\.\./\.\." ||
    req.url ~ "(?i)^/(phorum|cgi-bin|nucleus|dotproject|yappa-ng|PHPNews|_conf|mwchat|Sources|GradeMap)/"
  ) {
    error 404 "Not found";
  }
Simple, but quite effective. We used to get hammered to the point where the webserver were unresponsive, this instantly solved all those problems.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote