Format Strings Template
格式化字符串模板
CONNECTION
Define how you want to exploit the binary
Configure vulnerable binary
In order to exploit the format string you may need to append/prepend some string to the payload
configure them here
Get format string configuration
In order to exploit a format string you need to find a position where part of your payload
is being reflected. Then, you will be able to put in the position arbitrary addresses
and write arbitrary content in those addresses
Therefore, the function get_formatstring_config will find the offset and padd needed to exploit the format string
In this template, the GOT of printf (the part of the GOT table that points to where the printf
function resides) is going to be modified by the address of the system inside the PLT (the
part of the code that will jump to the system function).
Therefore, next time the printf function is executed, system will be executed instead with the same
parameters passed to printf
In some scenarios you will need to loop1 more time to the vulnerability
In that cases you need to overwrite a pointer in the .fini_array for example
Uncomment the commented code below to gain 1 rexecution extra
attach gdb and continue
You can set breakpoints, for example "break *main"
Now that printf function is executing system you just need to find a place where you can
control the parameters passed to printf to execute arbitrary code.
最后更新于