Weblog entry #47 for Utumno
Some bastards from domain 'kimsufi.com' run bots that keep hammering my forum. They keep trying to register and post their pornspam. So couple of days ago I added the whole domain to /etc/hosts.deny like this:
ALL: .kimsufi.com
/etc/hosts.allow is empty.
Now, I thought that would do it, but today I looked at the logs and the hammering is still there! Do I have to restart something before hosts.deny starts working?
Comments on this Entry
I spent 30 minutes trying to figure out why a block I added to /etc/hosts.deny wasn't working only to discover a hosts.deny in /usr/local. It may be worth blocking their whole subnet through iptables, along with reporting the abuse to their ISP/Hosting firm. If they don't care to deal with the abuse issue, you shouldn't care to receive traffic from them.
[ Parent | Reply to this comment ]
-ZeroDamage
[ Parent | Reply to this comment ]
It would look like this:
Order Allow,Deny
Deny from kimsufi.com
Allow from All
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
This also doesn't work here...
Fortunately editing /etc/phpbb2/apache.conf and adding there
Order Allow,Deny
Deny from kimsufi.com
Allow from All
works :)
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
well, no matter what I do, hosts.deny does not work.
I just logged to a remote server and used 'links' to test if I can connect to my forum. I could. Then I added the domain of the remote server to hosts.deny like this
ALL: .domain
I tried links and I still could connect. Then I tried the above with exact IP of the server, still no success.
/etc/hosts.allow is empty, there is no additional hosts.deny at /usr/local/etc/
[ Parent | Reply to this comment ]
AFAIK, hosts.allow and hosts.deny are the conf files for the tcpd wrapper. These are usually read only when a new connection arrives that triggers inetd, which in turn has to launch the appropriate daemon.
Some other applications (e.g. ssh) were designed to obey their contents as well, but they are not forced to.
Which web server do you use? Are you sure it chose to obey these files? If yes, are you sure it re-reads them at every access, or it just reads them once at startup?
[ Parent | Reply to this comment ]
Have you tried 'tcpdmatch'?
Last but not least: if your web server's not started from (x)inetd or isn't built with tcpwrappers support /etc/hosts.{allow,deny} won't work.
If that's the case use iptables/netfilter.
rjc
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]