This commit is contained in:
THEON-1
2025-12-08 14:52:34 +01:00
parent fe67eec9c3
commit 0fd914ffac
2 changed files with 186 additions and 0 deletions

32
rps/sol.py Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python
from pwn import *
wins = 0
rounds = 0
def play_round(wins):
conn.recvuntil(b"exit the program")
conn.recvline()
conn.sendline(b"1")
conn.recvuntil(b"s):")
conn.recvline()
conn.sendline(b"rock")
conn.recvuntil(b"computer played")
conn.recvline()
result = conn.recvline()
if b"You win" in result:
return wins+1
else:
return 0
conn = remote("saturn.picoctf.net", 49891)
p = log.progress("brute-forcing solution")
while wins < 5:
rounds += 1
wins = play_round(wins)
p.status(f"round {rounds}, wins: {wins}")
p.success("won 5 rounds")
conn.interactive()