javascript - js代码中的top[_$[0]][_$[1]]=_$[2];为什么可以直接执行?
PHP中文网
PHP中文网 2017-04-10 15:36:31
0
3
749

在一个盗号的钓鱼网站上看到这么几行代码,执行后会将网页重定向:

var _$=["\x6c\x6f\x63\x61\x74\x69\x6f\x6e","\x68\x72\x65\x66","\x68\x74\x74\x70\x3a\x2f\x2f\x75\x73\x65\x72\x2e\x71\x7a\x6f\x6e\x65\x2e\x71\x71\x2e\x63\x6f\x6d\x2f\x34\x30\x33\x33\x38\x32\x30\x33\x31\x2f\x34"];

top[_$[0]][_$[1]]=_$[2];

变量转义的结果为

["location", "href", "http://user.qzone.qq.com/xxxxxxxx/4"]

为什么用一个top的多维数组可以将代码等价于

location.href = "http://user.qzone.qq.com/xxxxxxxx/4"
PHP中文网
PHP中文网

认证高级PHP讲师

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!