Fandelem
12-05-2000, 01:34 AM
I get tons of port scans a day.
I have all port scans periodically moved into another file (which was easy for me to learn how to do, grin).. but it's a lengthy procedure running through all of the IP addresses and such.
here is the log entries:
Dec 4 02:13:14 server kernel: Packet log: input DENY ppp0 PROTO=6 63.161.207.199:2417 209.212.133.4
7:139 L=48 S=0x00 I=24870 F=0x4000 T=116 SYN (#37)
My question: Can perl somehow run through each line, log the date, and when it finds "PROTO=x" it will store that into a variable, then can it move two : (semicolons) and log the port number which the scan was intended for? (can perl log from characterX to characterY or can it just store X amount of spaces?) which would then store that into a variable as well.. and could then perl (dynamically?) create a file to store each result and just loop it till EoF?
I'm pretty sure I could do the last part of what I'm asking.. but could someone help me write a little perl script to handle the first part?
thanks in advance,
~kyle
I have all port scans periodically moved into another file (which was easy for me to learn how to do, grin).. but it's a lengthy procedure running through all of the IP addresses and such.
here is the log entries:
Dec 4 02:13:14 server kernel: Packet log: input DENY ppp0 PROTO=6 63.161.207.199:2417 209.212.133.4
7:139 L=48 S=0x00 I=24870 F=0x4000 T=116 SYN (#37)
My question: Can perl somehow run through each line, log the date, and when it finds "PROTO=x" it will store that into a variable, then can it move two : (semicolons) and log the port number which the scan was intended for? (can perl log from characterX to characterY or can it just store X amount of spaces?) which would then store that into a variable as well.. and could then perl (dynamically?) create a file to store each result and just loop it till EoF?
I'm pretty sure I could do the last part of what I'm asking.. but could someone help me write a little perl script to handle the first part?
thanks in advance,
~kyle