Stai ir kodas:
Kodas: Pasirinkti visus
#!/usr/bin/perl
use IO::Socket;
use strict;
my ($hostname, $file, $port) = @ARGV;
$port or $port = 80;
$hostname=~s/^http:W//;
$hostname=~s/V$//;
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=~/^V/);
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, PerrPort => $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;
}