picoctf/misc/hashing_job_app/solve.py

25 lines
554 B
Python
Raw Normal View History

2024-09-01 22:10:44 +02:00
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 python3Packages.pwntools
import hashlib
from pwn import *
def main():
addr, port, *_ = "saturn.picoctf.net 57454".split(" ")
r = remote(addr, int(port))
for _ in range(3):
x = r.recvline()
print(x)
print(r.recvline())
digest = hashlib.md5(x.split(b'\'')[1]).hexdigest()
print(digest)
r.sendline(digest.encode())
print(r.recvline())
print(r.recvline())
print(r.recvline())
if __name__ == "__main__":
main()