Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import requests
  2. import re
  3. import time
  4.  
  5. endpointUrl = "" # your endpoint
  6. token = "" # your token
  7. limit = 0.5
  8. l_time = time.time()
  9.  
  10. def search(term, type="username", wildcard=False):
  11. global l_time
  12. try:
  13. time.sleep(0.5)
  14. request = requests.post(
  15. url=endpointUrl,
  16. headers={"Authorization": token},
  17. data={"term": term, "type": type, "wildcard": wildcard}
  18. )
  19. if request.status_code == 200:
  20. time.sleep(limit)
  21. return request.json()
  22. else:
  23. print("Unknown status ({0})".format(request.status_code))
  24. except:
  25. pass
  26.  
  27. def crack(hash, timeout=5):
  28. try:
  29. request = requests.get('https://api.leakbase.pw/hash/?hash={}'.format(hash), timeout=timeout)
  30. if "plain" in request.content:
  31. return re.search("\"plain\":\"(.+?)\"", request.content).group(1)
  32. except:
  33. print('Hash-cracking timed out')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement