hackerpitbull
05-05-2005, 03:00 PM
Hi guys :)
my friend, made me a program in perl that run
"netstat -n" (u get something like:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 212.199.38.201:80 85.64.114.148:1386 SYN_RECV
tcp 0 0 212.199.38.201:80 84.94.150.194:3043 SYN_RECV
tcp 0 0 212.199.38.201:80 84.94.7.214:3192 SYN_RECV
the program need to show me the seconed IP Addres (without the :80) but only the IP's with SYN_RECV in the end.
thats the prog':
#!/usr/bin/perl
foreach(split(/\n/, `netstat -n`)){/^tcp\s+0\s+0\s+[^\s]+:80\s+([\d.]+):\d+\s+SYN_RECV\s+$/ && print($1."\n");}
but when i run it, nothing seems to hapen... for exmple:
[root@server root]# ./syn.pl
[root@server root]#
how can i make the program work?
thx!
my friend, made me a program in perl that run
"netstat -n" (u get something like:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 212.199.38.201:80 85.64.114.148:1386 SYN_RECV
tcp 0 0 212.199.38.201:80 84.94.150.194:3043 SYN_RECV
tcp 0 0 212.199.38.201:80 84.94.7.214:3192 SYN_RECV
the program need to show me the seconed IP Addres (without the :80) but only the IP's with SYN_RECV in the end.
thats the prog':
#!/usr/bin/perl
foreach(split(/\n/, `netstat -n`)){/^tcp\s+0\s+0\s+[^\s]+:80\s+([\d.]+):\d+\s+SYN_RECV\s+$/ && print($1."\n");}
but when i run it, nothing seems to hapen... for exmple:
[root@server root]# ./syn.pl
[root@server root]#
how can i make the program work?
thx!