[英]Obfuscated Javascript in an exploit kit using Array's constructor
我在漏洞利用工具包中發現了一些混淆的Javascript
> a = []["constructor"]
Array() { [native code] }
> b = a["constructor"]
Function() { [native code] }
> b("console.log('a');")
anonymous() {
console.log('a');
}
> b("console.log('a');")()
a
或者換句話說
> [].constructor.constructor("console.log('a');")()
a
有人可以解釋這里發生了什么嗎? 什么是數組的構造函數?
[].constructor.constructor("console.log('a');")()
一種
SO ..這是什么?
[].constructor.constructor
Function(){[本地代碼]}
啊哈...所以這只是調用Function
構造Function
一種方法,該Function
需要將一個字符串賦值給eval ...然后最后的parens會調用它。
Function("console.log('a')")() // Works with or without `new`
一種
您可以在任何JS控制台中輸入[].constructor.constructor
並[].constructor.constructor
查找。
[].constructor
-> Array() { [native code] }
[].constructor.constructor
-> Function() { [native code] }
[].constructor.constructor("console.log('a');")()
-> a
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.