Perl AnyEvent::Socket
发布时间:2020-12-16 00:01:49 所属栏目:大数据 来源:网络整理
导读:还是在不断的改写做尝试。 做了些小记录把。方便以后翻。。 # !/usr/bin/perl use Coro; use AnyEvent:: Socket ; use AnyEvent::Ping:: TCP; my @check_list ; my @target = ; foreach my $ip ( @target ){ foreach my $port ( 1 .. 65535 ){ push @check_l
还是在不断的改写做尝试。 做了些小记录把。方便以后翻。。 #!/usr/bin/perl use Coro; use AnyEvent::Socket; use AnyEvent::Ping::TCP; my @check_list; my @target=<>; foreach my $ip (@target){ foreach my $port (1..65535){ push @check_list,async{ $a=tcp_connect $ip => $port,sub { my $fh = shift or die "unable to connect: $!"; }; if(!$a){ print "$port openn"; } # $result=tcp_ping_ack $ip,$port; # nex($ip,$port); } }; }; 这个脚本貌似不太成功,链接成功的就没有提示,不知道为什么。 判断的基准没找到。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |