// Updates a given entry by just counting it up
function updateCrackerTrackerEntry ($rowData) {
// Construct the SELECT query
- $SQL = 'UPDATE `ctracker_data` SET `count`=`count`+1 WHERE `remote_addr`="' . crackerTrackerEscapeString($rowData['remote_addr']) . '" AND `check_worm` = "' . crackerTrackerEscapeString($rowData['check_worm']) . '" LIMIT 1';
+ $SQL = 'UPDATE `ctracker_data` SET `count`=`count`+1 WHERE (`remote_addr`="' . crackerTrackerEscapeString($rowData['remote_addr']) . '" OR `proxy_addr`="' . crackerTrackerEscapeString($rowData['proxy_addr']) . '") AND `check_worm` = "' . crackerTrackerEscapeString($rowData['check_worm']) . '" LIMIT 1';
// Run the SQL and check if we have one line
runCrackerTrackerSql($SQL, __FUNCTION__, __LINE__);
// Checks if an entry with IP/check_worm/domain combination is there
function isCrackerTrackerEntryFound ($rowData) {
// Construct the SELECT query
- $SQL = 'SELECT `id` FROM `ctracker_data` WHERE `remote_addr`="' . crackerTrackerEscapeString($rowData['remote_addr']) . '" AND `check_worm` = "' . crackerTrackerEscapeString($rowData['check_worm']) . '" AND `server_name`="' . crackerTrackerEscapeString($rowData['server_name']) . '" LIMIT 1';
+ $SQL = 'SELECT `id` FROM `ctracker_data` WHERE (`remote_addr`="' . crackerTrackerEscapeString($rowData['remote_addr']) . '" OR `proxy_addr`="' . crackerTrackerEscapeString($rowData['proxy_addr']) . '") AND `check_worm` = "' . crackerTrackerEscapeString($rowData['check_worm']) . '" AND `server_name`="' . crackerTrackerEscapeString($rowData['server_name']) . '" LIMIT 1';
// Run the SQL and check if we have one line
return ((isCrackerTrackerDatabaseLinkUp()) && (mysql_num_rows(runCrackerTrackerSql($SQL, __FUNCTION__, __LINE__)) == 1));
} // END - if
// We only need the very last attempt to get!
- $result = runCrackerTrackerSql("SELECT * FROM `ctracker_data` WHERE `remote_addr`='" . determineCrackerTrackerRealRemoteAddress() . "' ORDER BY `last_attempt` DESC LIMIT 1", __FUNCTION__, __LINE__);
+ $result = runCrackerTrackerSql("SELECT * FROM `ctracker_data` WHERE `remote_addr`='" . determineCrackerTrackerRealRemoteAddress() . "' OR `proxy_addr`='" . getenv('REMOTE_ADDR') . "' ORDER BY `last_attempt` DESC LIMIT 1", __FUNCTION__, __LINE__);
// Do we have entries?
$found = (mysql_num_rows($result) == 1);
// Does the current IP have a ticket?
function ifCrackerTrackerIpHasTicket () {
// We only give one ticket per IP!
- $result = runCrackerTrackerSql("SELECT * FROM `ctracker_ticket` WHERE `ctracker_ticket_remote_addr`='" . determineCrackerTrackerRealRemoteAddress() . "' LIMIT 1", __FUNCTION__, __LINE__);
+ $result = runCrackerTrackerSql("SELECT * FROM `ctracker_ticket` WHERE `ctracker_ticket_remote_addr`='" . determineCrackerTrackerRealRemoteAddress() . "' OR `ctracker_ticket_proxy_addr`='" . getenv('REMOTE_ADDR') . "' LIMIT 1", __FUNCTION__, __LINE__);
// Do we have a ticket?
$found = (mysql_num_rows($result) == 1);
// Prepare the array
$GLOBALS['ctracker_last_ticket'] = array(
'ctracker_ticket_remote_addr' => determineCrackerTrackerRealRemoteAddress(),
+ 'ctracker_ticket_proxy_addr' => getenv('REMOTE_ADDR'),
'ctracker_ticket_user_agent' => crackerTrackerUserAgent(),
'ctracker_ticket_name' => crackerTrackerSecureString($data['name']),
'ctracker_ticket_email' => crackerTrackerSecureString($data['email']),
// Construct dummy array
$rowData = array(
'remote_addr' => determineCrackerTrackerRealRemoteAddress(),
+ 'proxy_addr' => getenv('REMOTE_ADDR'),
'check_worm' => $GLOBALS['ctracker_checkworm'],
'server_name' => crackerTrackerServerName()
);
// Prepare array for database insert
$rowData = array(
'remote_addr' => determineCrackerTrackerRealRemoteAddress(),
+ 'proxy_addr' => getenv('REMOTE_ADDR'),
'user_agent' => crackerTrackerUserAgent(),
'get_data' => crackerTrackerQueryString(),
'post_data' => $GLOBALS['ctracker_post_track'],
"UPDATE `ctracker_data` SET `script_name`=NULL WHERE `script_name`=''",
"ALTER TABLE `ctracker_data` CHANGE `server_name` `server_name` TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Server''s host name'",
"UPDATE `ctracker_data` SET `server_name`=NULL WHERE `server_name`=''",
- )
+ ),
+
+ // Also store proxy address
+ 2 => array(
+ 'ALTER TABLE `ctracker_data` ADD `proxy_addr` VARCHAR(15) NULL DEFAULT NULL',
+ 'ALTER TABLE `ctracker_ticket` ADD `ctracker_ticket_proxy_addr` VARCHAR(15) NULL DEFAULT NULL',
+ ),
);
}
----------------------------------------------------
Ihre IP: $content[ctracker_ticket_remote_addr]
----------------------------------------------------
+Ihre Proxy-IP: $content[ctracker_ticket_proxy_addr]
+----------------------------------------------------
Ihr Browser: $content[ctracker_ticket_user_agent]
----------------------------------------------------
Kommentar:
----------------------------------------------------
IP: $content[ctracker_ticket_remote_addr]
----------------------------------------------------
+Proxy-IP: $content[ctracker_ticket_proxy_addr]
+----------------------------------------------------
Browser: $content[ctracker_ticket_user_agent]
----------------------------------------------------
Kommentar:
----------------------------------------------------
Your IP: $content[ctracker_ticket_remote_addr]
----------------------------------------------------
+Proxy IP: $content[ctracker_ticket_proxy_addr]
+----------------------------------------------------
Your browser: $content[ctracker_ticket_user_agent]
----------------------------------------------------
Comments:
----------------------------------------------------
Email: $content[ctracker_ticket_email]
----------------------------------------------------
-IP: $content[ctracker_ticket_remote_addr]
+Real IP: $content[ctracker_ticket_remote_addr]
+----------------------------------------------------
+Proxy IP: $content[ctracker_ticket_proxy_addr]
----------------------------------------------------
Browser: $content[ctracker_ticket_user_agent]
----------------------------------------------------