Click to Rate and Give Feedback
Tips
The Event Viewer automatically creates several filtered views of the event logs. You can also create a custom view to make it easier to look for specific types of events. ...

Read more!

One way to disable a policy is to disable an unused part of the GPO. By disabling part of a policy that isn’t used, the application of GPOs and security will be faster. ...

Read more!

With a core server installation, you have a minimal UI that includes a limited desktop environment for local console management of the server. Here is an overview of key commands and utilities you’ll use for managing server core installations while logged on locally. ...

Read more!

If you plan on implementing file sharing for Windows Vista clients in a domain environment, keep these best practices in mind. ...

Read more!

If you use your laptop in more than one location, Windows 7 will let you set a different default printer for each network that you access. Find out how to do this. ...

Read more!

Related Articles

Neetu Rajpal introduces the next generation of Forefront Security for Exchange, a premium anti-malware product that protects e-mail that flows through Exchange server environments.

Neetu Rajpal

TechNet Magazine May 2009

...

Read more!

Windows 7 includes many new features and enhancements to help improve security. Here’s an overview of everything you’ll find, from the new Biometric Framework and AppLocker to improvements for BitLocker and UAC.

Chris Corio

TechNet Magazine May 2009

...

Read more!

Learn how to use the Malware Inspection feature of the Microsoft Forefront Threat Management Gateway to mitigate threats at your perimeter.

Yuri Diogenes, Mohit Saxena, and Jim Harrison

TechNet Magazine February 2009

...

Read more!

Wes Miller updates his 2007 article on the Microsoft Desktop Optimization Pack, a collection of valuable components that can can save your IT department a lot of time and effort. All of the components have been enhanced—and something new has been added.

Wes Miller

TechNet Magazine May 2009

...

Read more!

As IM becomes ever more popular, it is increasingly important that administrators have a way to keep it secure. Forefront Security for Office Communication Server provides effective protection against instant messaging-targeted malware or other prohibited content within an OCS 2007 environment.

Molly Gilmore

TechNet Magazine May 2009

...

Read more!

Also by this Author

The first in an ongoing series, Jesper Johansson discusses the broad and varied challenges faced in the field of Information Security Management and the keys to planning a sound InfoSec strategy.

Jesper M. Johansson

TechNet Magazine April 2009

...

Read more!

Find out how the Heisenberg Uncertainty Principle and other elements of quantum physics can shed light on evolving security strategies. (Note: No cats were harmed in the writing of this article.)

Jesper M. Johansson

TechNet Magazine May 2008

...

Read more!

It's been about 8 years since "The 10 Immutable Laws of Security" were first published, and a lot has changed since then. In this installment, Jesper Johansson continues his analysis of the the immutable laws to see if they still hold true after 8 years.

Jesper M. Johansson

TechNet Magazine November 2008

...

Read more!

In the final part of this three part series, Jesper Johansson looks at how software vendors, security suites, and marketing efforts hinder true security efforts and he warns us about how these practices can lead to the collapse of the technology security ecosystem.

Jesper M. Johansson

TechNet Magazine September 2008

...

Read more!

While ACLs haven’t had a major overhaul, there are a number of important changes you need to know about when managing ACLs in a Windows Vista environment. Discover how 30 ACLs have changed to improve security, find out how they will impact your organization, and learn how to manage these changes in your infrastructure.

Jesper M. Johansson

TechNet Magazine June 2007

...

Read more!

Popular Articles

Without too much effort, you can deploy a terminal server to host the applications you need in your environment. But there are some important decisions you’ll need to make to ensure your implementation meets user expectations. Greg Shields discusses the various options you have and explains how they will affect you.

Greg Shields

TechNet Magazine January 2009

...

Read more!

Aaron Margosis

TechNet Magazine August 2006

...

Read more!

Backup is something many people ignore until it’s too late. But there’s no excuse for this, especially now that the new Windows Vista Backup and Restore Center offers a variety of features that make it easy to protect your data against most forms of data loss. Find out how you can plan a complete recovery strategy with Windows Vista.

Christine Fok

TechNet Magazine September 2007

...

Read more!

The upcoming release of Microsoft Identity Lifecycle Manager “2” offers many new features and enhancements. Explore the new portal experience and find out how you can cut costs with self-service tools, increase security compliance with business process modeling, and reduce development time with simplified development tools.

Aung Oo

TechNet Magazine January 2009

...

Read more!

SQL Server 2008 includes a new “eventing” mechanism called SQL Server Extended Events that enables some sophisticated troubleshooting. Get an overview of Extended Events and find out how you can use this new functionality for monitoring and troubleshooting.

Paul S. Randal

TechNet Magazine January 2009

...

Read more!

Our Blog

NAP monitors the health of specified computers when they attempt to connect to a network and includes a number of mechanisms to enforce health requirements. In this article, Geek of All Trades Greg Shields gives readers an overview of these enforcement mechanisms and, as an example, takes a closer look at setting ...

Read more!

Use Windows PowerShell to Manage Virtual Machines Here are a few examples of how you can use Windows PowerShell scripts to manage virtual machines running on a Server Core installation. Note that these scripts are presented as samples and may need to be customized to work in your environment.

Create a New ...

Read more!

Disabling an Unused Part of Group Policy Objects One way to disable a policy is to disable an unused part of the GPO. By disabling part of a policy that isn’t used, the application of GPOs and security will be faster.

Administer Windows Server 2008 Server Core from the Command Prompt ...

Read more!

In the August 2008 issue of TechNet Magazine, Paul Randal wrote an article Top Tips for Effective Database Maintenance.  It was geared toward "involuntary  DBAs" (IT pros who inadvertently wind up responsible for a SQL Server instance).  The article had a great response from our readers so Paul has written another ...

Read more!

Microsoft Forefront is designed to deliver an integrated security solution that makes it much easier to deploy and manage security across an organization’s IT infrastructure. In this, our annual security issue, we feature two articles that describe how Forefront Security protects instant messaging and e-mail.

Protect ...

Read more!

Security Watch Island Hopping: The Infectious Allure of Vendor Swag
Jesper M. Johansson


The technique of island hopping—penetrating a network through a weak link and then hopping around systems within that network—has been around for years. But it continues to take on new dimensions. In today's security-conscious IT environments, people are often the weakest link, and malicious users are
finding ways to use this to their advantage (think phishing and other forms of social engineering). This combination of carbon and silicon can prove fatal to your network.
One of my favorite implementations of leveraging the human element was perpetrated by Steve Stasiukonis of Secure Network Technologies during a penetration test for a customer. He seeded the customer's parking lot with USB flash drives, each of which had a Trojan horse installed on it. When the employees arrived for work in the morning, they were quite excited to find the free gadgets laying around the parking lot. Employees eagerly collected the USB drives and plugged them into the first computers they came across: their own workstations.
Maybe some employees were wise enough to ignore these USB drives, and perhaps some of the USB drives were discarded, but it really only took one user with one drive to infect his own system and provide a gateway into the network. Stasiukonis did this exercise as a test, of course, but this technique has been used by real criminals to infiltrate large corporate networks.
USB flash drives are everywhere these days. At almost every conference, some vendor is giving them away like candy. Those drives may not have a lot of capacity, but you don't need a lot of storage space to take over an entire network. In this two-part series, I will investigate this type of attack and show ways you can help mitigate the risk. In this month's installment, I will discuss what exactly USB flash drives can do and what you can do to control them. In next month's issue of TechNet Magazine, I will show you how to contain an attack to a single or small set of systems on the network.
The technical details of the attack are actually quite simple. It all starts with an infected USB flash drive being inserted into a single computer. What happens then depends on the payload on that drive and, of course, how gullible the user is.

In the Beginning
On the podium was an unattended laptop. The speaker was busily trying to ingratiate himself with the audience before beginning his presentation. The laptop itself was locked, but that hardly mattered. The attacker went up to the podium and lingered a bit, looking like he was just waiting for the speaker to return. Since those podiums are designed to hide ugly things like computers, the USB ports and the attacker's hands were shielded from view. Once the USB flash drive was inserted into the computer, it took only a few seconds to complete the attack.
There are some obvious variations on this particular theme. For example, when I used to travel the world doing presentations on a weekly basis, almost every time I finished, there were a few people asking for a copy of my slides. My answer was always to hand them a business card and ask them to send me an e-mail message. Why would I do that when every one of them was eagerly holding a USB flash drive toward me? Because I know about tools like USB Hacksaw and Switchblade. (If you aren't familiar with these, look them up at wiki.hak5.org.)
Basically, these tools make it really easy for just about anyone to exploit people who leave their USB ports unprotected. For example, Switchblade can dump the following:
  • System information
  • All network services
  • A list of ports that are listening
  • All product keys for Microsoft products on the computer
  • The local password database
  • The password of any wireless networks the computer uses
  • All network passwords the currently logged on user has stored on the computer
  • Internet Explorer®, Messenger, Firefox, and e-mail passwords
  • The Local Security Authority (LSA) secrets, which contain all service account passwords in clear text
  • A list of installed patches
  • A recent browsing history
All of this goes into a log file on the flash drive, and takes about 45 seconds.
Hacksaw is a slightly modified version; it installs a Trojan on the computer, which monitors all USB flash drive insertion events. It then e-mails all documents from all flash drives subsequently inserted into the computer to the attacker.
The tools I have discussed so far use U3 (u3.com), a technology designed to enable users to bring programs with them on a flash drive. In a nutshell, a U3-enabled flash drive lies about itself. It tells the OS that it is actually a USB hub with a flash drive and a CD plugged into it. Windows® versions prior to Windows Vista® will, by default, automatically run programs designated in the autorun.inf file on CDs, but not on USB drives. By lying about itself, the U3-enabled USB flash drive fools the OS into autorunning something called the U3 launcher. The U3 launcher, in turn, can start programs, give you a menu, or do pretty much anything that you could do with the computer yourself.
All the exploit tools do is replace the launcher with the exploit code. As soon as the flash drive is plugged into a Windows XP system, the exploit tool automatically runs. On Windows Vista, the AutoPlay decision flow works differently. AutoRun is actually enabled on removable devices, just like on CDs. That means you will have some sort of action happen when the device is inserted. By default, the AutoPlay dialog will appear, as shown in Figure 1.
Figure 1 Default AutoPlay dialog appears when a user inserts a removable drive with pictures 
Notice that the dialog in Figure 1 has an option to "Always do this for pictures." This sets an AutoPlay option, which can be configured in the Control Panel, shown in Figure 2.
Figure 2 AutoPlay configuration on Windows Vista (Click the image for a larger view)
The AutoPlay configuration is particularly interesting for "Software and games." By definition, it means the removable drive has an autorun.inf file that specifies some program to be executed. The settings in Figure 2 related to "Software and games" are stored in the following registry key:
Hive:    HKEY_CURRENT_USER
Key:    \Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\
UserChosenExecuteHandlers\AutorunINFLegacyArrival 
Value: (Default)
Data:
MSAutoRun – automatically executes the program specified in the autorun.inf file
   
MSPromptEachTime – prompts the user, using strings specified in the autorun.inf file, if available
As you do not need to be an administrator to modify these settings, users can set them to whatever they want, including automatically running whatever malware is on the drive they found in the parking lot. In fact, they can do it by checking the appropriate box in the AutoPlay dialog.

Managing AutoPlay in Your Network
As an administrator, there are a couple of ways you can manage AutoPlay throughout your network. First, you can prevent a user from enabling AutoPlay on removable media and CDs by modifying the NoDriveTypeAutoRun setting that controls which drive types AutoPlay is enabled for. Windows XP shipped with NoDriveTypeAutoRun set to 0x95, which disables AutoPlay on unknown drive types, network drives, and removable devices. Starting with Windows XP SP2, the NoDriveTypeAutoRun setting is configured to 0x91 by default. This enables AutoPlay on removable storage devices. Using Group Policy, there is a setting under User Configuration\Administrative Templates\Windows Components\AutoPlay Polices that allows you to manage the NoDriveTypeAutoRun setting. Enabling the "Turn off AutoPlay setting and select CD-ROM and Removable Drives" will disable AutoPlay on both types of drives.
As a result, though, the user does not get the AutoPlay dialog from Figure 1. In fact, nothing at all happens when the user inserts the drive. That may not be an ideal solution, however, as it can cause confusion for the user who isn't sure how to access the necessary information on the drive.
What you probably want to do is control which types of content can be played automatically. You can do this to some extent on Windows Vista, as this OS effectively has two levels of controls over automatically running software. Another control in Group Policy, shown in Figure 3, allows you to disable AutoPlay of software using autorun.inf files, while leaving the remainder of the Windows Vista AutoPlay behavior intact.
Figure 3 Disable autorun.inf files with Group Policy (Click the image for a larger view)
The decision flow is a bit complicated when it comes to AutoPlay, and perhaps it is easiest to show with a flowchart. Figure 4 depicts the decision flow used when determining whether to automatically execute a file on removable media.
Figure 4 The AutoPlay decision flow (Click the image for a larger view)

Other Beginnings
Of course, these are just some of the tools that can be used to compromise a computer with a USB flash drive. All sorts of tools can be added to this scenario, such as a tool that dumps out the currently logged-on user's Windows NT® password hash (see microsoft.com/technet/community/columns/secmgmt/sm1005.mspx).
Many USB controllers are actually Direct Memory Access (DMA) devices. This means they can bypass the operating system and directly read and write memory on the computer. Bypass the OS and you bypass the security controls it provides—now you have complete and unfettered access to the hardware. This renders device control implemented by the OS completely ineffective. I am unaware of any hacking tools that currently use this technique, but I very much doubt that this has not already been done.
Another way to exploit the user/removable device combination is to simply present an enticing option. For example, how many users would click the dialog in Figure 5? Not all, but probably many. The point is, it's a fairly trivial task to concoct a dialog that will be too enticing for users to ignore.
Figure 5 How many users would fall prey to this? 

Device Blocking
New in Windows Vista, Group Policy now has a set of policies to govern device installation (see Figure 6). As shown, the administrator can block all new removable devices from installing if the driver specifies that they are removable. If the driver states that they are not, however, the policy does not take effect. Thus, this policy can be circumvented using custom drivers.
Figure 6 Windows Vista device installation policies (Click the image for a larger view)
For more granular control, the administrator can use the policies to act on specific device setup classes. However, those require you to know the GUID for the specific device class you wish to block (or allow), making this approach considerably more difficult to manage.

Least Privilege Really Matters
Ignoring the DMA scenario for a moment, the success of the attacks I have discussed, as well as the success of the countermeasures, will depend on the privileges of the user using the computer. If the user is a standard user, the amount of damage the exploit can do is limited. It can still steal that user's data and anything that user has access to. However, the attack will likely not impact the network at large.
However, if the user being exploited is an administrator, the consequences can be a whole lot worse. In the worst-case scenario, the user is a Domain Administrator, and taking over the entire network is trivial. For instance, the attacker could extract the user's password hash from memory. The system caches the hash within the LSA process space at logon so that it can be used to transparently access network resources on behalf of the user. An attacker with administrative privileges can extract this hash and access any network resources with it. In other words, if the user is a Domain Administrator, the entire domain has been compromised.
This leads me to the topic of dependencies. So far, I have outlined a specific attack on workstations. I have not, however, explored what the attack can lead to on a network scale. In next month's column, I will explore the concept of dependencies, showing you what they mean for the environment as a whole and, more importantly, what you can do to harden these dependencies.

Jesper M. Johansson is a Security Engineer working on software security issues and is a contributing editor to TechNet Magazine. He holds a PhD in MIS and has more than 20 years of experience in security.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker