From: Roland Häder Date: Tue, 28 Aug 2018 07:41:14 +0000 (+0200) Subject: Merge branch 'master' of mx:/var/cache/git/repos/ctracker X-Git-Url: https://git.mxchange.org/?p=ctracker.git;a=commitdiff_plain;h=c9579e51c3e8f2cc39702920ebcc2e8c2bb874bf;hp=f9c9cd44e9c8936988b2baa1d145c19f63a801d3 Merge branch 'master' of mx:/var/cache/git/repos/ctracker --- diff --git a/.gitattributes b/.gitattributes index dfe0770..72184ce 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,33 @@ -# Auto detect text files and perform LF normalization +# +### Distribute this file on all GIT projects! +# +# Autodetect text files * text=auto + +# Force the following filetypes to have unix eols, so Windows does not break them +*.* text eol=lf + +# Force images/fonts to be handled as binaries +*.jpg binary +*.jpeg binary +*.gif binary +*.png binary +*.t3x binary +*.t3d binary +*.exe binary +*.data binary +*.ttf binary +*.eof binary +*.eot binary +*.swf binary +*.mov binary +*.mp4 binary +*.mp3 binary +*.ogg binary +*.flv binary +*.jar binary +*.pdf binary +*.woff* binary +*.otf binary +*.z binary +*.docx binary diff --git a/libs/lib_connect.php b/libs/lib_connect.php index 240f94a..9524454 100644 --- a/libs/lib_connect.php +++ b/libs/lib_connect.php @@ -46,9 +46,9 @@ function aquireCrackerTrackerDatabaseLink () { // Inits a fake configurtation function crackerTrackerInitFakeConfig () { // Set the array - $GLOBALS['ctracker_config'] = array( + $GLOBALS['ctracker_config'] = [ 'ctracker_alert_user' => 'Y', - ); + ]; } // Checks if the link is up @@ -367,14 +367,14 @@ function ifCrackerTrackerIpHasTicket () { // Adds a ticket based on given (mostly $_POST) data function addCrackerTrackerTicket (array $data) { // Prepare the array - $GLOBALS['ctracker_last_ticket'] = array( + $GLOBALS['ctracker_last_ticket'] = [ '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']), 'ctracker_ticket_comment' => crackerTrackerSecureString($data['comment']) - ); + ]; // Insert it crackerTrackerInsertArray('ctracker_ticket', $GLOBALS['ctracker_last_ticket']); @@ -382,10 +382,10 @@ function addCrackerTrackerTicket (array $data) { // Is there an entry? if ((isset($GLOBALS['ctracker_last_insert_id'])) && ($GLOBALS['ctracker_last_insert_id'] > 0)) { // All fine, so prepare the link between ticket<->data - $data = array( + $data = [ 'ctracker_ticket_id' => $GLOBALS['ctracker_last_insert_id'], 'ctracker_data_id' => $GLOBALS['ctracker_last_suspicious_entry']['id'] - ); + ]; // And insert it as well crackerTrackerInsertArray('ctracker_ticket_data', $data); diff --git a/libs/lib_detector.php b/libs/lib_detector.php index a62ea4b..627e7b6 100644 --- a/libs/lib_detector.php +++ b/libs/lib_detector.php @@ -37,17 +37,17 @@ function initCrackerTrackerArrays () { $GLOBALS['ctracker_base_path'] = dirname(dirname(__FILE__)); // Whitelist some absolute query strings (see below) - $GLOBALS['ctracker_whitelist'] = array( + $GLOBALS['ctracker_whitelist'] = [ 'cmd=new', // LinPHA 'cmd=edit', // LinPHA 'cmd=lostpw', // LinPHA '/css/status_config.php', // MantisBT '/css/common_config.php', // MantisBT '/javascript_config.php', // MantisBT - ); + ]; // Attacks we should detect and block - $GLOBALS['ctracker_get_blacklist'] = array( + $GLOBALS['ctracker_get_blacklist'] = [ // SQL injections 'union ', ' union', 'insert ', 'select ', ' like', 'like ', 'drop ', 'update ', @@ -96,7 +96,7 @@ function initCrackerTrackerArrays () { // php.ini settings 'allow_url_fopen', 'allow_url_include', 'auto_prepend_file', 'disable_functions', 'safe_mode', - 'open_basedir', + 'open_basedir', 'suhosin', 'cgi.force_redirect', 'cgi.redirect_status_env', // PHP commands/scripts 'fopen', 'fwrite', 'phpinfo()', '\', 'base64_decode', 'file_put_contents', @@ -154,11 +154,11 @@ function initCrackerTrackerArrays () { 'window.open', 'img src', 'img src', '.jsp', 'servlet', 'org.apache', 'wwwacl', 'server-info', 'server-status', '/servlet/con', 'http_', 'secure_site, ok', 'chunked', '