|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/www/wp-content/plugins/security-malware-firewall/js/ |
Upload File : |
"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","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(t){for(var s in console.log("init"),jQuery("#spbcscan-results-log-module").length&&jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),void 0!==t.settings.auto_cure&&(t.settings.scanner__auto_cure_backup="1"),t)void 0!==this[s]&&(this[s]=t[s])}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(t,s,e){console.log("PAUSE"),this.button.html(spbcScaner.button_scan_resume),this.spinner.css({display:"none"}),this.paused=!0,this.active=!1}resume(t){console.log("RESUME"),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),this.paused=!1,this.active=!0}end(t){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,t?document.location=document.location:spbc_sendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(t,s,e,a){jQuery(a).accordion("destroy").html(t).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"))}controller(t){if(console.log(this.state),void 0!==t&&t.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 s={action:"spbc_scanner_controller_front",method:this.state,offset:this.offset},t={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,s.status="UNKNOWN,MODIFIED,OK,INFECTED";break;case"heuristic_analysis":this.amount=4,s.status="UNKNOWN,MODIFIED,OK,INFECTED"}s.amount=this.amount,spbc_sendAJAXRequest(s,t,jQuery("#spbc_scan_accordion"))}}getNextState(t){return t=null===t?this.states[0]:this.states[this.states.indexOf(t)+1],t=void 0!==this.settings["scanner__"+t]&&0==+this.settings["scanner__"+t]?this.getNextState(t):t}setPercents(t){this.percent_completed=Math.floor(100*t)/100,this.progressbar.progressbar("option","value",this.percent_completed),this.progressbar_text.text(spbcScaner["progressbar_"+this.state]+" - "+this.percent_completed+"%")}success(t){t.error?this.error({status:200,responseText:t.error},t.error,t.msg):this.successCallback&&this.successCallback(t,this.data,this.obj)}successCallback(t){console.log(t),void 0!==t.total&&(this.scan_percent=100/t.total),void 0!==t.processed_items&&("heuristic_analysis"===this.state&&0!==typeof t.total&&this.logRaw('<h3 class="spbc_log-block_header">Heuristic Analysis</h3>'),"signature_analysis"===this.state&&0!==typeof t.total&&this.logRaw('<h3 class="spbc_log-block_header">Signature Analysis</h3>'),this.logFileEntry(t.processed_items)),void 0!==t.stage_data_for_logging&&this.logStageEntry(t.stage_data_for_logging),"undefined"!==t.cured&&0<Number(t.cured)&&this.showLinkForShuffleSalts(t.message),!0!==t.end&&1!==t.end?(this.setPercents(this.percent_completed+t.processed*this.scan_percent),this.offset=this.offset+t.processed,this.controller(t)):(console.log(this.state+" stage took "+(Math.round((new Date).getTime()/1e3)-this.state_timer)+" seconds to complete"),this.state_timer=Math.round((new Date).getTime()/1e3),this.setPercents(100),this.scan_percent=0,this.offset=0,setTimeout(()=>{this.controller(t)},300))}error(t,s,e){var a=this.errorOutput;if(console.log("%c APBCT_AJAX_ERROR","color: red;"),console.log(s),console.log(e),console.log(t),200===t.status)if("parsererror"===s)a("Unexpected response from server. See console for details.",this.state),console.log("%c "+t.responseText,"color: pink;");else{let t=s;void 0!==e&&(t+=" Additional info: "+e),a(t,this.state)}else 500===t.status?a("Internal server error.",this.state):a("Unexpected response code: "+t.status+". Error: "+s,this.state);this.progressbar&&this.progressbar.fadeOut("slow"),this.end()}errorOutput(t,s){spbcModal.open().putError(t+"<br>Stage: "+s)}logRaw(t){jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper .panel-body").prepend(t)}logFileEntry(t){for(var s in t)this.logRaw('<p class="spbc_log-line">'+this.getSiteUTCShiftedTimeString()+" - "+t[s].path+"<b>: "+t[s].status+"</b></p>")}logStageEntry(t){this.logRaw('<p class="spbc_log-line">'+this.getSiteUTCShiftedTimeString()+" - <b>"+t.title+"</b> <span>"+t.description+"</span></p>")}showLinkForShuffleSalts(t){jQuery("#spbc_notice_about_shuffle_link").remove(),jQuery(jQuery(".spbc_tab--active .spbc_wrapper_field p")[1]).after('<div style="text-align: center;" id="spbc_notice_about_shuffle_link"><a href="#" '+"onclick=\"spbc_switchTab(document.getElementsByClassName('spbc_tab_nav-settings_general')[0], {target: 'action-shuffle-salts-wrapper', action: 'highlight', times: 3})\">"+t+"</a></div>")}getSiteUTCShiftedTimeString(){var t=!1,s=-1*(new Date).getTimezoneOffset()*1e3*60,s=(t="undefined"!=typeof spbcScaner&&void 0!==spbcScaner.timezone_shift&&!1!==spbcScaner.timezone_shift?Date.now()-s+1e3*spbcScaner.timezone_shift:t)?new Date(t):new Date,t=new Intl.DateTimeFormat("en-US",{month:"short"}).format,e=String(s.getMinutes()).padStart(2,"0"),a=String(s.getSeconds()).padStart(2,"0");return t(s)+" "+s.getDate()+" "+s.getFullYear()+" "+s.getHours()+":"+e+":"+a}}
//# sourceMappingURL=spbc-scanner-plugin.min.js.map