Segmentation Fault
Theory
If we send a POST request containing a file, PHP will create a temporary file in /tmp/php<something>
with the contents of that file. This file will be automatically deleted once the request was processed.
If you find a LFI and you manage to trigger a segmentation fault in PHP, the temporary file will never be deleted. Therefore, you can search for it with the LFI vulnerability until you find it and execute arbitrary code.
This method require a PHP 7.0 or PHP 7.2 version
Practice
Following payloads caused a segmentation fault in PHP:
We can use the following python exploit :
Resources
Last updated