satanklawz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use IO::Socket; #unless (@ARGV) { die "usage: $0 URL\n" } die "Usage: $0 <subnet class> ip\n" unless(@ARGV==1); for ($b=0; $b <= 255; $b++) { for ($c=0; $c <= 255; $c++) { for ($d=0; $d <= 255; $d++) { $url = "http://$ARGV[0].$b.$c.$d/oiuert.tct"; #$url = "http://12.101.189.130/p.tttt"; $EOL = "\015\012"; $BLANK = $EOL x 2; $sep = ($url > 1) ? "-------------------\n" : +""; $host = "$ARGV[0].$b.$c.$d"; #$host = "12.101.189.130"; print "\nConnecting to: $host\n"; $remote = IO::Socket::INET->new( Proto => +"tcp", PeerAddr => +$host, PeerPort => +"http(80)", ); if ($remote ==0) {print "Cannot connect to htt +p daemon on $host\n" } else { $remote->autoflush(1); print $remote "GET $url HTTP/1.0" . $BLANK; while ( <$remote> ) { print } print "\n$sep"; close $remote;} } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTP Header Scanner
by Zaxo (Archbishop) on May 17, 2002 at 01:23 UTC | |
by satanklawz (Beadle) on May 17, 2002 at 02:10 UTC | |
|
Re: HTTP Header Scanner
by dsheroh (Monsignor) on May 17, 2002 at 15:08 UTC | |
by Anonymous Monk on May 19, 2002 at 21:22 UTC |