21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See Also<br />

Recipes 1.3, 1.4, 2.8<br />

2.2 Understanding the Windows Access Control<br />

Model<br />

<strong>Problem</strong><br />

You want to understand how access control works on Windows systems.<br />

Solution<br />

Versions of Windows before Windows NT have no access control whatsoever. Windows<br />

95, Windows 98, and Windows ME are all intended to be single-user desktop<br />

operating systems and thus have no need for access control. Windows NT, Windows<br />

2000, Windows XP, and Windows Server 2003 all use a system of access control<br />

lists (ACLs).<br />

Most users do not understand the Windows access control model and generally<br />

regard it as being overly complex. However, it is actually rather straightforward and<br />

easy to understand. Unfortunately, from a programmer’s perspective, the API for<br />

dealing with ACLs is not so easy to deal with.<br />

In the “Discussion” section, we describe the Windows access control model from a<br />

high level. We do not provide examples of using the API here, but other recipes<br />

throughout the book do provide such examples.<br />

Discussion<br />

All Windows resources, including files, the registry, synchronization primitives (e.g.,<br />

mutexes and events), and IPC mechanisms (e.g., pipes and mailslots), are accessed<br />

through objects, which may be secured using ACLs. Every ACL contains a discretionary<br />

access control list (DACL) and a system access control list (SACL). DACLs determine<br />

access rights to an object, and SACLs determine auditing (e.g., logging) policy.<br />

In this recipe, we are concerned only with access rights, so we will discuss only<br />

DACLs.<br />

A DACLcontains zero or more access control entries (ACEs). A DACLwith no ACEs,<br />

said to be a NULL DACL, is essentially the equivalent of granting full access to<br />

everyone, which is never a good idea. A NULL DACL means anyone can do anything<br />

to the object. Not only does full access imply the ability to read from or write<br />

to the object, it also implies the ability to take ownership of the object or modify its<br />

DACL. In the hands of an attacker, the ability to take ownership of the object and<br />

Understanding the Windows Access Control Model | 41<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!