Убийство ночной бабочки l1s Хакер, номер #090, стр. 090-068-4 Сканер #!/usr/bin/perl use IO::Socket; use strict; my ($hostname, $file, $port) = @ARGV; $port or $port = 80; $hostname=~s/^http:\/\///; $hostname=~s/\/$//; open(FILE,"<$file") or die "File $file not found!\n"; print "[~] Scan started ($hostname:$port).\n"; while(my $bug=<FILE>) { chomp $bug; $bug = "/".$bug unless ($bug =~ /^\//); print "$hostname$bug\n" if scan($bug); } close(FILE); print "[~] Scan finished.\n"; sub scan { my $string=shift; my $remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $hostname, PeerPort => $port ); unless ($remote) { print "can't connect\n"; exit 0; } $remote->autoflush(1); my $http = qq{HEAD $string HTTP/1.1 HOST: $hostname }; print $remote $http; while(<$remote>) { return "ok" if(/HTTP.+?200\sOK/) or return undef; } } CD Все, что ты увидел, услышал, унюхал в статье, есть на нашем крутом DVD WARNING Помни: действия взломщика противозаконны, так что рекомендую ничего из вышеописанного не повторять. |