Exploit automation with PMCMA presented at KiwiCon 2011

by Endrazine , Jonathan Brossard,

Summary : In this presentation, we introduce a new exploitation methodology of invalid memory reads and writes, based on dataflow analysis after a memory corruption bug has occurred inside a running process.
We will expose a methodology which shall help writing a reliable exploit out of a PoC triggering an invalid memory write, in presence of modern security defense mechanism such as compiler enhancements (such as SSP...), libc protections (eg: safe heap unlinking), linking and dynamic linking enhancements (full read only GOT and relocations) or kernel anti exploitation features (ASLR, NX...).
In particular, we will demonstrate how to : find all the function pointers inside a running process, how to determine which ones would have been dereferenced after the Segmentation fault if the process had kept executing, which ones are truncatable (in particular with 0x00000000). In case all of the above fail, we will demonstrate how to test for overwrites in specific locations in order to indirectly trigger a second vulnerability allowing greater control and eventually full control flow hijacking. All of the above without needing the source code of the application debugged.
In the case of invalid memory reads, we will show how to indirectly influence the control flow of execution by reading arbitrary values, how to trace all the unaligned memory access and how to test if an invalid read can be turned into an invalid write or at least used to infer the mapping of the binary.
We will also introduce a new debugging technique which allows for very effective dynamic testing of all of the above by forcing the debugged process to fork(). All those steps are realized automatically and provide a rating of the best read/write location based on probabilities of mapping addresses (in the hope to defeat ASLR).
These techniques were implemented in the form of a proof of concept tool running under GNU/Linux and Intel architectures : pmcma. The official website of the tool is http://www.pmcma.org.

Endrazine : Jonathan is a security engineer specialised in low level vulnerability discovery. He has presented his research at some of the best conferences worldwide, including h2hc (Brazil), Hackito Ergo Sum (Paris) — of which he is one of the core organisers, Hack in the box (Amsterdam) and DEFCON (Las Vegas) among others.