Skip to content

Instantly share code, notes, and snippets.

@RichardNesbitt
Created April 6, 2020 07:23
Show Gist options
  • Save RichardNesbitt/324d3ec36cb4f5bc502bf2910b17b44a to your computer and use it in GitHub Desktop.
Save RichardNesbitt/324d3ec36cb4f5bc502bf2910b17b44a to your computer and use it in GitHub Desktop.
Stop direct access to PHP file in the most annoying way like for wp-config.php or config.php or database.php or any other protected file.
<?php
//just make sure you include $authtoken before you call this file anywhere or you'll be really annoyed!
if(!isset($authtoken)){
for($i=0;$i<1000;$i++){
echo "<script>alert('why for are you haxing mi???');</script>";
}
die("You are not authorized to view this page!!!");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment