lkml.org 
[lkml]   [2007]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How would I do this? (expert tricks) OT
Marc Perkel wrote:
> I have a server with port 25 closed. I was to be able
> to run a script every time someone tries to connect to
> port 25, but from the outside the port remains closed.
> I need the script that I'm going to run get the IP
> address that tried to connect.
>
> I know it's off topic but it's part of an experiment
> to stop spam.

Put a rule in iptables to jump to a user table to do a log and drop. You
are doing it the wrong way, you want to set syslog to write the log
message to a FIFO and have a permanent running program reading it (I do
just this for other things).

Alternatively you can use redirect to send it to a program of your
choosing, which can run a script if you really want to. Beware that rate
limiting is desirable if you are going to start a process for ANY type
of attack packets.

--
Bill Davidsen <davidsen@tmr.com>
"We have more to fear from the bungling of the incompetent than from
the machinations of the wicked." - from Slashdot
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-27 22:03    [W:0.040 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site