Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2007, 00:22
yaa
 
Posts: n/a
Question Stack execution .. is it blocked on Windows???

Hello,

yesterday I happened to stumble on a small piece of code that uses stack execution for running a piece of code inside a remote process. I tried it and it does not work (you get an exception on executing the very first code instruction you injected in the remote process).

The code is a few years old and I suppose now, on a Windows machines with the latest patches, stack execution is not allowed anymore.

Can anyone confirm it?


yaa
Reply With Quote
  #2  
Old 12-02-2007, 00:30
yaa
 
Posts: n/a
btw, here is the VC++ code project I was talking about.

You should only compile it without debugging symbols.


yaa
Attached Files
File Type: zip INJECT.zip (15.6 KB, 10 views)
Reply With Quote
  #3  
Old 12-02-2007, 05:04
Human
 
Posts: n/a
omfg do you have win 3.11 or what, DEP is since SP2 in xp and since amd64 there is NX bit to prevent stack execution. dont you know virtuallocex to alloc mem in remote process and run all there?
Reply With Quote
  #4  
Old 12-02-2007, 06:44
yaa
 
Posts: n/a
Human, I'm not looking for alternative ways to achieve the same result (such as using VirtualAllocEx and WriteProcessMemory), I was only curious to know why stack execution was failing.

By the way, DEP on my machine (I'm running Windows 2003) is enabled only for "essential programs and services" and I'm sure that notepad.exe (that is the process on which I tried stack execution) *is not* considered an essential program or service

So I would say that DEP is not the cause of the failure.

yaa
Reply With Quote
  #5  
Old 12-02-2007, 06:55
yaa
 
Posts: n/a
I just now made a test and it seems that the code I posted works fine on machines where DEP is SW (the CPU does not support it) and fails on machines where DEP is HW provided.

yaa
Reply With Quote
  #6  
Old 12-03-2007, 21:22
void
 
Posts: n/a
Quote:
Originally Posted by http://support.microsoft.com/kb/899298/en-us
By default, in Windows Server 2003 SP1, DEP is turned on for all programs and services except those that the administrator selects. By default, the "Turn on DEP for all programs and services except those I select" OptOut policy is already selected.
There is also a paper on DEP Bypassing Windows Hardware-enforced Data Execution Prevention
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exectution on the stack arnix General Discussion 2 05-09-2005 19:03
DOS stack under Win2k Nukacola General Discussion 2 12-07-2004 23:20
Execution protection in WinXP SP2 nine General Discussion 1 12-16-2003 04:11


All times are GMT +8. The time now is 14:39.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )