Advertisement
Guest User

webscanner - module TRACE

a guest
Mar 20th, 2013
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # try_trace.py
  3. # more at http://hauntit.blogspot.com
  4. #
  5.  
  6.  
  7. import httplib
  8. import sys
  9. import string
  10.  
  11. url = sys.argv[1]
  12.  
  13. conn = httplib.HTTPConnection(url)
  14. #conn.request('TRACE','/w0rkin')
  15. conn.request('TRACE','/<script>alert(/w0rkin/)</script>')
  16. resp = conn.getresponse()
  17. page_response = resp.read()
  18. #print page_response
  19. print
  20. print 'try TRACE for: ', url
  21. print 'Status: ',resp.status, resp.reason
  22.  
  23. full_answer = resp.getheaders()
  24. print '\nWhat we have here:\n'#, full_answer
  25.  
  26. print '-----------------------------------------------'
  27. i=0
  28.  
  29. if resp.status == 200:
  30.   while i < len(full_answer):
  31.     print ' with value:  '.join(full_answer[i])
  32.     i=i+1
  33.   print '-----------------------------------------------'
  34.   print 'Response:\n', page_response
  35. else:
  36.   print 'No TRACE, or other problem :C' # try manually or add debug here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement