-1

So we have a lab where we need to perform a buffer overflow on a program. I already found that GCC has buffer overflow protection and I found that when you compile it, you have to disable it using the -fno-stack-protector flag. After I got past that, i disassembled the code using gdb and found that i want to redirect the program to the address 0x4005b1.

However when i enter user input, how do i enter the hex value of b1 in ASCII?

When the program prompts for user input is there a way to escape the b1 value. something similar to: aaaaaaaaaaaaaaaaaaaaaaaaaaa@^E\xb1 . Normally when I just compiled the program the address would start close to 0x040000, but when i use the -fno-stack-protector is starts at a much later address and that is why i need to redirect the return address to 0x4005b1. If there isn't a way to enter b1, what are some alternative ways to get around this? Could I somehow link the program to start at a particular address and if so, how is that done? Any other help or suggestions would be much appreciated.

4

1 回答 1

0

如果你用一堆 nop 开始你的程序,那么你在地址的底部字节上有一些灵活性。

输入特殊字符取决于您使用的阅读器和行缓冲区代码。例如,GNU readline 使用 Compose 键来输入特殊字符。

于 2012-09-30T21:52:10.263 回答