Well i made a simple script to send an packet where i need to read the responce, if the response is what im looking for then print out were good, if not print out were bad, Now if the ip IS vuln, then the script works and prints out that its vuln. Now if its not vuln then the script just hangs and gets stuck on sending the payload of HEX data.
use IO::Socket;
use strict;
print "Connecting..\n";
my $socket = IO::Socket::INET->new(
PeerAddr => '23.113.161.164', # 38.124.108.67 <-- NON vuln ip for testing
PeerPort => 123, # 23.113.161.164 <-- This IS a vuln ip!
Proto => 'udp',
Timeout => 1);
die "Error With Sockets!: $!\n" unless $socket;
print "Connected!\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);
print $response;
if ($response == "\x97\x00\x00\x00") {
print "IP IS VULN\n";
} else {
print "IP IS NOT VULN\n";
exit;
}
Example error:
Using NON vuln ip:
root@localhost:~# perl 2.pl
Connecting..
Connected!
(Thats where it gets stuck)
Using vuln ip:
root@localhost:~# perl 2.pl
Connecting..
Connected!
▒IP IS VULN
(As you can see it does fine)
This is where the script gets stuck:
$socket->send($payload) or die "Nothing got sent.";
Any help will be greatly appreciated.