-
Notifications
You must be signed in to change notification settings - Fork 2
/
background.min.js
1 lines (1 loc) · 1.13 KB
/
background.min.js
1
var match=!1,cd_guloader=/attachment;(\s+)?filename=\"\w+_encrypted_([0-9]|[a-f]|[0-9a-f])+\.bin\".*/gi,sc_emotet=/(^|\n)5[a-z][a-f0-9].*/gi,uri_guloader=/\w+_encrypted_([0-9]|[a-f]|[0-9a-f])+\.bin$/gi,uri_mozi=/\/Mozi\.m$/gi;function blockRequest(r){if(r.url.match(uri_guloader)||r.url.match(uri_mozi))return{redirectUrl:"http://127.0.0.1/"}}function blockResponse(rr){if(200==rr.statusCode&&("GET"==rr.method||"POST"==rr.method))for(var resp_headers=rr.responseHeaders,i=0,l=resp_headers.length;i<l;++i)if("set-cookie"==resp_headers[i].name.toLowerCase()&&resp_headers[i].value.match(sc_emotet)||"content-disposition"==resp_headers[i].name.toLowerCase()&&resp_headers[i].value.match(cd_guloader))return{redirectUrl:"http://127.0.0.1/"}}var api="webRequest",_this=this;try{chrome[api]?(_this[api]=chrome[api],params=["blocking","responseHeaders","extraHeaders"]):browser[api]&&(_this[api]=browser[api],params=["blocking","responseHeaders"])}catch(e){}try{_this[api].onBeforeRequest.addListener(blockRequest,{urls:["<all_urls>"]},["blocking"])}catch(e){}try{_this[api].onHeadersReceived.addListener(blockResponse,{urls:["<all_urls>"]},params)}catch(e){}