// If it differs to original and the *whole* request string is not in whitelist
// then block the attempt
if (isCrackerTrackerWormDetected()) {
- // Send the email, this must be the last line because it contains a die()
+ // Send the email, this must be the last line in this if() block because it contains a exit()
sendCrackerTrackerMail();
} // END - if
// Suspicious POST data detected?
if (isCrackerTrackerPostAttackDetected()) {
- // Send the email, this must be the last line because it contains a die()
+ // Send the email, this must be the last line in this if() block because it contains a exit()
sendCrackerTrackerPostMail();
} // END - if
// Determines the real remote address
function determineCrackerTrackerRealRemoteAddress () {
+ // Initial value
+ $address = '0.0.0.0';
+
// Is a proxy in use?
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
// Proxy was used
} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
// Yet, another proxy
$address = $_SERVER['HTTP_CLIENT_IP'];
- } else {
+ } elseif (isset($_SERVER['REMOTE_ADDR'])) {
// The regular address when no proxy was used
$address = $_SERVER['REMOTE_ADDR'];
}
// Detects the script name
function crackerTrackerScriptName () {
+ // Is it there?
+ if (!isset($_SERVER['SCRIPT_NAME'])) {
+ // Return NULL
+ return NULL;
+ } // END - if
+
// Should always be there!
return crackerTrackerSecureString($_SERVER['SCRIPT_NAME']);
}
// Detects the query string
function crackerTrackerQueryString () {
+ // Is it there?
+ if (!isset($_SERVER['QUERY_STRING'])) {
+ // Return NULL
+ return NULL;
+ } // END - if
+
// Should always be there!
return crackerTrackerEscapeString($_SERVER['QUERY_STRING']);
}
// Detects the server's name
function crackerTrackerServerName () {
+ // Is it there?
+ if (!isset($_SERVER['SERVER_NAME'])) {
+ // Return NULL
+ return NULL;
+ } // END - if
+
// Should always be there!
return crackerTrackerSecureString($_SERVER['SERVER_NAME']);
}