对不同版本的Windows操作系统的默认设置是: ●Windows XP SP2,XP SP3,Vista SP0:OptIn(XP SP3也有永久的DEP) ●Windows Vista SP1:OptIn+AlwaysOn(+永久的DEP) ●Windows 7:OptOut+AlwaysOn(永久的DEP) ●Windows Server 2003 SP1和更高的:OptOut ●Windows Server 2008和更高的:OptOut+AlwaysOn(+永久的DEP)
其实Windows 7的DEP默认设置和XP SP2、SP3是一致的,在 Windows 7 中, DEP 默认是激活的。不过, DEP 不能保护系统中所有运行的应用程序,实际 DEP 能够保护的程序列表由 DEP 的保护级别定义。
详见http://technet.microsoft.com/zh-cn/library/ee958057.aspx
There is a problem with this approach. Since you will be writing to a R+E area, the shellcode will not be able to modify itself. (The WriteProcessMemory call will temporarily mark the location as writeable, but removes the level again.) This means that, if you are using encoded shellcode (or shellcode that modifies itself), it will not work. This can be an issue because of bad chars etc.