You can veiw source of all files with this code urls you will get the html filenames you can get the php/mysql source code as well! UPDATED: I added validation
By : cscartman
<?php /* Setup: Copy the code insert it into any .php file and its ready! Blocking More Pages: If you want to block a file just put: $filename != "your file name" OR DIE("Your not allowed to veiw this code!"); under //validation below and then people cannot veiw that code!
*/ //main part of the file echo "<form action=$PHP_SELF method=post>Filename Or Url: <input type=text name=filename value=$filename size=50><br><br>"; if($filename) { //validation $filename != "/ect/passwd/" OR DIE("Your not allowed to veiw this code!"); //end validation
@$contents = file_get_contents("$filename") OR DIE("No such file!");
//displays file or urls source code if all goes well echo "<center><textarea rows=20 cols=90 name=text>$contents</text><br><br></form>"; }
?>
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.