Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Beginning of script :3</p
use IO::Socket; use strict; print "Connecting :D\n"; my $socket = IO::Socket::INET->new( PeerAddr => '23.113.161.164', # 38.124.108.67 <-- NON vuln ip fo +r testing PeerPort => 123, # 23.113.161.164 <-- This IS a vul +n ip! Proto => 'udp', Timeout => 1); die "Sockets fucking hate you: $!\n" unless $socket; print "Were in, put on the masks\n"; my $payload = "\x97\x00\x00\x00\xAA\x00\x00\x00"; my $good = "\x97\x00\x00\x00"; $socket->send($payload) or die "Nothing got sent."; my $data; $socket->recv($data,4); my $response = substr($data,0,8); $response = reverse($response); if ($response == $good) { print "Success bro!\n"; } else { print "Your whole life is a lie and you are a failure\n"; exit(); }
End of script :3
In the script i included 1 vuln ip, and 1 non-vuln ip. I have tested this with multiple IP's and every NON vuln ip just hangs. All replys are welcomed :D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Timeout not working for IO::Socket
by Corion (Patriarch) on Jan 15, 2014 at 14:19 UTC | |
by Anonymous Monk on Jan 15, 2014 at 14:24 UTC |