Skip to content

Instantly share code, notes, and snippets.

Hackergame 2023 "组委会模拟器" 解题代码
Hackergame 2023 "组委会模拟器" 解题代码
import json
import requests
import re
import asyncio
headers = {
'Cookie': 'YOUR_COOKIE_HERE',
'content-type': 'application/json'
}
url1 = 'http://202.38.93.111:10021/api/getMessages'
url2 = 'http://202.38.93.111:10021/api/deleteMessage'
url3 = 'http://202.38.93.111:10021/api/getflag'
msgs = requests.post(url1, headers=headers).json()['messages']
async def check(args):
idx, msg = args
delay = msg['delay']
text = msg['text']
if re.search(r'hack\[[a-z]+\]', text):
await asyncio.sleep(delay)
r = requests.post(url2, headers=headers, data=json.dumps({'id': idx})).json()
print(f'{idx}: {r}')
if 'error' in r:
print("寄")
async def main():
tasks = [check(i) for i in enumerate(msgs)]
await asyncio.gather(*tasks)
if __name__ == '__main__':
asyncio.run(main())
print(requests.post(url3, headers=headers).json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment