![]() |
|
[HELP]Advanced LFI Race Condition PoC (python) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43) +---- Thread: [HELP]Advanced LFI Race Condition PoC (python) (/showthread.php?tid=5794827) |
[HELP]Advanced LFI Race Condition PoC (python) - Hypnoze57 - Feb 4, 2018 Hi guys, I'm trying to create a local PoC to exploit LFI Race Condition on /tmp based on file sending in post data (no session trick). For some of you who don't know about:
I'm doing:
At the beginning, I've tried to use bruteforce method (instead of phpinfo) with self inclusion to slow down execution of script but my self inclusion send me fatal error very fastly (less than 1 second) so I really don't know how the guys who use bf method do. Here is my Python PoC: Code #!/usr/bin/python3Please let me know if you have any idea or if you have already experiment that kind of LFI before :) (with bf or phpinfo assistance) Thank's by advance 😁 RE: [HELP]Advanced LFI Race Condition PoC (python) - Hooded Robin - Feb 5, 2018 Rather than using a for loop to iterate requests, try spinning up the requests in a thread pool (like in the original poc). This will increase your chance of filling memory to the max on the vuln server and potentially increasing the potential delay in the time the temp file is created and then removed by PHP under the hood. Also recommend playing with the padding size a bit, might reduce it a bit. The success rate on Linux w/phpinfo() exposure + LFI is not all that high in my experience and without threading your chances are very minimal. If your experimenting with more advanced LFI methods though, I highly recommend looking more into the Windows method with FindFirstFile quirk which allows you to reliably find the temporary file thanks to the FindFirstFile globbing approach to finding files to read/include. It doesn't require threaded approach either so easy to automate from coding perspective if threading is new to you. Original POC using threading: https://pastebin.com/2ur2XD8T Modified POC: https://pastebin.com/P9utNv2N PowerShell based POC for the Windows LFI+TMP File RCE: https://pastebin.com/jejHPXzS Hope that helps a little... |