Зачем нам куча брызг на макет кучи?
Как мы знаем, модель кучного распыления выглядит так:
var shellCode = "XXXXXXXXXXX"; //shellcode
var nops = 0x0a0a0a0a; //slide code
while (nops.length < 0x100000)
nops += nops;
nops = nops.substring(...);
nops = nops+shellcode;
var memory = new Array();
for (var i=0; i < 200; i++)
memory[i] += nops
var str = '';
while(str.length < 256) str+= '\x0a\x0a\x0a\x0a';
str = str + "\x0c\x0c\x0c\x0c";
bufferOverFlow(str);
но почему мы не можем сделать это так? Просто используйте адрес выделенной кучи, чтобы установить наш shellCode.
var shellCode = "XXXXXXXXXXX"; //shellcode
shellCode = shellCode.substring(...);
var str = '';
while(str.length < 256) str+= '\x0a\x0a\x0a\x0a';
str = str + &shellCode;
bufferOverFlow(str);