Skip to content

Instantly share code, notes, and snippets.

@tyage
Created March 3, 2014 15:57
Show Gist options
  • Save tyage/9328016 to your computer and use it in GitHub Desktop.
Save tyage/9328016 to your computer and use it in GitHub Desktop.
Access granted to readfile.php!<br><br><?php<br />
$filename = $_GET["filename"];<br />
$accesscode = $_GET["accesscode"];<br />
if (md5($filename) == $accesscode){<br />
echo "Access granted to $filename!<br><br>";<br />
srand($value);<br />
if (in_array($filename, array('readfile.php', 'index.php', 'pass.txt', 'id.txt'))==TRUE){<br />
$data = file_get_contents($filename);<br />
if ($data !== FALSE) {<br />
echo nl2br($data);<br />
exit();<br />
}<br />
}<br />
echo "File does not exist";<br />
}<br />
else{<br />
echo "Invalid access code";<br />
}<br />
?><br />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment