#!/usr/bin/perl
#
# s0t4ipv6@Shellcode.com.ar
#
# http-sth.pl v0.1
#
# Este programa fue creado para testear principalmente vulnerabilidaes en los web server
# trabaja en conjunto con el archivo iisvuln.conf, donde se especifica el REQUEST del GET.
# para luego obtener los resultado del un pedido con el fomato:
#  GET /test.ida/?aA. /HTTP1.0
#       ^^^^^^^^^^^^^^
#       Esto contendria el archivo iisvuln.conf
# El archivo iisvuln.conf contiene actualmente las definiciones para los servidores IIS.
#

use Socket;

my ($port,$host,$proto,$portaddr,$file,$line,$recive, $find);

if (!defined($ARGV[0]) || !defined($ARGV[1]) ) {
		print "http-sth.pl v0.1 coded by s0t4ipv6\n";
                print "use: $0 www.target.com 80\n";
                exit(0); }

$port=$ARGV[1];
$file="iisvuln.conf";

# Connect Parameters
$host=inet_aton($ARGV[0]) or die "Unknown host: $host\n";
$proto=getprotobyname('tcp');

if ( ! -z $file ) {
	open(FH, $file) || die "Can't open $file: $!\n";

	while ($line=<FH>) 
	{ 
		chop($line);
		print "Proving: $line\n";
		@recive = _ending("GET $line HTTP/1.0\r\n\n");
		foreach $find (@recive) {
			do { 
			print "Result: $find"; 
			} while ( $find =~ /PATH/ )
		}
		print "****************\n";
	} 
	close FH;

}
close SO;

sub _ending {  
        my ($patrol)=@_;
        socket(SO,PF_INET,SOCK_STREAM,$proto||0) or die("Socket: $!\n");

        if(connect(SO,pack "SnA4x8",2,$port,$host)){
                my @in;
                select(SO); $|=1; 
		print $patrol;

                while(<SO>) 
			{ push @in, $_; last if ( $line = /<head>/) }
                select(STDOUT); close(SO); return @in;

        } else { die "Can't connect: $!\n"; }
}

