Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 28, 2008

Configuring DEP to Prevent Malware Attacks


RSS
View this exclusive article with VIP access -- click here to join |
See More Security Articles Here | Reprints | Or sign up for our VIP Monthly Pass!
Main Article    Windows Gatekeeper

Q: What's the Data Execution Prevention (DEP) security feature that Microsoft introduced in Windows XP SP2? How can it make my Windows system more resistant to malware attacks?

A: DEP is a buffer overrun defense feature. Buffer overruns are often used by malware to get unauthorized access to a system or to execute its malicious payload on a system. A buffer overrun attack typically writes executable malicious code to a program’s memory buffers and then tricks the program into executing the malicious payload. The execution of maliciously injected code can be prevented by DEP. DEP lets an OS mark memory locations that should contain only data as No eXecute (NX). When an application attempts to execute code from NX-marked memory locations, the OS DEP logic will block the application from doing so.

 

DEP is supported in Windows Server 2008, Windows Vista, XP SP2, Windows Server 2003 R2, and Windows 2003 SP1. Two versions of DEP are available: hardware-enforced DEP and software-enforced DEP. Hardware-enforced DEP leverages a processor feature that AMD refers to as the NX-bit and Intel refers to as the eXecute Disable (XD) bit. Today, all Intel and AMD CPUs support DEP. However, this hasn't always been the case: in the early days of DEP, AMD supported NX only on its 64-bit processors, and Intel supported XD only on the Itanium processor, EM64T 64-bit processors, and a small number of 32-bit Prescott processors. Software-enforced DEP lets Microsoft provide DEP on 32-bit processor systems that aren't equipped with a NX- or XD-compatible processor. With software-enforced DEP, the processor-level NX- or XD-bit functionality is provided by set of cookies that the Windows OS automatically adds to data objects stored in the system memory.

 

You can verify whether your system supports hardware- or software-enforced DEP from the DEP configuration settings, which you can access by opening the System Control Panel applet and then selecting Advanced Settings, Performance, Data Execution Prevention. At the bottom of the Data Execution Prevention tab, you'll see a reference to the type of DEP your system supports.

Figure 1 shows the DEP configuration settings on a Vista system. The bottom line reads "Your computer’s processor supports hardware-based DEP." If your system supports software-enforced DEP (meaning your machine doesn't have a NX- or XD-compatible processor) the bottom line will read "Your computer’s processor does not support hardware-based DEP. However, Windows can use DEP software to help prevent some types of attacks."

 

On XP SP2 and Windows 2003 SP1 and later Windows OSs, DEP is enabled by default. However, DEP doesn't always protect all the programs that are running on your system. The programs that are protected by DEP are defined by DEP’s protection level. DEP supports two protection levels. The first protection level (level 1) protects only the Windows system code and executables and doesn't offer DEP protection for additional Microsoft or third-party applications that run on your system. The second protection level (level 2) protects all executable code that runs on your system. This level provides DEP protection for both Windows system code and the Microsoft or third-party applications that run on your system. Application developers can enable DEP support in their applications by using the /NXCompat compilation switch. By default, Vista and XP SP2 run DEP at protection level 1; Server 2008 and Windows 2003 SP1 run DEP at protection level 2.

 

Administrators can configure the DEP protection levels from the DEP configuration screen that Figure 1 shows. In Figure 1, DEP is enabled for essential Windows programs and services only—this is DEP protection level 1. To enable DEP protection level 2, select the Turn on DEP for all programs and services except those I select radio button, which is the default setting on Server 2008 and Windows 2003 SP1 systems.

Protection level 2 also lets you exempt certain applications from DEP protection, as Figure 1 shows. This functionality is very important because there are legacy applications that won't run properly when DEP is enabled. (For example, at the time of this writing, Microsoft Word was automatically exempted from DEP.) Before you switch your DEP protection to level 2, you must run an application compatibility test to ensure that all applications will run properly when DEP is enabled. To exempt one of your applications from DEP, you can add the application’s executable to the excluded list by clicking the Add button in the DEP configuration screen.

 

Another way to exempt an application from DEP is to create a software fix that you distribute to your systems that automatically disables DEP for a given application on those systems. Microsoft refers to this type of software fix as a DisableNX shim. DisableNX shim is described in greater detail in the Microsoft Application Compatibility Toolkit (ACT). ACT also includes the Compatibility Administrator tool, which can help you create the software fix for one of your applications. You can download ACT 5 from http://technet.microsoft.com/en-us/windowsvista/aa905078.aspx.

 

You can easily verify whether an application is protected by DEP by checking the DEP column of the application’s process in the Windows Task Manager. If you don’t see the Data Execution Prevention column in Task Manager, you can easily add it using the View, Select Columns Task Manager option. When you check the DEP column for the Microsoft Internet Explorer 7.0 executable (iexplore.exe) in the Task Manager, you'll notice that DEP is disabled by default. You can enable DEP protection for IE from the IE Advanced Internet Options by selecting Enable memory protection to help mitigate online attacks in the Security options. (Note that changing this property requires administrator-level permissions.) In IE 8.0, DEP protection will be enabled by default.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Microsoft Touts Xbox 360 'Black Friday' Success

Microsoft this week revealed that its Xbox 360 video game console outsold its Sony PlayStation 3 rival 3-to-1 on "Black Friday," which curiously describes the three day weekend after Thanksgiving, a period that unofficially kicks off the holiday selling ...

How can I stop and start services from the command line?

...


Security Whitepapers The Impact of Messaging and Web Threats

Why SaaS is the Right Solution for Log Management

Protecting (You and) Your Data with Exchange Server 2007

Related Events How IE7 & The New Extended Validation SSL Certificates Impact Your Site

Top 10 Email Security Challenges and Solutions

Introduction to Identity Lifecycle Manager "2"

Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing