diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php
index 0411a1a2e..69fd4baff 100644
--- a/inc/spbc-admin.php
+++ b/inc/spbc-admin.php
@@ -402,6 +402,7 @@ function ($key) {
'progressbar_get_cms_hashes' => __('Receiving hashes', 'security-malware-firewall'),
'progressbar_get_modules_hashes' => __('Receiving plugins hashes', 'security-malware-firewall'),
'progressbar_get_approved_hashes' => __('Updating statuses for the approved files', 'security-malware-firewall'),
+ 'progressbar_get_denied_hashes' => __('Updating statuses for the denied files', 'security-malware-firewall'),
'progressbar_clean_results' => __('Preparing', 'security-malware-firewall'),
// Scanning core
'progressbar_file_system_analysis' => __('Scanning for modifications', 'security-malware-firewall'),
@@ -812,7 +813,7 @@ function spbc_set_malware_scan_warns()
$query = 'SELECT COUNT(*)
FROM ' . SPBC_TBL_SCAN_FILES . '
- WHERE pscan_status = "DANGEROUS" OR analysis_status = "DANGEROUS"';
+ WHERE pscan_status = "DANGEROUS" OR analysis_status = "DANGEROUS" OR status = "DENIED_BY_CT"';
$analysis_has_dangerous = (int)$wpdb->get_var($query) > 0;
$query = 'SELECT COUNT(*)
diff --git a/inc/spbc-scanner.php b/inc/spbc-scanner.php
index 11af7623a..3909c7756 100644
--- a/inc/spbc-scanner.php
+++ b/inc/spbc-scanner.php
@@ -1048,7 +1048,7 @@ function spbc_get_sql_where_addiction_for_table_of_category($category)
global $spbc;
switch ($category) {
case 'critical':
- $res = ' WHERE status = "DENIED_BY_CLOUD"
+ $res = ' WHERE status IN ("DENIED_BY_CLOUD", "DENIED_BY_CT")
OR (
severity IN("CRITICAL")
AND (
@@ -1076,7 +1076,7 @@ function spbc_get_sql_where_addiction_for_table_of_category($category)
$res = ' WHERE last_sent IS NOT NULL';
break;
case 'unknown':
- $res = ' WHERE status NOT IN ("APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD") AND
+ $res = ' WHERE status NOT IN ("APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD","DENIED_BY_CT") AND
detected_at >= ' . (time() - $spbc->settings['scanner__list_unknown__older_than'] * 86400) . ' AND
source IS NULL AND
path NOT LIKE "%wp-content%themes%" AND
diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php
index 1402d24b3..a415f5c1f 100644
--- a/inc/spbc-settings.php
+++ b/inc/spbc-settings.php
@@ -2355,6 +2355,35 @@ function spbc_field_scanner__prepare_data__files(&$table)
$status = '' . __('File is denied by ' . $spbc->data["wl_company_name"] . ' team', 'security-malware-firewall') . '';
}
}
+
+ if ( $table->type === 'critical' && in_array($row->fast_hash, spbc_get_list_of_scheduled_critical_files_to_send())) {
+ $status = __('File will be automatically send for Cloud analysis within 5 minutes.', 'security-malware-firewall');
+ unset($row->actions['send']);
+ unset($row->actions['approve']);
+ unset($row->actions['quarantine']);
+ unset($row->actions['delete']);
+ unset($row->actions['compare']);
+ unset($row->actions['replace']);
+ }
+
+ if ( !empty($row->status) ) {
+ if ( $row->status === 'DENIED_BY_CT' ) {
+ $cloud_status = '' . __('File hash', 'security-malware-firewall') . ':[' . esc_html($row->full_hash) . ']' . '';
+ unset($row->actions['send']);
+ unset($row->actions['view_bad']);
+ }
+ }
+
+ if ( !empty($row->status) ) {
+ if ( $row->status === 'DENIED_BY_CT' ) {
+ $cloud_status = '' . __('File hash', 'security-malware-firewall') . ':[' . esc_html($row->full_hash) . ']' . '';
+ unset($row->actions['send']);
+ unset($row->actions['view_bad']);
+ if ( !empty($row->analysis_status) ) {
+ if ( $row->analysis_status === 'DANGEROUS' ) {
+ $status = '' . __('File is denied by ' . $spbc->data["wl_company_name"] . ' team', 'security-malware-firewall') . '';
+ }
+ }
}
if ( $table->type === 'critical' && in_array($row->fast_hash, spbc_get_list_of_scheduled_critical_files_to_send())) {
@@ -2425,6 +2454,20 @@ function spbc_field_scanner__prepare_data__files(&$table)
$ws_string .= '
';
}
}
+ if ( ! empty($weak_spots['DENIED_HASH'])) {
+ // collecting all kinds of code
+ $all_unique_weak_spots = array();
+ foreach ($weak_spots['DENIED_HASH'] as $_string => $weak_spot_in_string) {
+ $all_unique_weak_spots[] = $weak_spot_in_string[0];
+ }
+ $all_unique_weak_spots = array_unique($all_unique_weak_spots);
+ foreach ($all_unique_weak_spots as $weak_spot_in_string) {
+
+ $ws_string .= ' Hash: '
+ . 'denied';
+
+ $ws_string .= '
';
+ }
if ( ! empty($weak_spots['DANGER'])) {
// collecting all kinds of code
$all_unique_weak_spots = array();
@@ -2433,10 +2476,12 @@ function spbc_field_scanner__prepare_data__files(&$table)
}
$all_unique_weak_spots = array_unique($all_unique_weak_spots);
foreach ($all_unique_weak_spots as $weak_spot_in_string) {
+
$ws_string .= ' Danger: '
. (strlen($weak_spot_in_string) > 30
? substr($weak_spot_in_string, 0, 30) . '...'
: $weak_spot_in_string);
+
$ws_string .= '
';
}
}
@@ -2877,6 +2922,7 @@ function spbc_field_scanner()
. '' . __('Receiving plugin and theme hashes', 'security-malware-firewall') . ' -> '
. '' . __('Preparing', 'security-malware-firewall') . ' -> '
. '' . __('Scanning for modifications', 'security-malware-firewall') . ' -> '
+ . '' . __('Updating statuses for the denied files', 'security-malware-firewall') . ' -> '
. '' . __('Updating statuses for the approved files', 'security-malware-firewall') . ' -> ';
if ($spbc->settings['scanner__file_monitoring']) {
@@ -3380,6 +3426,7 @@ function spbc_list_table__get_args_by_type($table_type)
$args['sql']['add_col'][] = 'analysis_status';
$args['sql']['add_col'][] = 'pscan_status';
$args['sql']['add_col'][] = 'pscan_pending_queue';
+ $args['sql']['add_col'][] = 'full_hash';
break;
case 'suspicious':
@@ -4652,6 +4699,11 @@ function spbc_settings__get_description()
'title' => __('Directory exclusions ruleset', 'security-malware-firewall'),
'desc' => __('This rules will exclude the directory and all subdirectories matching the specified path. Any type of directory separator is acceptable. Example: wp-content/themes/yourtheme/skipthisdir', 'security-malware-firewall'),
),
+ 'hash_denied_hash' => array(
+ 'title' => 'denied_hash',
+ 'desc' => __('The file hash is in denied list. It means that the Security analysts have marked this file
+ as critically dangerous early. We do recommend you to order the Security Audit service.', 'security-malware-firewall')
+ ),
'no_description' => array(
'title' => esc_html($setting_id),
'desc' => __('No description provided yet for this item. We are sorry about this. Please, contact support@cleantalk.org for further help.', 'security-malware-firewall'),
diff --git a/js/spbc-scanner-plugin.min.js b/js/spbc-scanner-plugin.min.js
index 8bcf1a17d..5f6973b4f 100644
--- a/js/spbc-scanner-plugin.min.js
+++ b/js/spbc-scanner-plugin.min.js
@@ -1,2 +1,2 @@
-"use strict";class spbcMalwareScanner{first_start=!0;active=!1;root="";settings=[];states=["get_cms_hashes","get_modules_hashes","clean_results","file_system_analysis","get_approved_hashes","signature_analysis","heuristic_analysis","schedule_send_heuristic_critical_files","auto_cure_backup","auto_cure","outbound_links","frontend_analysis","important_files_listing","send_results"];state=null;offset=0;amount=0;total_scanned=0;scan_percent=0;percent_completed=0;paused=!1;button=null;spinner=null;progress_overall=null;progressbar=null;progressbar_text=null;timeout=6e4;state_timer=0;constructor(s){for(var t in console.log("init"),jQuery("#spbcscan-results-log-module").length&&jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),void 0!==s.settings.auto_cure&&(s.settings.scanner__auto_cure_backup="1"),s)void 0!==this[t]&&(this[t]=s[t])}actionControl(){null===this.state?this.start():this.paused?(this.resume(),this.controller()):this.pause()}start(){this.active=!0,this.state_timer=Math.round((new Date).getTime()/1e3),this.state=this.getNextState(null),this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold"),this.progressbar.show(500),this.progress_overall.show(500),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),setTimeout(()=>{this.controller()},1e3)}pause(s,t,e){console.log("PAUSE"),this.button.html(spbcScaner.button_scan_resume),this.spinner.css({display:"none"}),this.paused=!0,this.active=!1}resume(s){console.log("RESUME"),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),this.paused=!1,this.active=!0}end(s){this.progressbar.hide(500),this.progress_overall.hide(500),this.button.html(spbcScaner.button_scan_perform),this.spinner.css({display:"none"}),this.state=null,this.total_links=0,this.plug=!1,this.total_scanned=0,this.active=!1,s?document.location=document.location:(spbc_sendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(s,t,e,a){jQuery(a).accordion("destroy").html(s).accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1}),spbc_tbl__bulk_actions__listen(),spbc_tbl__row_actions__listen(),spbc_tbl__pagination__listen(),spbc_tbl__sort__listen(),spbcStartShowHide(),spbc_scanner__reload_scan_info()}},jQuery("#spbc_scan_accordion")),jQuery("#spbc_scanner_clear").length||jQuery('Clear scanner logs
').insertBefore("#spbcscan-scanner-caption"))}controller(s){if(console.log(this.state),void 0!==s&&s.end){if(this.state=this.getNextState(this.state),void 0===this.state)return void this.end();this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold")}if(!0!==this.paused){var t={action:"spbc_scanner_controller_front",method:this.state,offset:this.offset},s={type:"GET",success:this.success,callback:this.successCallback,error:this.error,errorOutput:this.errorOutput,complete:null,context:this,timeout:12e4};switch(this.state){case"get_modules_hashes":this.amount=2;break;case"clear_table":this.amount=1e4;break;case"file_system_analysis":this.amount=700;break;case"auto_cure":this.amount=5;break;case"outbound_links":this.amount=10;break;case"frontend_analysis":this.amount=spbcSettings.frontendAnalysisAmount;break;case"signature_analysis":this.amount=10,t.status="UNKNOWN,MODIFIED,OK,INFECTED";break;case"heuristic_analysis":this.amount=4,t.status="UNKNOWN,MODIFIED,OK,INFECTED";break;case"schedule_send_heuristic_critical_files":this.amount=1}t.amount=this.amount,spbc_sendAJAXRequest(t,s,jQuery("#spbc_scan_accordion"))}}getNextState(s){return s=null===s?this.states[0]:this.states[this.states.indexOf(s)+1],s=void 0!==this.settings["scanner__"+s]&&0==+this.settings["scanner__"+s]?this.getNextState(s):s}setPercents(s){this.percent_completed=Math.floor(100*s)/100,this.progressbar.progressbar("option","value",this.percent_completed),this.progressbar_text.text(spbcScaner["progressbar_"+this.state]+" - "+this.percent_completed+"%")}success(s){s.error?this.error({status:200,responseText:s.error},s.error,s.msg):this.successCallback&&this.successCallback(s,this.data,this.obj)}successCallback(s){console.log(s),void 0!==s.total&&(this.scan_percent=100/s.total),void 0!==s.processed_items&&("heuristic_analysis"===this.state&&0!==typeof s.total&&this.logRaw(''),"signature_analysis"===this.state&&0!==typeof s.total&&this.logRaw(''),this.logFileEntry(s.processed_items)),void 0!==s.stage_data_for_logging&&this.logStageEntry(s.stage_data_for_logging),"undefined"!==s.cured&&0{this.controller(s)},300))}error(s,t,e){var a=this.errorOutput;if(console.log("%c APBCT_AJAX_ERROR","color: red;"),console.log(t),console.log(e),console.log(s),200===s.status)if("parsererror"===t)a("Unexpected response from server. See console for details.",this.state),console.log("%c "+s.responseText,"color: pink;");else{let s=t;void 0!==e&&(s+=" Additional info: "+e),a(s,this.state)}else 500===s.status?a("Internal server error.",this.state):a("Unexpected response code: "+s.status+". Error: "+t,this.state);this.progressbar&&this.progressbar.fadeOut("slow"),this.end()}errorOutput(s,t){spbcModal.open().putError(s+"
Stage: "+t)}logRaw(s){jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper .panel-body").prepend(s)}logFileEntry(s){for(var t in s)this.logRaw(''+this.getSiteUTCShiftedTimeString()+" - "+s[t].path+": "+s[t].status+"
")}logStageEntry(s){this.logRaw(''+this.getSiteUTCShiftedTimeString()+" - "+s.title+" "+s.description+"
")}showLinkForShuffleSalts(s){jQuery("#spbc_notice_about_shuffle_link").remove(),jQuery(jQuery(".spbc_tab--active .spbc_wrapper_field p")[1]).after('")}getSiteUTCShiftedTimeString(){var s=!1,t=-1*(new Date).getTimezoneOffset()*1e3*60,t=(s="undefined"!=typeof spbcScaner&&void 0!==spbcScaner.timezone_shift&&!1!==spbcScaner.timezone_shift?Date.now()-t+1e3*spbcScaner.timezone_shift:s)?new Date(s):new Date,s=new Intl.DateTimeFormat("en-US",{month:"short"}).format,e=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return s(t)+" "+t.getDate()+" "+t.getFullYear()+" "+t.getHours()+":"+e+":"+a}}
+"use strict";class spbcMalwareScanner{first_start=!0;active=!1;root="";settings=[];states=["get_cms_hashes","get_modules_hashes","clean_results","file_system_analysis","get_approved_hashes","get_denied_hashes","signature_analysis","heuristic_analysis","schedule_send_heuristic_critical_files","auto_cure_backup","auto_cure","outbound_links","frontend_analysis","important_files_listing","send_results"];state=null;offset=0;amount=0;total_scanned=0;scan_percent=0;percent_completed=0;paused=!1;button=null;spinner=null;progress_overall=null;progressbar=null;progressbar_text=null;timeout=6e4;state_timer=0;constructor(s){for(var t in console.log("init"),jQuery("#spbcscan-results-log-module").length&&jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),void 0!==s.settings.auto_cure&&(s.settings.scanner__auto_cure_backup="1"),s)void 0!==this[t]&&(this[t]=s[t])}actionControl(){null===this.state?this.start():this.paused?(this.resume(),this.controller()):this.pause()}start(){this.active=!0,this.state_timer=Math.round((new Date).getTime()/1e3),this.state=this.getNextState(null),this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold"),this.progressbar.show(500),this.progress_overall.show(500),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),setTimeout(()=>{this.controller()},1e3)}pause(s,t,e){console.log("PAUSE"),this.button.html(spbcScaner.button_scan_resume),this.spinner.css({display:"none"}),this.paused=!0,this.active=!1}resume(s){console.log("RESUME"),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),this.paused=!1,this.active=!0}end(s){this.progressbar.hide(500),this.progress_overall.hide(500),this.button.html(spbcScaner.button_scan_perform),this.spinner.css({display:"none"}),this.state=null,this.total_links=0,this.plug=!1,this.total_scanned=0,this.active=!1,s?document.location=document.location:(spbc_sendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(s,t,e,a){jQuery(a).accordion("destroy").html(s).accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1}),spbc_tbl__bulk_actions__listen(),spbc_tbl__row_actions__listen(),spbc_tbl__pagination__listen(),spbc_tbl__sort__listen(),spbcStartShowHide(),spbc_scanner__reload_scan_info()}},jQuery("#spbc_scan_accordion")),jQuery("#spbc_scanner_clear").length||jQuery('Clear scanner logs
').insertBefore("#spbcscan-scanner-caption"))}controller(s){if(console.log(this.state),void 0!==s&&s.end){if(this.state=this.getNextState(this.state),void 0===this.state)return void this.end();this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold")}if(!0!==this.paused){var t={action:"spbc_scanner_controller_front",method:this.state,offset:this.offset},s={type:"GET",success:this.success,callback:this.successCallback,error:this.error,errorOutput:this.errorOutput,complete:null,context:this,timeout:12e4};switch(this.state){case"get_modules_hashes":this.amount=2;break;case"clear_table":this.amount=1e4;break;case"file_system_analysis":this.amount=700;break;case"auto_cure":this.amount=5;break;case"outbound_links":this.amount=10;break;case"frontend_analysis":this.amount=spbcSettings.frontendAnalysisAmount;break;case"signature_analysis":this.amount=10,t.status="UNKNOWN,MODIFIED,OK,INFECTED";break;case"heuristic_analysis":this.amount=4,t.status="UNKNOWN,MODIFIED,OK,INFECTED";break;case"schedule_send_heuristic_critical_files":this.amount=1}t.amount=this.amount,spbc_sendAJAXRequest(t,s,jQuery("#spbc_scan_accordion"))}}getNextState(s){return s=null===s?this.states[0]:this.states[this.states.indexOf(s)+1],s=void 0!==this.settings["scanner__"+s]&&0==+this.settings["scanner__"+s]?this.getNextState(s):s}setPercents(s){this.percent_completed=Math.floor(100*s)/100,this.progressbar.progressbar("option","value",this.percent_completed),this.progressbar_text.text(spbcScaner["progressbar_"+this.state]+" - "+this.percent_completed+"%")}success(s){s.error?this.error({status:200,responseText:s.error},s.error,s.msg):this.successCallback&&this.successCallback(s,this.data,this.obj)}successCallback(s){console.log(s),void 0!==s.total&&(this.scan_percent=100/s.total),void 0!==s.processed_items&&("heuristic_analysis"===this.state&&0!==typeof s.total&&this.logRaw(''),"signature_analysis"===this.state&&0!==typeof s.total&&this.logRaw(''),this.logFileEntry(s.processed_items)),void 0!==s.stage_data_for_logging&&this.logStageEntry(s.stage_data_for_logging),"undefined"!==s.cured&&0{this.controller(s)},300))}error(s,t,e){var a=this.errorOutput;if(console.log("%c APBCT_AJAX_ERROR","color: red;"),console.log(t),console.log(e),console.log(s),200===s.status)if("parsererror"===t)a("Unexpected response from server. See console for details.",this.state),console.log("%c "+s.responseText,"color: pink;");else{let s=t;void 0!==e&&(s+=" Additional info: "+e),a(s,this.state)}else 500===s.status?a("Internal server error.",this.state):a("Unexpected response code: "+s.status+". Error: "+t,this.state);this.progressbar&&this.progressbar.fadeOut("slow"),this.end()}errorOutput(s,t){spbcModal.open().putError(s+"
Stage: "+t)}logRaw(s){jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper .panel-body").prepend(s)}logFileEntry(s){for(var t in s)this.logRaw(''+this.getSiteUTCShiftedTimeString()+" - "+s[t].path+": "+s[t].status+"
")}logStageEntry(s){this.logRaw(''+this.getSiteUTCShiftedTimeString()+" - "+s.title+" "+s.description+"
")}showLinkForShuffleSalts(s){jQuery("#spbc_notice_about_shuffle_link").remove(),jQuery(jQuery(".spbc_tab--active .spbc_wrapper_field p")[1]).after('")}getSiteUTCShiftedTimeString(){var s=!1,t=-1*(new Date).getTimezoneOffset()*1e3*60,t=(s="undefined"!=typeof spbcScaner&&void 0!==spbcScaner.timezone_shift&&!1!==spbcScaner.timezone_shift?Date.now()-t+1e3*spbcScaner.timezone_shift:s)?new Date(s):new Date,s=new Intl.DateTimeFormat("en-US",{month:"short"}).format,e=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return s(t)+" "+t.getDate()+" "+t.getFullYear()+" "+t.getHours()+":"+e+":"+a}}
//# sourceMappingURL=spbc-scanner-plugin.min.js.map
diff --git a/js/spbc-scanner-plugin.min.js.map b/js/spbc-scanner-plugin.min.js.map
index 7d18ae20e..3b03e82ec 100644
--- a/js/spbc-scanner-plugin.min.js.map
+++ b/js/spbc-scanner-plugin.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"spbc-scanner-plugin.min.js","sources":["spbc-scanner-plugin.js"],"sourcesContent":["'use strict';\n\nclass spbcMalwareScanner{\n\n\tfirst_start = true;\n\n\tactive = false;\n\n\troot = '';\n\tsettings = [];\n\tstates = [\n\t\t'get_cms_hashes',\n\t\t'get_modules_hashes',\n\t\t'clean_results',\n\t\t'file_system_analysis',\n\t\t'get_approved_hashes',\n\t\t'signature_analysis',\n\t\t'heuristic_analysis',\n\t\t'schedule_send_heuristic_critical_files',\n\t\t'auto_cure_backup',\n\t\t'auto_cure',\n\t\t'outbound_links',\n\t\t'frontend_analysis',\n\t\t'important_files_listing',\n\t\t'send_results',\n\t];\n\tstate = null;\n\toffset = 0;\n\tamount = 0;\n\ttotal_scanned = 0;\n\tscan_percent = 0;\n\tpercent_completed = 0;\n\n\tpaused = false;\n\n\tbutton = null;\n\tspinner = null;\n\n\tprogress_overall = null;\n\tprogressbar = null;\n\tprogressbar_text = null;\n\n\ttimeout = 60000;\n\n\tstate_timer = 0;\n\n\tconstructor ( properties ) {\n\n\t\tconsole.log('init');\n\t\tif (jQuery('#spbcscan-results-log-module').length) {\n\t\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden')\n\t\t}\n\n\t\t// Crunch for cure backups\n\t\tif( typeof properties['settings']['auto_cure'] !== 'undefined' ){\n\t\t\tproperties['settings']['scanner__auto_cure_backup'] = '1';\n\t\t}\n\n\t\tfor( let key in properties ){\n\t\t\tif( typeof this[key] !== 'undefined' ){\n\t\t\t\tthis[key] = properties[key];\n\t\t\t}\n\t\t}\n\n\t};\n\n\tactionControl(){\n\n\t\tif(this.state === null){\n\t\t\tthis.start();\n\n\t\t}else if(this.paused){\n\t\t\tthis.resume();\n\t\t\tthis.controller();\n\n\t\t}else{\n\t\t\tthis.pause();\n\t\t}\n\t};\n\n\tstart(){\n\n\t\tthis.active = true;\n\t\tthis.state_timer = Math.round(new Date().getTime() /1000);\n\n\t\tthis.state = this.getNextState( null );\n\n\t\tthis.setPercents( 0 );\n\t\tthis.scan_percent = 0;\n\t\tthis.offset = 0;\n\t\tthis.progress_overall.children('span')\n\t\t\t.removeClass('spbc_bold')\n\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t.addClass('spbc_bold');\n\n\t\tthis.progressbar.show(500);\n\t\tthis.progress_overall.show(500);\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\n\t\tsetTimeout(() => {\n\t\t\tthis.controller();\n\t\t}, 1000);\n\n\t};\n\n\tpause( result, data, opt ){\n\t\tconsole.log('PAUSE');\n\t\tthis.button.html(spbcScaner.button_scan_resume);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.paused = true;\n\t\tthis.active = false;\n\t};\n\n\tresume( opt ){\n\t\tconsole.log('RESUME');\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\t\tthis.paused = false;\n\t\tthis.active = true;\n\t};\n\n\tend( reload ){\n\n\t\tthis.progressbar.hide(500);\n\t\tthis.progress_overall.hide(500);\n\t\tthis.button.html(spbcScaner.button_scan_perform);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.state = null;\n\t\tthis.total_links = 0;\n\t\tthis.plug = false;\n\t\tthis.total_scanned = 0;\n\t\tthis.active = false;\n\n\t\tif(reload){\n\t\t\tdocument.location = document.location;\n\t\t}else{\n\t\t\tspbc_sendAJAXRequest(\n\t\t\t\t{action: 'spbc_scanner_tab__reload_accordion'},\n\t\t\t\t{\n\t\t\t\t\tnotJson: true,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tjQuery(obj).accordion('destroy')\n\t\t\t\t\t\t\t.html(result)\n\t\t\t\t\t\t\t.accordion({\n\t\t\t\t\t\t\t\theader: 'h3',\n\t\t\t\t\t\t\t\theightStyle: 'content',\n\t\t\t\t\t\t\t\tcollapsible: true,\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tspbc_tbl__bulk_actions__listen();\n\t\t\t\t\t\tspbc_tbl__row_actions__listen();\n\t\t\t\t\t\tspbc_tbl__pagination__listen();\n\t\t\t\t\t\tspbc_tbl__sort__listen();\n\t\t\t\t\t\tspbcStartShowHide();\n\t\t\t\t\t\tspbc_scanner__reload_scan_info();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tjQuery('#spbc_scan_accordion')\n\t\t\t);\n\n\t\t\tif (!jQuery('#spbc_scanner_clear').length) {\n\t\t\t\tlet clear_link = 'Clear scanner logs
';\n\t\t\t\tjQuery(clear_link).insertBefore('#spbcscan-scanner-caption');\n\t\t\t}\n\t\t}\n\n\t};\n\n\tcontroller( result ) {\n\n\t\tconsole.log(this.state);\n\n\t\t// The current stage is over. Switching to the new one\n\t\tif( typeof result !== 'undefined' && result.end ){\n\n\t\t\tthis.state = this.getNextState( this.state );\n\n\t\t\t// End condition\n\t\t\tif (typeof this.state === 'undefined'){\n\t\t\t\tthis.end();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set percent to 0\n\t\t\tthis.setPercents( 0 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\n\t\t\t// Changing visualizing of the current stage\n\t\t\tthis.progress_overall.children('span')\n\t\t\t\t.removeClass('spbc_bold')\n\t\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t\t.addClass('spbc_bold');\n\t\t}\n\n\t\t// Break execution if paused\n\t\tif( this.paused === true )\n\t\t\treturn;\n\n\t\t// // AJAX params\n\t\tlet data = {\n\t\t\taction: 'spbc_scanner_controller_front',\n\t\t\tmethod: this.state,\n\t\t\toffset: this.offset,\n\t\t};\n\n\t\tvar params = {\n\t\t\ttype: 'GET',\n\t\t\tsuccess: this.success,\n\t\t\tcallback: this.successCallback,\n\t\t\terror: this.error,\n\t\t\terrorOutput: this.errorOutput,\n\t\t\tcomplete: null,\n\t\t\tcontext: this,\n\t\t\ttimeout: 120000\n\t\t};\n\n\t\tswitch (this.state) {\n\t\t\tcase 'get_modules_hashes': this.amount = 2; break;\n\t\t\tcase 'clear_table': this.amount = 10000; break;\n\t\t\tcase 'file_system_analysis': this.amount = 700; break;\n\t\t\tcase 'auto_cure': this.amount = 5; break;\n\t case 'outbound_links': this.amount = 10; break;\n\t case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\n\t\t\tcase 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'schedule_send_heuristic_critical_files': this.amount = 1; break;\n\t\t}\n\n\t\tdata.amount = this.amount;\n\n\t\tspbc_sendAJAXRequest(\n\t\t\tdata,\n\t\t\tparams,\n\t\t\tjQuery('#spbc_scan_accordion')\n\t\t);\n\n\t};\n\n\tgetNextState( state ) {\n\n\t\tstate = state === null ? this.states[0] : this.states[ this.states.indexOf( state ) + 1 ];\n\n\t\tif (typeof this.settings[ 'scanner__' + state ] !== 'undefined' && +this.settings[ 'scanner__' + state ] === 0)\n\t\t\tstate = this.getNextState( state );\n\n\t\treturn state;\n\t};\n\n\tsetPercents( percents ){\n\t\tthis.percent_completed = Math.floor( percents * 100 ) / 100;\n\t\tthis.progressbar.progressbar( 'option', 'value', this.percent_completed );\n\t\tthis.progressbar_text.text( spbcScaner[ 'progressbar_' + this.state ] + ' - ' + this.percent_completed + '%' );\n\t};\n\n\tsuccess( response ){\n\n\t\tif( !! response.error ){\n\n\t\t\tthis.error(\n\t\t\t\t{status: 200, responseText: response.error},\n\t\t\t\tresponse.error,\n\t\t\t\tresponse.msg\n\t\t\t);\n\n\t\t}else{\n\t\t\tif( this.successCallback )\n\t\t\t\tthis.successCallback( response, this.data, this.obj );\n\t\t}\n\n\t};\n\n\t// Processing response from backend\n\tsuccessCallback( result ){\n\n\t\tconsole.log( result );\n\n\t\tif( typeof result.total !== 'undefined' )\n\t\t\tthis.scan_percent = 100 / result.total;\n\n\t\tif( typeof result.processed_items !== 'undefined'){\n\n\t\t\tif( this.state === 'heuristic_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('');\n\t\t\tif( this.state === 'signature_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('');\n\n\t\t\tthis.logFileEntry( result.processed_items );\n\t\t}\n\n\t\tif( typeof result.stage_data_for_logging !== 'undefined'){\n\t\t\tthis.logStageEntry( result.stage_data_for_logging );\n\t\t}\n\n\t\t// Add link on shuffle salt if cured\n\t\tif (result.cured !== 'undefined' && Number(result.cured) > 0) {\n\t\t\tthis.showLinkForShuffleSalts(result.message);\n\t\t}\n\n\t\tif( result.end !== true && result.end !== 1 ){\n\t\t\tthis.setPercents( this.percent_completed + result.processed * this.scan_percent );\n\t\t\tthis.offset = this.offset + result.processed;\n\t\t\tthis.controller( result );\n\t\t}else{\n\t\t\tconsole.log( this.state + \" stage took \" + ( Math.round(new Date().getTime() /1000) - this.state_timer ) + \" seconds to complete\" );\n\t\t\tthis.state_timer = Math.round(new Date().getTime()/1000);\n\t\t\tthis.setPercents( 100 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.controller( result );\n\t\t\t}, 300);\n\t\t}\n\t};\n\n\terror( xhr, status, error ){\n\n\t\tlet errorOutput = this.errorOutput;\n\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n\t\tconsole.log( status );\n\t\tconsole.log( error );\n\t\tconsole.log( xhr );\n\n\t\tif( xhr.status === 200 ){\n\t\t\tif( status === 'parsererror' ){\n\t\t\t\terrorOutput( 'Unexpected response from server. See console for details.', this.state );\n\t\t\t\tconsole.log( '%c ' + xhr.responseText, 'color: pink;' );\n\t\t\t}else{\n\t\t\t\tlet error_string = status;\n\t\t\t\tif( typeof error !== 'undefined' )\n\t\t\t\t\terror_string += ' Additional info: ' + error;\n\t\t\t\terrorOutput( error_string, this.state );\n\t\t\t}\n\t\t}else if(xhr.status === 500){\n\t\t\terrorOutput( 'Internal server error.', this.state);\n\t\t}else\n\t\t\terrorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\n\n\t\tif( this.progressbar )\n\t\t\tthis.progressbar.fadeOut('slow');\n\n\t\tthis.end();\n\t};\n\n\terrorOutput( error_msg, stage ){\n\t\tspbcModal.open().putError( error_msg + '
Stage: ' + stage);\n\t};\n\n\tlogRaw(message_to_log ){\n\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper .panel-body').prepend( message_to_log );\n\t};\n\n\tlogFileEntry(items){\n\t\tfor ( var key in items ){\n\t\t\tthis.logRaw( '' + this.getSiteUTCShiftedTimeString() + ' - ' + items[ key ].path + ': ' + items[ key ].status + '
' );\n\t\t}\n\t};\n\n\tlogStageEntry(data){\n\t\tthis.logRaw( '' + this.getSiteUTCShiftedTimeString() + ' - ' + '' + data.title + ' ' + '' + data.description + '
' );\n\t};\n\n\tshowLinkForShuffleSalts(message) {\n\t\tjQuery('#spbc_notice_about_shuffle_link').remove();\n\t\tjQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\n\t\t\t.after(\n\t\t\t\t''\n\t\t\t);\n\t}\n\n\tgetSiteUTCShiftedTimeString(){\n\t\tvar utc_shifted_ts = false;\n\t\t//gettings current system/browser offset\n\t\tvar current_browser_offset = new Date().getTimezoneOffset();\n\t\tcurrent_browser_offset = current_browser_offset * -1 * 1000 * 60;\n\t\t//chek if global ct object is defined\n\t\tif (typeof spbcScaner !== \"undefined\"\n\t\t\t&& typeof spbcScaner.timezone_shift !== \"undefined\"\n\t\t\t&& spbcScaner.timezone_shift !== false){\n\t\t\tutc_shifted_ts = Date.now() - current_browser_offset + (spbcScaner.timezone_shift * 1000);\n\t\t}\n\t\tvar ct_date = utc_shifted_ts ? new Date(utc_shifted_ts) : new Date();\n\t\t//construct date string\n\t\tvar shortMonthName = new Intl.DateTimeFormat(\"en-US\", { month: \"short\" }).format;\n\t\tvar minutes = String(ct_date.getMinutes()).padStart(2, '0');\n\t\tvar seconds = String(ct_date.getSeconds()).padStart(2, '0');\n\t\treturn shortMonthName(ct_date) + ' ' + ct_date.getDate() + ' ' + ct_date.getFullYear() + ' ' + ct_date.getHours() + ':' + minutes + ':' + seconds\n\t}\n\n}\n"],"names":["spbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","total_links","plug","document","location","spbc_sendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","spbc_scanner__reload_scan_info","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","indexOf","percents","floor","text","response","responseText","msg","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","cured","Number","showLinkForShuffleSalts","message","processed","xhr","error_string","fadeOut","error_msg","stage","spbcModal","open","putError","message_to_log","prepend","items","getSiteUTCShiftedTimeString","path","title","description","remove","after","utc_shifted_ts","current_browser_offset","getTimezoneOffset","ct_date","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"AAAA,mBAEMA,mBAELC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAQ,GACRC,SAAW,GACXC,OAAS,CACR,iBACA,qBACA,gBACA,uBACA,sBACA,qBACA,qBACA,yCACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEDC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAEdC,YAAcC,GAYb,IAAKC,IAAIC,KAVTC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QAC1CD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIR,KAAA,IAAxCP,EAAqB,SAAa,YAC5CA,EAAqB,SAA6B,0BAAI,KAGvCA,EACU,KAAA,IAAdQ,KAAKN,KACfM,KAAKN,GAAOF,EAAWE,GAI1B,CAEAO,gBAEmB,OAAfD,KAAKvB,MACPuB,KAAKE,MAAM,EAEHF,KAAKjB,QACbiB,KAAKG,OAAO,EACZH,KAAKI,WAAW,GAGhBJ,KAAKK,MAAM,CAEb,CAEAH,QAECF,KAAK3B,OAAS,CAAA,EACd2B,KAAKV,YAAcgB,KAAKC,OAAM,IAAIC,MAAOC,QAAQ,EAAG,GAAI,EAExDT,KAAKvB,MAAQuB,KAAKU,aAAc,IAAK,EAErCV,KAAKW,YAAa,CAAE,EACpBX,KAAKnB,aAAe,EACpBmB,KAAKtB,OAAS,EACdsB,KAAKd,i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IAA9BA,WAAWoF,gBACY,CAAA,IAA9BpF,WAAWoF,eACG7F,KAAK8F,IAAI,EAAIJ,EAAsD,IAA5BjF,WAAWoF,eAEtDJ,GAAiB,IAAIzF,KAAKyF,CAAc,EAAI,IAAIzF,KAE1D+F,EAAiB,IAAIC,KAAKC,eAAe,QAAS,CAAEC,MAAO,OAAQ,CAAC,EAAEC,OACtEC,EAAUC,OAAOT,EAAQU,WAAW,CAAC,EAAEC,SAAS,EAAG,GAAG,EACtDC,EAAUH,OAAOT,EAAQa,WAAW,CAAC,EAAEF,SAAS,EAAG,GAAG,EAC1D,OAAOR,EAAeH,CAAO,EAAI,IAAMA,EAAQc,QAAQ,EAAI,IAAMd,EAAQe,YAAY,EAAI,IAAMf,EAAQgB,SAAS,EAAI,IAAMR,EAAU,IAAMI,CAC3I,CAED"}
\ No newline at end of file
+{"version":3,"file":"spbc-scanner-plugin.min.js","sources":["spbc-scanner-plugin.js"],"sourcesContent":["'use strict';\n\nclass spbcMalwareScanner{\n\n\tfirst_start = true;\n\n\tactive = false;\n\n\troot = '';\n\tsettings = [];\n\tstates = [\n\t\t'get_cms_hashes',\n\t\t'get_modules_hashes',\n\t\t'clean_results',\n\t\t'file_system_analysis',\n\t\t'get_approved_hashes',\n\t\t'get_denied_hashes',\n\t\t'signature_analysis',\n\t\t'heuristic_analysis',\n\t\t'schedule_send_heuristic_critical_files',\n\t\t'auto_cure_backup',\n\t\t'auto_cure',\n\t\t'outbound_links',\n\t\t'frontend_analysis',\n\t\t'important_files_listing',\n\t\t'send_results',\n\t];\n\tstate = null;\n\toffset = 0;\n\tamount = 0;\n\ttotal_scanned = 0;\n\tscan_percent = 0;\n\tpercent_completed = 0;\n\n\tpaused = false;\n\n\tbutton = null;\n\tspinner = null;\n\n\tprogress_overall = null;\n\tprogressbar = null;\n\tprogressbar_text = null;\n\n\ttimeout = 60000;\n\n\tstate_timer = 0;\n\n\tconstructor ( properties ) {\n\n\t\tconsole.log('init');\n\t\tif (jQuery('#spbcscan-results-log-module').length) {\n\t\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden')\n\t\t}\n\n\t\t// Crunch for cure backups\n\t\tif( typeof properties['settings']['auto_cure'] !== 'undefined' ){\n\t\t\tproperties['settings']['scanner__auto_cure_backup'] = '1';\n\t\t}\n\n\t\tfor( let key in properties ){\n\t\t\tif( typeof this[key] !== 'undefined' ){\n\t\t\t\tthis[key] = properties[key];\n\t\t\t}\n\t\t}\n\n\t};\n\n\tactionControl(){\n\n\t\tif(this.state === null){\n\t\t\tthis.start();\n\n\t\t}else if(this.paused){\n\t\t\tthis.resume();\n\t\t\tthis.controller();\n\n\t\t}else{\n\t\t\tthis.pause();\n\t\t}\n\t};\n\n\tstart(){\n\n\t\tthis.active = true;\n\t\tthis.state_timer = Math.round(new Date().getTime() /1000);\n\n\t\tthis.state = this.getNextState( null );\n\n\t\tthis.setPercents( 0 );\n\t\tthis.scan_percent = 0;\n\t\tthis.offset = 0;\n\t\tthis.progress_overall.children('span')\n\t\t\t.removeClass('spbc_bold')\n\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t.addClass('spbc_bold');\n\n\t\tthis.progressbar.show(500);\n\t\tthis.progress_overall.show(500);\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\n\t\tsetTimeout(() => {\n\t\t\tthis.controller();\n\t\t}, 1000);\n\n\t};\n\n\tpause( result, data, opt ){\n\t\tconsole.log('PAUSE');\n\t\tthis.button.html(spbcScaner.button_scan_resume);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.paused = true;\n\t\tthis.active = false;\n\t};\n\n\tresume( opt ){\n\t\tconsole.log('RESUME');\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\t\tthis.paused = false;\n\t\tthis.active = true;\n\t};\n\n\tend( reload ){\n\n\t\tthis.progressbar.hide(500);\n\t\tthis.progress_overall.hide(500);\n\t\tthis.button.html(spbcScaner.button_scan_perform);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.state = null;\n\t\tthis.total_links = 0;\n\t\tthis.plug = false;\n\t\tthis.total_scanned = 0;\n\t\tthis.active = false;\n\n\t\tif(reload){\n\t\t\tdocument.location = document.location;\n\t\t}else{\n\t\t\tspbc_sendAJAXRequest(\n\t\t\t\t{action: 'spbc_scanner_tab__reload_accordion'},\n\t\t\t\t{\n\t\t\t\t\tnotJson: true,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tjQuery(obj).accordion('destroy')\n\t\t\t\t\t\t\t.html(result)\n\t\t\t\t\t\t\t.accordion({\n\t\t\t\t\t\t\t\theader: 'h3',\n\t\t\t\t\t\t\t\theightStyle: 'content',\n\t\t\t\t\t\t\t\tcollapsible: true,\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tspbc_tbl__bulk_actions__listen();\n\t\t\t\t\t\tspbc_tbl__row_actions__listen();\n\t\t\t\t\t\tspbc_tbl__pagination__listen();\n\t\t\t\t\t\tspbc_tbl__sort__listen();\n\t\t\t\t\t\tspbcStartShowHide();\n\t\t\t\t\t\tspbc_scanner__reload_scan_info();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tjQuery('#spbc_scan_accordion')\n\t\t\t);\n\n\t\t\tif (!jQuery('#spbc_scanner_clear').length) {\n\t\t\t\tlet clear_link = 'Clear scanner logs
';\n\t\t\t\tjQuery(clear_link).insertBefore('#spbcscan-scanner-caption');\n\t\t\t}\n\t\t}\n\n\t};\n\n\tcontroller( result ) {\n\n\t\tconsole.log(this.state);\n\n\t\t// The current stage is over. Switching to the new one\n\t\tif( typeof result !== 'undefined' && result.end ){\n\n\t\t\tthis.state = this.getNextState( this.state );\n\n\t\t\t// End condition\n\t\t\tif (typeof this.state === 'undefined'){\n\t\t\t\tthis.end();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set percent to 0\n\t\t\tthis.setPercents( 0 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\n\t\t\t// Changing visualizing of the current stage\n\t\t\tthis.progress_overall.children('span')\n\t\t\t\t.removeClass('spbc_bold')\n\t\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t\t.addClass('spbc_bold');\n\t\t}\n\n\t\t// Break execution if paused\n\t\tif( this.paused === true )\n\t\t\treturn;\n\n\t\t// // AJAX params\n\t\tlet data = {\n\t\t\taction: 'spbc_scanner_controller_front',\n\t\t\tmethod: this.state,\n\t\t\toffset: this.offset,\n\t\t};\n\n\t\tvar params = {\n\t\t\ttype: 'GET',\n\t\t\tsuccess: this.success,\n\t\t\tcallback: this.successCallback,\n\t\t\terror: this.error,\n\t\t\terrorOutput: this.errorOutput,\n\t\t\tcomplete: null,\n\t\t\tcontext: this,\n\t\t\ttimeout: 120000\n\t\t};\n\n\t\tswitch (this.state) {\n\t\t\tcase 'get_modules_hashes': this.amount = 2; break;\n\t\t\tcase 'clear_table': this.amount = 10000; break;\n\t\t\tcase 'file_system_analysis': this.amount = 700; break;\n\t\t\tcase 'auto_cure': this.amount = 5; break;\n\t case 'outbound_links': this.amount = 10; break;\n\t case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\n\t\t\tcase 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'schedule_send_heuristic_critical_files': this.amount = 1; break;\n\t\t}\n\n\t\tdata.amount = this.amount;\n\n\t\tspbc_sendAJAXRequest(\n\t\t\tdata,\n\t\t\tparams,\n\t\t\tjQuery('#spbc_scan_accordion')\n\t\t);\n\n\t};\n\n\tgetNextState( state ) {\n\n\t\tstate = state === null ? this.states[0] : this.states[ this.states.indexOf( state ) + 1 ];\n\n\t\tif (typeof this.settings[ 'scanner__' + state ] !== 'undefined' && +this.settings[ 'scanner__' + state ] === 0)\n\t\t\tstate = this.getNextState( state );\n\n\t\treturn state;\n\t};\n\n\tsetPercents( percents ){\n\t\tthis.percent_completed = Math.floor( percents * 100 ) / 100;\n\t\tthis.progressbar.progressbar( 'option', 'value', this.percent_completed );\n\t\tthis.progressbar_text.text( spbcScaner[ 'progressbar_' + this.state ] + ' - ' + this.percent_completed + '%' );\n\t};\n\n\tsuccess( response ){\n\n\t\tif( !! response.error ){\n\n\t\t\tthis.error(\n\t\t\t\t{status: 200, responseText: response.error},\n\t\t\t\tresponse.error,\n\t\t\t\tresponse.msg\n\t\t\t);\n\n\t\t}else{\n\t\t\tif( this.successCallback )\n\t\t\t\tthis.successCallback( response, this.data, this.obj );\n\t\t}\n\n\t};\n\n\t// Processing response from backend\n\tsuccessCallback( result ){\n\n\t\tconsole.log( result );\n\n\t\tif( typeof result.total !== 'undefined' )\n\t\t\tthis.scan_percent = 100 / result.total;\n\n\t\tif( typeof result.processed_items !== 'undefined'){\n\n\t\t\tif( this.state === 'heuristic_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('');\n\t\t\tif( this.state === 'signature_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('');\n\n\t\t\tthis.logFileEntry( result.processed_items );\n\t\t}\n\n\t\tif( typeof result.stage_data_for_logging !== 'undefined'){\n\t\t\tthis.logStageEntry( result.stage_data_for_logging );\n\t\t}\n\n\t\t// Add link on shuffle salt if cured\n\t\tif (result.cured !== 'undefined' && Number(result.cured) > 0) {\n\t\t\tthis.showLinkForShuffleSalts(result.message);\n\t\t}\n\n\t\tif( result.end !== true && result.end !== 1 ){\n\t\t\tthis.setPercents( this.percent_completed + result.processed * this.scan_percent );\n\t\t\tthis.offset = this.offset + result.processed;\n\t\t\tthis.controller( result );\n\t\t}else{\n\t\t\tconsole.log( this.state + \" stage took \" + ( Math.round(new Date().getTime() /1000) - this.state_timer ) + \" seconds to complete\" );\n\t\t\tthis.state_timer = Math.round(new Date().getTime()/1000);\n\t\t\tthis.setPercents( 100 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.controller( result );\n\t\t\t}, 300);\n\t\t}\n\t};\n\n\terror( xhr, status, error ){\n\n\t\tlet errorOutput = this.errorOutput;\n\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n\t\tconsole.log( status );\n\t\tconsole.log( error );\n\t\tconsole.log( xhr );\n\n\t\tif( xhr.status === 200 ){\n\t\t\tif( status === 'parsererror' ){\n\t\t\t\terrorOutput( 'Unexpected response from server. See console for details.', this.state );\n\t\t\t\tconsole.log( '%c ' + xhr.responseText, 'color: pink;' );\n\t\t\t}else{\n\t\t\t\tlet error_string = status;\n\t\t\t\tif( typeof error !== 'undefined' )\n\t\t\t\t\terror_string += ' Additional info: ' + error;\n\t\t\t\terrorOutput( error_string, this.state );\n\t\t\t}\n\t\t}else if(xhr.status === 500){\n\t\t\terrorOutput( 'Internal server error.', this.state);\n\t\t}else\n\t\t\terrorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\n\n\t\tif( this.progressbar )\n\t\t\tthis.progressbar.fadeOut('slow');\n\n\t\tthis.end();\n\t};\n\n\terrorOutput( error_msg, stage ){\n\t\tspbcModal.open().putError( error_msg + '
Stage: ' + stage);\n\t};\n\n\tlogRaw(message_to_log ){\n\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper .panel-body').prepend( message_to_log );\n\t};\n\n\tlogFileEntry(items){\n\t\tfor ( var key in items ){\n\t\t\tthis.logRaw( '' + this.getSiteUTCShiftedTimeString() + ' - ' + items[ key ].path + ': ' + items[ key ].status + '
' );\n\t\t}\n\t};\n\n\tlogStageEntry(data){\n\t\tthis.logRaw( '' + this.getSiteUTCShiftedTimeString() + ' - ' + '' + data.title + ' ' + '' + data.description + '
' );\n\t};\n\n\tshowLinkForShuffleSalts(message) {\n\t\tjQuery('#spbc_notice_about_shuffle_link').remove();\n\t\tjQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\n\t\t\t.after(\n\t\t\t\t''\n\t\t\t);\n\t}\n\n\tgetSiteUTCShiftedTimeString(){\n\t\tvar utc_shifted_ts = false;\n\t\t//gettings current system/browser offset\n\t\tvar current_browser_offset = new Date().getTimezoneOffset();\n\t\tcurrent_browser_offset = current_browser_offset * -1 * 1000 * 60;\n\t\t//chek if global ct object is defined\n\t\tif (typeof spbcScaner !== \"undefined\"\n\t\t\t&& typeof spbcScaner.timezone_shift !== \"undefined\"\n\t\t\t&& spbcScaner.timezone_shift !== false){\n\t\t\tutc_shifted_ts = Date.now() - current_browser_offset + (spbcScaner.timezone_shift * 1000);\n\t\t}\n\t\tvar ct_date = utc_shifted_ts ? new Date(utc_shifted_ts) : new Date();\n\t\t//construct date string\n\t\tvar shortMonthName = new Intl.DateTimeFormat(\"en-US\", { month: \"short\" }).format;\n\t\tvar minutes = String(ct_date.getMinutes()).padStart(2, '0');\n\t\tvar seconds = String(ct_date.getSeconds()).padStart(2, '0');\n\t\treturn shortMonthName(ct_date) + ' ' + ct_date.getDate() + ' ' + ct_date.getFullYear() + ' ' + ct_date.getHours() + ':' + minutes + ':' + seconds\n\t}\n\n}\n"],"names":["spbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","total_links","plug","document","location","spbc_sendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","spbc_scanner__reload_scan_info","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","indexOf","percents","floor","text","response","responseText","msg","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","cured","Number","showLinkForShuffleSalts","message","processed","xhr","error_string","fadeOut","error_msg","stage","spbcModal","open","putError","message_to_log","prepend","items","getSiteUTCShiftedTimeString","path","title","description","remove","after","utc_shifted_ts","current_browser_offset","getTimezoneOffset","ct_date","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"AAAA,mBAEMA,mBAELC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAQ,GACRC,SAAW,GACXC,OAAS,CACR,iBACA,qBACA,gBACA,uBACA,sBACA,oBACA,qBACA,qBACA,yCACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEDC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAEdC,YAAcC,GAYb,IAAKC,IAAIC,KAVTC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QAC1CD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIR,KAAA,IAAxCP,EAAqB,SAAa,YAC5CA,EAAqB,SAA6B,0BAAI,KAGvCA,EACU,KAAA,IAAdQ,KAAKN,KACfM,KAAKN,GAAOF,EAAWE,GAI1B,CAEAO,gBAEmB,OAAfD,KAAKvB,MACPuB,KAAKE,MAAM,EAEHF,KAAKjB,QACbiB,KAAKG,OAAO,EACZH,KAAKI,WAAW,GAGhBJ,KAAKK,MAAM,CAEb,CAEAH,Q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lG,OAAOA,OAAO,yCAAyC,EAAE,EAAE,EACzDmG,MACA,uKAEAlB,EAEA,YACD,CACF,CAEAa,8BACC,IAAIM,EAAiB,CAAA,EAGrBC,EAAkD,CAAC,GADtB,IAAI1F,MAAO2F,kBAAkB,EACH,IAAO,GAO1DC,GAFHH,EAHyB,aAAtB,OAAOhF,YAC8B,KAAA,IAA9BA,WAAWoF,gBACY,CAAA,IAA9BpF,WAAWoF,eACG7F,KAAK8F,IAAI,EAAIJ,EAAsD,IAA5BjF,WAAWoF,eAEtDJ,GAAiB,IAAIzF,KAAKyF,CAAc,EAAI,IAAIzF,KAE1D+F,EAAiB,IAAIC,KAAKC,eAAe,QAAS,CAAEC,MAAO,OAAQ,CAAC,EAAEC,OACtEC,EAAUC,OAAOT,EAAQU,WAAW,CAAC,EAAEC,SAAS,EAAG,GAAG,EACtDC,EAAUH,OAAOT,EAAQa,WAAW,CAAC,EAAEF,SAAS,EAAG,GAAG,EAC1D,OAAOR,EAAeH,CAAO,EAAI,IAAMA,EAAQc,QAAQ,EAAI,IAAMd,EAAQe,YAAY,EAAI,IAAMf,EAAQgB,SAAS,EAAI,IAAMR,EAAU,IAAMI,CAC3I,CAED"}
diff --git a/js/src/spbc-scanner-plugin.js b/js/src/spbc-scanner-plugin.js
index e94f3298c..a48cf76c2 100644
--- a/js/src/spbc-scanner-plugin.js
+++ b/js/src/spbc-scanner-plugin.js
@@ -14,6 +14,7 @@ class spbcMalwareScanner{
'clean_results',
'file_system_analysis',
'get_approved_hashes',
+ 'get_denied_hashes',
'signature_analysis',
'heuristic_analysis',
'schedule_send_heuristic_critical_files',
diff --git a/lib/CleantalkSP/SpbctWP/DB/SQLSchema.php b/lib/CleantalkSP/SpbctWP/DB/SQLSchema.php
index 34d6e300b..543181c76 100644
--- a/lib/CleantalkSP/SpbctWP/DB/SQLSchema.php
+++ b/lib/CleantalkSP/SpbctWP/DB/SQLSchema.php
@@ -71,7 +71,7 @@ class SQLSchema extends \CleantalkSP\Common\DB\SQLSchema
array('field' => 'checked_signatures', 'type' => 'int', 'null' => 'no', 'default' => '0',),
array(
'field' => 'status',
- 'type' => 'enum("UNKNOWN","OK","APROVED","APPROVED_BY_CT","MODIFIED","INFECTED","QUARANTINED", "DENIED_BY_CLOUD", "APPROVED_BY_CLOUD")',
+ 'type' => 'enum("UNKNOWN","OK","APROVED","APPROVED_BY_CT","DENIED_BY_CT","MODIFIED","INFECTED","QUARANTINED", "DENIED_BY_CLOUD", "APPROVED_BY_CLOUD")',
'null' => 'no',
'default' => '"UNKNOWN"',
),
diff --git a/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php b/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php
index 258f25219..7f1bdcbb9 100644
--- a/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php
+++ b/lib/CleantalkSP/SpbctWP/Scanner/Frontend.php
@@ -449,8 +449,9 @@ public static function sendFmsLogs()
$fms_logs_data_prepare[] = [
$fms_value['url'],
$weak_code,
- $page_content_before_bad_code,
- $page_content_after_bad_code,
+ spbc_check_ascii($weak_code) ? $weak_code : utf8_decode($weak_code),
+ spbc_check_ascii($page_content_before_bad_code) ? $page_content_before_bad_code : utf8_decode($page_content_before_bad_code),
+ spbc_check_ascii($page_content_after_bad_code) ? $page_content_after_bad_code : utf8_decode($page_content_after_bad_code),
get_the_modified_date('Y-m-d H:i:s', $fms_value['page_id']),
$weak_type
];
@@ -464,12 +465,16 @@ public static function sendFmsLogs()
$total_site_pages = isset($spbc->data['scanner']['total_site_pages']) ? $spbc->data['scanner']['total_site_pages'] : self::getTotalPages();
if (count($fms_logs_data_prepare) > 0) {
+ $json_data = json_encode($fms_logs_data_prepare);
+ if ( empty($json_data) ) {
+ throw new \Exception(' Frontend result send: can not encode data to JSON');
+ }
$result_fms = API::method__security_fms_logs(
$spbc->settings['spbc_key'], // API key
$total_site_pages, // Total pages
count($fms_logs_data_prepare), // Total infected pages
$scanner_start_local_date, // Scanner start date
- json_encode($fms_logs_data_prepare) // Logs data
+ $json_data // Logs data
);
if ( ! empty($result_fms['error']) ) {
throw new \Exception(' Frontend result send: ' . $result_fms['error_message']);
diff --git a/lib/CleantalkSP/SpbctWP/Scanner/Helper.php b/lib/CleantalkSP/SpbctWP/Scanner/Helper.php
index dd2a527cb..48078dcda 100644
--- a/lib/CleantalkSP/SpbctWP/Scanner/Helper.php
+++ b/lib/CleantalkSP/SpbctWP/Scanner/Helper.php
@@ -121,13 +121,12 @@ public static function getHashesForModules($cms, $type, $plugin, $version)
*
* @return array Array with all files hashes or Error Array
*/
- public static function getHashesForApprovedFiles($cms, $type, $version)
+ public static function getHashesForFiles($cms, $type, $version)
{
$file_path = 'https://cleantalk-security.s3-us-west-2.amazonaws.com/extensions_checksums/' . $cms . '/' . $type . '/' . $version . '.csv.gz';
if ( HTTP::getResponseCode($file_path) === 200 ) {
$gz_data = HTTP::getContentFromURL($file_path, false);
-
if ( empty($gz_data['error']) ) {
if ( function_exists('gzdecode') ) {
$data = gzdecode($gz_data);
diff --git a/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php b/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php
index e6e8328de..8af1e9aaf 100755
--- a/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php
+++ b/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php
@@ -14,6 +14,7 @@
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\FrontendAnalysis;
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\GetApprovedHashes;
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\GetCmsHashes;
+use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\GetDeniedHashes;
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\GetModulesHashes;
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\HeuristicAnalysis;
use CleantalkSP\SpbctWP\Scanner\ScanningStagesModule\Stages\OutboundLinks;
@@ -41,6 +42,7 @@ class ScannerQueue
'get_modules_hashes',
'clean_results',
'file_system_analysis',
+ 'get_denied_hashes',
'get_approved_hashes',
'file_monitoring',
'signature_analysis',
@@ -1015,6 +1017,84 @@ public function file_system_analysis($offset = null, $amount = null, $path_to_sc
return $output;
}
+ /**
+ * Getting remote hashes of denied files
+ *
+ * @return array
+ */
+ public function get_denied_hashes() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
+ {
+ global $spbc;
+
+ $result = \CleantalkSP\SpbctWP\Scanner\Helper::getHashesForFiles('wordpress', 'denied', '1.0.0');
+
+ $scanning_stages_storage = new ScanningStagesStorage();
+ $scanning_stages_storage->converter->loadCollection();
+ $stage_data_obj = $scanning_stages_storage->getStage(GetDeniedHashes::class);
+
+ if ( empty($result['error']) ) {
+ $spbc->data['scanner']['checksums_count_ct'] = count($result);
+ $spbc->save('data');
+
+ $where = implode('\',\'', array_column($result, 1));
+ if ( ! preg_match('#^[a-zA-Z0-9\',]+$#', $where) ) {
+ return array('error' => 'BAD_PARAMS');
+ }
+
+ /**
+ * Set unknown status if the file was denied before, but its has does not
+ * persist in the denied hashes list for now. This implemented for cases where we
+ * do change hashes list on mistakenly accepted wrong verdict
+ */
+ $this->db->execute(
+ 'UPDATE ' . SPBC_TBL_SCAN_FILES
+ . ' SET
+ checked_heuristic = 0,
+ checked_signatures = 0,
+ severity = NULL,
+ status = \'UNKNOWN\',
+ weak_spots = \'\'
+ WHERE status = \'DENIED_BY_CT\'
+ AND full_hash NOT IN (\'' . $where . '\');'
+ );
+
+ /**
+ * Update the db depend on current hashes list.
+ */
+ $updated_rows = $this->db->execute(
+ 'UPDATE ' . SPBC_TBL_SCAN_FILES
+ . ' SET
+ checked_heuristic = 1,
+ checked_signatures = 1,
+ status = \'DENIED_BY_CT\',
+ severity = \'CRITICAL\',
+ weak_spots = \'{"DENIED_HASH":{"1":["denied_hash"]}}\'
+ WHERE full_hash IN (\'' . $where . '\');'
+ );
+
+ $stage_data_obj->set('count_denied_hashes', count($result));
+ $stage_data_obj->set('count_denied_hashes_in_db', $updated_rows);
+ $scanning_stages_storage->saveToDb();
+ }
+
+ $out = array(
+ 'end' => 1,
+ 'processed' => empty($result['error']) ? count($result) : 0
+ );
+
+ // Adding to log
+ ScanningLogFacade::writeToLog(
+ '' . $stage_data_obj::getTitle() . ' ' . $stage_data_obj->getDescription()
+ );
+
+ $out['stage_data_for_logging'] = array(
+ 'title' => $stage_data_obj::getTitle(),
+ 'description' => $stage_data_obj->getDescription()
+ );
+
+ return $out;
+ }
+
/**
* Getting remote hashes of approved files
*
@@ -1024,7 +1104,7 @@ public function get_approved_hashes() // phpcs:ignore PSR1.Methods.CamelCapsMeth
{
global $spbc;
- $result = \CleantalkSP\SpbctWP\Scanner\Helper::getHashesForApprovedFiles('wordpress', 'approved', '1.0.0');
+ $result = \CleantalkSP\SpbctWP\Scanner\Helper::getHashesForFiles('wordpress', 'approved', '1.0.0');
$scanning_stages_storage = new ScanningStagesStorage();
$scanning_stages_storage->converter->loadCollection();
diff --git a/lib/CleantalkSP/SpbctWP/Scanner/ScanningStagesModule/Stages/GetDeniedHashes.php b/lib/CleantalkSP/SpbctWP/Scanner/ScanningStagesModule/Stages/GetDeniedHashes.php
new file mode 100644
index 000000000..530f8cb67
--- /dev/null
+++ b/lib/CleantalkSP/SpbctWP/Scanner/ScanningStagesModule/Stages/GetDeniedHashes.php
@@ -0,0 +1,41 @@
+count_denied_hashes
+ . '; '
+ . __('Denied hashes in db ', 'security-malware-firewall')
+ . $this->count_denied_hashes_in_db
+ . '.';
+ }
+
+ public function getName()
+ {
+ return __CLASS__;
+ }
+
+ public function getData()
+ {
+ return array(
+ 'count_denied_hashes' => $this->count_denied_hashes,
+ 'count_denied_hashes_in_db' => $this->count_denied_hashes_in_db
+ );
+ }
+}
diff --git a/lib/CleantalkSP/Updater/UpdaterScripts.php b/lib/CleantalkSP/Updater/UpdaterScripts.php
index 72581f032..5f6cd0fa7 100644
--- a/lib/CleantalkSP/Updater/UpdaterScripts.php
+++ b/lib/CleantalkSP/Updater/UpdaterScripts.php
@@ -1135,6 +1135,14 @@ public static function updateTo_2_114_0() //phpcs:ignore PSR1.Methods.CamelCapsM
$spbc->save('remote_calls', true, false);
}
+ public static function updateTo_2_117_0() //phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
+ {
+ $sql_add_new_status =
+ 'ALTER TABLE ' . SPBC_TBL_SCAN_FRONTEND
+ . ' MODIFY status enum (\'UNKNOWN\', \'OK\', \'APROVED\', \'APPROVED_BY_CT\', \'DENIED_BY_CT\', \'MODIFIED\', \'INFECTED\', \'QUARANTINED\', \'DENIED_BY_CLOUD\', \'APPROVED_BY_CLOUD\') DEFAULT \'UNKNOWN\' NOT NULL';
+ DB::getInstance()->execute($sql_add_new_status);
+ }
+
public static function updateTo_2_117_2() //phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
{
global $spbc;