withopen("hosts", 'ab')as file: for i inrange(ip_start,ip_end+1): IP = ip_body + str(i) + ':' + str(port) + '\n' file.write(IP) print("-------------------Success-------------------")
#ip映射对应的脚本
ip = '121.234.254.121' port_start = 3440 port_end = 3450 #以上信息都需要看情况改
withopen('hosts', 'ab')as file: for i inrange(port_start,port_end+1): IP = ip + ':' +str(i) + '\n' file.write(IP) print("--------------------Success--------------------")
defsubmit(): withopen('flags', 'r') as flag_txt: flags = flag_txt.readlines() for flag in flags: flag = flag.strip() d = '' d += flag print(d) try: res = requests.post(url,data=d,headers=header,timeout=2) li(res.text) except: li('connect fail!') continue submit()
注意自己的cookie。
如果给的结构简单,那么可以使用
1 2 3 4 5 6 7
import os withopen('flags', 'r') as flag_txt: flags = flag_txt.readlines() for flag in flags: flag = flag.strip() command = "curl " + "网址/flag?token=ab962bbf1207d41d3aad0f49cd320b95&flag="+flag os.system(command)