View previous topic :: View next topic |
Author |
Message |
QV n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 13 Feb 2004 Posts: 54
|
Posted: Sun Apr 04, 2004 12:11 am Post subject: Looking for a script to help me with my firewall |
|
|
I can't seem to get string matching in iptables to work, and there's no option for it in the kernel.
But I need some way to filter out attacks on my web server...not because I'm vulnerable (Apache rocks), but because it clutters up my access_log and all the 404s probably eat into my bandwidth, so I figured I'd ask if anyone has a script like this:
It would run as root (duh), grep all files in /etc/apache2/logs for certain strings (specified in an external config file, most likely just a newline-delimited text file), take the IP addresses associated with each occurence of a GET request that includes those strings, and add a rule to iptables to drop all packets from that IP regardless of anything else. It would also check against existing iptables rules to make sure no IP is blocked twice. It would mostly be used in cron jobs--cron.hourly looks like a nice place, since I'm constantly flooded by these attacks from so many different IPs.
Banned strings, by the way, would be things like default.ida, root.exe, cmd.exe, and nsiislog.dll
I've no idea if a script like that even exists--I'm just hoping it does and someone would point me to it.
Thanks for reading this. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
YopWongSapn l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/2137158634428e2bb39d476.gif)
Joined: 26 Jan 2004 Posts: 627
|
Posted: Sun Apr 04, 2004 8:03 am Post subject: |
|
|
Why don't you just read up on iptables and make one yourself? It may be more work than you're willing to put into it (I've read most the iptables manual...it's a novel, I know ), but I guaruntee that you will get a lot more out of it when you get it set up the way you want it. Some perks to doing it this way:
1) If it breaks later on, you'll have the knowledge required to fix it (or at least some of the knowledge).
2) It will be much more customized for your needs.
3) You'll have the satisfaction of knowing that you accomlished quite a feat ![Very Happy :D](images/smiles/icon_biggrin.gif) _________________ Gentoo...it's like wiping your ass with silk. Or sandpaper. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|