Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. def sensitive():
  2. print("Checking for files that may hold sensitive information...\n")
  3. time.sleep(5)
  4. pages = ['/sitemap.xml', '/robots.txt', '/.svn', '/.git', '/.htpasswd', '/.htaccess']
  5. part3 = []
  6. for page in pages:
  7. r = requests.get('http://' + domain + page)
  8. if r.status_code == 200:
  9. result = (page + " found!")
  10. part3.append(result)
  11. elif r.status_code == 403:
  12. result2 = (page + " File 403'd (protected)")
  13. part3.append(result2)
  14. else:
  15. result3 = (page + " not found")
  16. part3.append(result3)
  17.  
  18. part3 = ("\n".join(map(str, part3)))
  19. print(part3)
  20. return part3
  21.  
  22. main()
  23.  
  24. correct code is above ^^^
  25.  
  26. change order of code and add to the solution that the "domain" variable is undefined.
  27. good luck fam
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement