Skip to content

Instantly share code, notes, and snippets.

@tyage

tyage/readfile.php

Created Mar 3, 2014
Embed
What would you like to do?
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
You can’t perform that action at this time.