Bypass LFI filter with double encoding
Hi guys,

I'm trying to bypass a lfi filter using double encoding:

I made three files to see whether it would work, but it doesn't, it will remove everything except the file name.

../include.php: the file I want to include
PHP Code:

test.php: lfi filter that I try to bypass
PHP Code:
$_GET['sFile'] = str_replace("../","",strtolower($_GET['sFile']));
$_GET['sFile'] = str_replace("./","",$_GET['sFile']);
$_GET['sFile'] = str_replace("%2e%2e%2f","",$_GET['sFile']);
$_GET['sFile'] = str_replace("%2e%2f","",$_GET['sFile']);

exploit.php: the script that sends the payload
PHP Code:
/* double encoding of "../" => "%252E%252E%252F" */
$sOutput curl_exec($ch);

Any help would be greatly appreciated.
Thanks in advance!
(04-03-2017, 07:25 PM)peanutbutter Wrote: -snip-
Are you attempting lfi to get some lfi exploits in your exp. Or from not being able to identify more vulns off the target? Lfi point to bigger flaws that are lying around. Possible Shell injections and Remote cmd executions etc... Sqli isn't the easiest to go for imo, as many high end sites have dropped $ on detection of many attacks etc... I only run into blind/time Sqli these days.

Have you done proper recon on your target?
What was your recon approach?
Recon is key to much of exploitation. Minimizes time used in acquiring correct exploitation methods. Scanners are OK but you're better off using burp pro or some good manual techniques AFTER you identified key details on target such as Os, Server, DB etc...

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to bypass two factor authentication? QMark 10 15,161 04-21-2019, 09:38 PM
Last Post: MuddyBucket
  Simple Trick to Bypass File Upload Problem abaykan 2 8,432 05-02-2018, 01:33 PM
Last Post: abaykan
  Possible way to bypass Apache Mod_Security? oxid 1 8,981 08-05-2017, 09:27 PM
Last Post: lunorian
  [Video] Basic LFI and uploading PHP Shell Insider 7 14,883 01-04-2017, 07:29 PM
Last Post: Vector