-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
$fname=$_GET['file'].".txt"; | ||
|
||
## this one's recurrent and expected to fail when dealing with mix of no-encoding+double encoding (with only nix slashes in use) | ||
|
||
$fnames=explode(" ",$fname); | ||
foreach($fnames as $f) | ||
{ | ||
echo file_get_contents("../".$fname); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
if(isset($_GET['file'])) | ||
{ | ||
$file=str_replace('../','',$_GET['file']); | ||
$file=str_replace('./','',$file); | ||
echo @file_get_contents('./'.$file); | ||
} | ||
#removing ../ then ./ | ||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$fname=$_GET['file']; | ||
$fname=str_replace('../','',$fname); | ||
$fname=urldecode($fname); | ||
echo file_get_contents("./".$fname); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
<?php | ||
|
||
if(isset($_GET['file'])) | ||
{ | ||
$file=str_replace('..','',$_GET['file']); | ||
$file=str_replace(' ','',$file); // removing white spaces | ||
echo @file_get_contents('./'.$file); | ||
} | ||
#removing .. then white spaces | ||
$fname=$_GET['file']; | ||
$fname=str_replace('../','',$fname); | ||
$fname=str_replace("..\\",'',$fname); | ||
echo file_get_contents("./".$fname); | ||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
if(isset($_GET['file'])) | ||
{ | ||
$file=str_replace('..','',$_GET['file']); | ||
$file=str_replace(' ','',$file); // removing white spaces | ||
echo @file_get_contents('./'.$file); | ||
} | ||
#removing .. then white spaces | ||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
<?php | ||
|
||
if(isset($_GET['file'])) | ||
{ | ||
$file=str_replace('../','',$_GET['file']); | ||
echo @file_get_contents('./'.$file); | ||
} | ||
#removing only ../ | ||
$fname=$_GET['file']; | ||
echo file_get_contents("./".$fname); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
$fname=$_GET['file']; | ||
|
||
## this one's recurrent and expected to fail when dealing with mix of no-encoding+double encoding (with only nix slashes in use) | ||
while(stripos($fname,"../"!=FALSE)) | ||
{ | ||
$fname=str_replace('../','',$fname); | ||
} | ||
$fname=urldecode($fname); | ||
echo file_get_contents('./'.$fname); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
$fname=$_GET['file']; | ||
|
||
$fname=str_replace('./','',$fname); | ||
$fname=urldecode($fname); | ||
echo file_get_contents("./".$fname); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$fname=$_GET['file']; | ||
$fname=str_replace('..','',$fname); | ||
$fname=urldecode($fname); | ||
echo file_get_contents("./".$fname); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
<?php | ||
$fname=$_GET['file']; | ||
$fname=str_replace('../','',$fname); | ||
|
||
if(isset($_GET['file'])) | ||
{ | ||
$file=str_replace('../','',$_GET['file']); | ||
$file=str_replace('./','',$file); | ||
echo @file_get_contents('./'.$file); | ||
} | ||
#removing ../ then ./ | ||
echo file_get_contents("./".$fname); | ||
?> |