Home > Security Tips > Tech Tips > Check your DLL search mode
Security Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

TECH TIPS

Check your DLL search mode


By Tom Lancaster
04.22.2003
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


As many of you know, most large Windows applications rely on libraries of shared code to make life a lot simpler for developers and to use system resources a lot more efficiently. There's no reason for each application on your system to use up hard drive space on its own copy of common code. And if you want to upgrade that piece of code, you don't want to do it individually for 50 different applications. So most of this shared code lives in .dll files, where DLL stands for Dynamic Link Libraries.

The trick to DLLs is that they can be in any directory, even though, as you probably noticed, most of them are in /system32. Thus, if two DLLs exist in separate directories, Windows needs a way to determine which one to use. By default, Windows searches the application's directory, then the current directory, then the system directory, and then it uses your path statement in that order to make this determination.

This makes it theoretically possible for someone to write his or her own DLL to do something ev



il, give it the same name as a DLL in the system directory, and place it in the current directory. (Hopefully, such persons don't have rights to the system directories.) Then, when you run your application, you inadvertently execute the malicious code.

As of SP1 on Windows XP, this order is changed to the application directory, then the system directory, then the current directory, then the path. This slightly reduces the exposure to this type of attack. However, if you're running something prior to SP1 on XP, you may be able to change this behavior with the following Registry Edit

HKLMSystemCurrentControlSetControlSession ManagerSafeDllSearchMode = 1

As usual, registry editing is not for the faint of heart, and can completely hose your system if you make a mistake. Always back up your registry and entire system before messing with it.


Thomas Alexander Lancaster IV is a consultant and author with over ten years experience in the networking industry, focused on Internet infrastructure.

Rate this Tip
To rate tips, you must be a member of SearchSecurity.com.
Register now to start rating these tips. Log in if you are already a member.




BROWSE BY TAG
Tech Tips,   Application and Platform Security,   Windows Security: Alerts, Updates and Best Practices,   Operating System Security,   VIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Tech Tips
Video: The foundation of an email security strategy
Biometric authentication know-how: Devices, systems and implementation
The 5 A's of functional SAN security
Effective storage security policies
Smart options for safeguarding stored data
Outfox SOX: How to make regulations work for you
Roberta Bragg's 10 Windows hardening tips in 10 minutes
Using free network intrusion detection and prevention tools to stop hacks
Hacker techniques and exploits: Prevent system fingerprinting, probing
How to stop hacker theft: Employee awareness, risk assessment policies

Windows Security: Alerts, Updates and Best Practices
New attack code targets Microsoft DirectShow zero-day vulnerability
When BIOS updates become malware attacks
Microsoft patches WebDAV security vulnerability in bevy of updates
Microsoft plans 10 security updates, fixing IE, Word, Excel vulnerabilities
Hackers targeting unpatched Microsoft DirectShow flaw
Microsoft warns of IIS zero-day vulnerability
Microsoft updates Office to address serious PowerPoint vulnerabilities
Microsoft to patch critical PowerPoint zero-day flaw
How to perform Microsoft Baseline Security Analyzer (MBSA) scans
Microsoft patches serious Excel zero-day, Windows flaws

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
BotHunter  (SearchSecurity.com)
principle of least privilege (POLP)  (SearchSecurity.com)
security identifier  (SearchSecurity.com)
trusted computing  (SearchSecurity.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Research Solutions for Network Security, Access Control and Security Threats
More Security Resources for Resellers, VARs and OEMs
TechTarget Security Media
Information Security View this month\\'s issue and subscribe today.
Information Security Decisions Apply online for free conference admission.
SearchSecurity.com
HomeNewsMagazineMultimediaWhite PapersLearningAdviceTopicsEventsAbout Us

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts