天天看点

stack pivot

当ROP链执行时,攻击者的最终目标是将shellcode重新放置在可执行的内存区域以绕过DEP保护。为了做到这一点,攻击者将调用一些类似VirtualAlloc的API函数。这些被攻击者用于绕过DEP的API是有限的。

由于原始程序的堆栈被切换为指向攻击者控制的数据,因此栈指针不再指向栈限以内。

程序栈限的信息被存储在TEB中。

<code>1</code><code>:</code><code>020</code><code>&gt; !teb</code>

<code>TEB at 7ffda000</code>

<code>ExceptionList: 0220f908</code>

<code>StackBase:</code><code>02210000</code>

<code>StackLimit:</code><code>02201000</code>

如果栈指针不满足下面的条件,我们认为这是一个stack pivot:

if(esp&gt;StackLimit&amp;&amp;esp&lt;StackBase)

本文转自fatshi51CTO博客,原文链接:http://blog.51cto.com/duallay/1901136 ,如需转载请自行联系原作者