So, to find the badchars, we will send a string containing all the characters of the ASCII table, with both printable and non-printable ones.
The string will look like this:
@ We edit our exploit code and put the above string in it.
Then, having our target application running and our debugger attached to its process; we relaunch our exploit.
Under the debugger, after the access violation is triggered, we right click on the esp register and choose the option "follow in dump".
在调试器下,访问冲突之后被触发时,我们右键点击ESP寄存器并选择“按照转储”。
这是什么意思?右键没有按照转储。晕~!
We will now see our string and check what are the missing or modified characters at the end of the string.
It is our first badchars. (note it)