Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Well i finnaly got my script working from a few hours ago. But When i say working what i mean is, IF the ip is vuln then it confirms it and quits the script (yay) But if its not vuln, the script just stays. Here is the script itself.

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
      Yeah thats me, if you read the post i said its me .-. im having new issues after converting it to perl.