From: Roland Häder Date: Mon, 25 Jul 2016 07:59:45 +0000 (+0200) Subject: Also log request method X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=361d13973dee40c1415b9650c6716153cfc6ba98;p=ctracker.git Also log request method Signed-off-by: Roland Häder --- diff --git a/libs/lib_detector.php b/libs/lib_detector.php index c70c43a..52b42db 100644 --- a/libs/lib_detector.php +++ b/libs/lib_detector.php @@ -331,18 +331,19 @@ function crackerTrackerLogAttack () { // 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'], - 'check_worm' => $GLOBALS['ctracker_checkworm'], - 'check_post' => $GLOBALS['ctracker_check_post'], - 'server_name' => crackerTrackerServerName(), - 'script_name' => crackerTrackerScriptName(), - 'referer' => crackerTrackerReferer(), - 'proxy_used' => $proxyUsed, - 'first_attempt' => 'NOW()' + 'remote_addr' => determineCrackerTrackerRealRemoteAddress(), + 'proxy_addr' => getenv('REMOTE_ADDR'), + 'user_agent' => crackerTrackerUserAgent(), + 'get_data' => crackerTrackerQueryString(), + 'post_data' => $GLOBALS['ctracker_post_track'], + 'check_worm' => $GLOBALS['ctracker_checkworm'], + 'check_post' => $GLOBALS['ctracker_check_post'], + 'server_name' => crackerTrackerServerName(), + 'script_name' => crackerTrackerScriptName(), + 'referer' => crackerTrackerReferer(), + 'request_method' => $_SERVER['REQUEST_METHOD'], + 'proxy_used' => $proxyUsed, + 'first_attempt' => 'NOW()' ); // Insert the array in database diff --git a/libs/lib_updates.php b/libs/lib_updates.php index 3c53dfb..082b262 100644 --- a/libs/lib_updates.php +++ b/libs/lib_updates.php @@ -72,6 +72,11 @@ FOREIGN KEY ( `ctracker_data_id` ) REFERENCES `' . $GLOBALS['ctracker_dbname'] . 4 => array( 'ALTER TABLE `ctracker_data` ADD INDEX `remote_proxy_last` ( `remote_addr`, `proxy_addr`, `last_attempt` DESC )', ), + + // HTTP request method + 5 => array( + "ALTER TABLE `ctracker_data` ADD `request_method` VARCHAR( 255 ) NULL DEFAULT NULL COMMENT 'HTTP request method' AFTER `referer`, ADD INDEX ( `request_method` )", + ), ); }