精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● CGI>>[灌水]用Net::Ping接口写的SYN端口扫描器

主题:[灌水]用Net::Ping接口写的SYN端口扫描器
发信人: demonalex(啊神)
整理人: workingnow(2003-11-11 15:33:50), 站内信件
#!usr/bin/perl -w
use Net::Ping;
$remote_host=$ARGV[0];
$remote_port_begin=$ARGV[1];
$remote_port_end=$ARGV[2];
#参数辨别部分
if($#ARGV<1){
print("Sorry!Usage:perl sscan.pl remote_host ip_begin [ip_end]\n");
exit 1;
}elsif($#ARGV==1){
$remote_port_end=$remote_port_begin;
}elsif($#ARGV>2){
print("Sorry!Usage:perl sscan.pl remote_host ip_begin [ip_end]\n");
exit 1;}
if($remote_port_begin>$remote_port_end){
print("Sorry!Usage:perl sscan.pl remote_host ip_begin [ip_end]\n");
exit 1;}
#参数辨别部分
#扫描部分
for($i=$remote_port_begin;$i<=$remote_port_end;$i++){
$syn=Net::Ping->new("syn");
$syn->{port_num}=$i;
$syn->ping($remote_host);
if($syn->ack){
print("Host: $ARGV[0]'s Port: $ARGV[1] is Opened!\n");
$syn->close;
}else{
print("Host: $ARGV[0]'s Port: $ARGV[1] may be Closed!:(\n");
$syn->close;
}}
#扫描部分
exit 1;


#用Net::Ping接口写的SYN端口扫描器
#Net::Ping包地址:
#http://search.cpan.org/src/BBB/Net-Ping-2.31/lib/Net/Ping.pm
#格式: perl sscan.pl remote_ip remote_port_begin [remote_port_end]
#有问题请email: demonalex_at_hackermail.com



----
You may say I'm a dreamer 
But I'm not the only one 
I hope someday you'll join us 
And the world will be as one. 

http://demonalex.cnhacker.cn
http://demonalex.dark2s.org

[关闭][返回]