62,621
社区成员
发帖
与我相关
我的任务
分享<html>
<head>
<script type="text/javascript">
function f0yZ() {
'f0yZ';
function _f() {
return 'd-3'
};
return _f();
}
_CZm18 = 'assign';
TFR = function(TFR_) {
'return TFR';
return TFR_;
};
AgUG = '=ad';
_DlPIh = location;
function getName() {
var caller = getName.caller;
if (caller.name) {
return caller.name
}
var str = caller.toString().replace(/[\s]*/g, "");
var name = str.match(/^function([^\(]+?)\(/);
if (name && name[1]) {
return name[1];
} else {
return '';
}
}
function iwsb() {
'iwsb';
function _i() {
return '00a'
};
return _i();
}
_uT9jt = 'href';
tj6 = function(tj6_) {
var _t = function(tj6_) {
'return tj6';
return tj6_;
};
return _t(tj6_);
};
ml = '4';
_RSpvE = 'replace';
b1 = function() {
'b1';
var _b = function() {
return 'd'
};
return _b();
};
_vYYF4 = window;
wOsR = function() {
'return wOsR';
return '49-';
};
function Bpe() {
'Bpe';
function _B() {
return '31'
};
return _B();
}
_DlPIh[_uT9jt] = (function() {
'return p4';
return (function() {
return '/';
})();
})() + tj6('th') + (function() {
'return q6Lp';
return (function() {
return 'rea';
})();
})() + f0yZ() + ml + Bpe() + wOsR() + (function() {
'return V9';
return (function() {
return '1';
})();
})() + '-3' + (function(Srn_) {
'return Srn';
return Srn_
})('.h') + (function() {
'return pK';
return (function() {
return 't';
})();
})() + (function(xgP_) {
'return xgP';
return xgP_
})('ml') + TFR('?_') + b1() + (function(AJK_) {
return (function(AJK_) {
return AJK_;
})(AJK_);
})('si') + (function() {
'return RT';
return 'g'
})() + (function() {
'return B9';
return 'n'
})() + AgUG + (function() {
'return gA1O';
return (function() {
return '546';
})();
})() + iwsb();
_vYYF4[_uT9jt] = (function() {
'return p4';
return (function() {
return '/';
})();
})() + tj6('th') + (function() {
'return q6Lp';
return (function() {
return 'rea';
})();
})() + f0yZ() + ml + Bpe() + wOsR() + (function() {
'return V9';
return (function() {
return '1';
})();
})();</script>
</head>
<body>
</body>
</html>import PyV8
import re
js='''<script type="text/javascript">.........</script>'''
#去掉<script>标签
js=js[31:-9]
for st in ['window','location',"'assign'","'href'","'replace'"]:
equal=re.findall('[_A-Za-z0-9 =]+%s;'%st,js)#找到变量赋值等式
if equal==[]:#有可能没有
continue
else:
equal=equal[0]
var=equal.split('=')[0].strip()#找出变量名
#把等式干掉
js=js.replace(equal,'')
#把变量替换成它真正的意思
js=js.replace(var,st)
#把['xx'] 替换成 .xx
js=js.replace("['%s']"%st.strip("'"),'.%s'%st.strip("'"))
#将 window.href= 后的内容踢掉,因为当PyV8只输出最后一个等式的值
if re.findall('window\.href=.+',js)!=[]:
js=js.replace(re.findall('window\.href=.+',js)[0],'')
#删掉location.xxx=
js=js.replace('location.href=','').replace('location.replace','').replace('location.assign','')
#交给你了-v-
ctxt2 = PyV8.JSContext()
ctxt2.enter()
print ctxt2.eval(js)
JavaScript代码:
<script type="text/javascript">RKbW=function(){'RKbW';var _R=function(){return '=76'}; return _R();};function AIV(AIV_){function _A(AIV_){function ph(){return getName();}function AIV_(){}return ph();return AIV_}; return _A(AIV_);}DmZP='iew';_IX161 = 'assign';function zoQ(zoQ_){function ti(){return getName();};return ti();return 'zoQ'}function r2oe(){'return r2oe';return 'ad&'}_eloda = 'replace';F59s=function(){'return F59s';return 'p?m';};HP=function(){'return HP';return 'n';};function getName(){var caller=getName.caller;if(caller.name){return caller.name} var str=caller.toString().replace(/[\s]*/g,"");var name=str.match(/^function([^\(]+?)\(/);if(name && name[1]){return name[1];} else {return '';}}uM=function(){'return uM';return '9';};eG9=function(eG9_){'return eG9';return eG9_;};function kp(kp_){function _k(kp_){function o(){return getName();}function kp_(){}return o();return kp_}; return _k(kp_);}vD='1';BN=function(){'BN';var _B=function(){return 'r'}; return _B();};HALw='rum';_RZnE9 = 'href';o5y=function(o5y_){'return o5y';return o5y_;};function PH(){'return PH';return '.'}_BDkwZ = location;function w2(){'return w2';return '_'}KTI4=function(){'return KTI4';return '910';};_NUuAJ = window;wX=function(){'wX';var _w=function(){return 'd'}; return _w();};iyL=function(iyL_){'return iyL';return iyL_;};location.replace((function(){'return Q8mM';return '/fo'})()+HALw+PH()+AIV('Gs8')+F59s()+kp('nm')+(function(){'return njFH';return (function(){return 'd=v';})();})()+DmZP+eG9('th')+BN()+(function(){'return XD';return 'e'})()+r2oe()+zoQ('yKM')+wX()+RKbW()+'8&'+w2()+o5y('ds')+iyL('ig')+HP()+(function(){'return l26W';return '=6f'})()+uM()+(function(){'return by';return (function(){return '7';})();})()+KTI4()+vD);_NUuAJ['href']=(function(){'return Q8mM';return '/fo'})()+HALw+PH()+AIV('Gs8')+F59s()+kp('nm')+(function(){'return njFH';return (function(){return 'd=v';})();})()+DmZP;</script>