Re: [SLUG] DenyThem - DOS Perl Script

From: Dylan William Hardison (dylan@hardison.net)
Date: Wed Jan 23 2008 - 21:52:03 EST


Spake Matthew Rogers on Wednesday, January 23, 2008 at 03:02PM -0500:
> I just wrote an anti-spam tool that can key off anything in syslog to block
> crackers from dictionary attacking / being annoying. I got tired of seeing
> Relay Denied Requests 1000's of times a day on my servers so I wrote this
> program.
> It uses iptables to just drop cracker traffic... GPL if anyone wants to
> contribute, I'm going to have the next version have a sync capability and
> maybe something else and a better way to config other than opening up the
> program source.

I notice you have a blog. Would you like me to add you to much-neglected "planet slug"
aggregator? (http://hardison.net/slug/planet/)

Nice idea!

There's a few issues: Your script is using Windows/DOS line endings (\r\n)
instead of unix line endings, which means it will not run if you execute it as a
script (./denythem.pl).

The only other issue I notice is that you're using system(STRING) rather than
system(LIST). If you're aware of the difference, that's okay, but incase you are
not: system("magic pants") executes the string using the system's shell (/bin/sh
typically), where as system("magic", "pants") executes the "magic" executable
(presumably somewhere in your $PATH) with one argument: "pants".

There's nothing terribly wrong with using /bin/sh, but if you're not careful
sanitizing input, interesting things can happen.

-- 
Govern a great nation as you would cook a small fish.  Don't overdo it.
              -- Lao Tsu
-
GPG Fingerprint: 412C CCE9 DDA2 4FE9 C34F  754B 0863 0EA6 712E BBE1
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:24:56 EDT