note 72806 added to security
| From: | dangan at blackjaguargaming dot net | Date: | Fri, 02 Feb 2007 02:41:54 +0000 |
| Subject: | note 72806 added to security | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122503@lists.php.net to get a copy of this message | ||
I'd recommend a 404 over a 403 considering a 403 proves there is something worth hacking into.
index.php:
<?php
define('isdoc',1);
include('includes/include.sqlfunctions.php');
// Rest of code for index.php
?>
include.sqlfunctions.php (or other include file):
<?php
if(isdoc !== 1) // Not identical to 1
{
header('HTTP/1.1 404 Not Found');
echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
2.0//EN\">\n<html><head>\n<title>404 Not
Found</title>\n</head>";
echo "<body>\n<h1>Not Found</h1>\n<p>The requested URL
".$_SERVER['REQUEST_URI']." was not found on this server.</p>\n";
echo
"<hr>\n".$_SERVER['SERVER_SIGNATURE']."\n</body></html>\n";
// Echo output similar to Apache's default 404 (if thats what you're using)
exit;
}
// Rest of code for this include
?>
----
Server IP: 203.16.234.90
Probable Submitter: 150.101.110.53
----
Manual Page -- http://www.php.net/manual/en/security.php
Edit -- https://master.php.net/note/edit/72806
Del: integrated -- https://master.php.net/note/delete/72806/integrated
Del: useless -- https://master.php.net/note/delete/72806/useless
Del: bad code -- https://master.php.net/note/delete/72806/bad+code
Del: spam -- https://master.php.net/note/delete/72806/spam
Del: non-english -- https://master.php.net/note/delete/72806/non-english
Del: in docs -- https://master.php.net/note/delete/72806/in+docs
Del: other reasons-- https://master.php.net/note/delete/72806
Reject -- https://master.php.net/note/reject/72806
Search -- https://master.php.net/manage/user-notes.php