Computer Security:
Computer Security:
Principles and Practice
Principles and Practice
First Edition First Edition
by William Stallings and Lawrie Brown by William Stallings and Lawrie Brown
Lecture slides by Lawrie Brown Lecture slides by Lawrie Brown
Chapter 24 –
Chapter 24 –
Windows and Windows
Windows and Windows
Vista Security
Windows and Windows Vista
Windows and Windows Vista
Security
Security
Windows is the world’s most popular O/S
Windows is the world’s most popular O/S
advantage is that security enhancements
advantage is that security enhancements
can protect millions of nontechnical users
can protect millions of nontechnical users
challenge is that vulnerabilities in Windows
challenge is that vulnerabilities in Windows
can also affect millions of users
can also affect millions of users
will review
will review
overall security architecture of
overall security architecture of
Windows 2000 and later (but not Win9X)
Windows 2000 and later (but not Win9X)
Windows Security Architecture
Windows Security Architecture
Security Reference Monitor (SRM)
Security Reference Monitor (SRM)
a kernel-mode component that performs a kernel-mode component that performs
access checks, generates audit log entries, access checks, generates audit log entries,
and manipulates user rights (privileges) and manipulates user rights (privileges)
Local Security Authority (LSA)
Local Security Authority (LSA)
responsible for enforcing local security policyresponsible for enforcing local security policy
Security Account Manager (SAM)
Security Account Manager (SAM)
a database that stores user accounts and a database that stores user accounts and
local users and groups security information local users and groups security information
local logins perform lookup against SAM DBlocal logins perform lookup against SAM DB
Windows Security Architecture
Windows Security Architecture
Active Directory (AD)
Active Directory (AD)
Microsoft’s LDAP directoryMicrosoft’s LDAP directory
all Windows clients can use AD to perform all Windows clients can use AD to perform security operations including account logon
security operations including account logon
authenticate using AD when the user logs on using authenticate using AD when the user logs on using a domain rather than local account
a domain rather than local account
user’s credential information is sent securely user’s credential information is sent securely across the network to be verified by AD
across the network to be verified by AD
WinLogon (local) and NetLogon (net)
WinLogon (local) and NetLogon (net)
handle login requests
Local vs Domain Accounts
Local vs Domain Accounts
a networked Windows computer can be:
a networked Windows computer can be:
domain joined
domain joined
can login with either domain or local accountscan login with either domain or local accounts
if local may not access domain resourcesif local may not access domain resources
centrally managed and much more secure centrally managed and much more secure
in a workgroup
in a workgroup
a collection of computers connected togethera collection of computers connected together
only local accounts in SAM can be usedonly local accounts in SAM can be used
Windows Login Example
Windows Login Example
domain admin adds user’s account info (name, domain admin adds user’s account info (name,
account, password, groups, privileges) account, password, groups, privileges)
account is represented by a Security ID (SID) account is represented by a Security ID (SID) unique to each account within a domainunique to each account within a domain
of form: S-1–5–21-AAA-BBB-CCC-RRRof form: S-1–5–21-AAA-BBB-CCC-RRR username in one of two forms:username in one of two forms:
SAM format: DOMAIN\UsernameSAM format: DOMAIN\Username User Principal Name (UPN): User Principal Name (UPN):
Windows Privileges
Windows Privileges
are systemwide permissions assigned to
are systemwide permissions assigned to
user accounts
user accounts
e.g. backup computer, or change system timee.g. backup computer, or change system time
some are deemed “dangerous” such as:
some are deemed “dangerous” such as:
act as part of operating system privilegeact as part of operating system privilege
debug programs privilegedebug programs privilege
backup files and directories privilegebackup files and directories privilege
others are deemed “benign” such as
others are deemed “benign” such as
Access Control Lists
Access Control Lists
two forms of access control list (ACL):
two forms of access control list (ACL):
Discretionary ACL (DACL)
Discretionary ACL (DACL)
grants or denies access to protected resources grants or denies access to protected resources
such as files, shared memory, named pipes etc such as files, shared memory, named pipes etc
System ACL (ACL)
System ACL (ACL)
used for auditing and in Windows Vista to used for auditing and in Windows Vista to
Access Control Lists
Access Control Lists
objects needing protection are assigned a
objects needing protection are assigned a
DACL (and possible SACL) that includes
DACL (and possible SACL) that includes
SID of the object ownerSID of the object owner
list of access control entries (ACEs) list of access control entries (ACEs)
each ACE includes a SID & access mask
each ACE includes a SID & access mask
access mask could include ability to:
access mask could include ability to:
read, write, create, delete, modify, etcread, write, create, delete, modify, etc
access masks are object-type specific
access masks are object-type specific
Security Descriptor (SD)
Security Descriptor (SD)
data structure with object owner, DACL, & SACLdata structure with object owner, DACL, & SACL e.g.e.g.
Owner: CORP\Blake
Owner: CORP\Blake
ACE[0]: Allow CORP\Paige Full Control
ACE[0]: Allow CORP\Paige Full Control
ACE[1]: Allow Administrators Full Control
ACE[1]: Allow Administrators Full Control
ACE[2]: Allow CORP\Cheryl Read, Write and Delete
ACE[2]: Allow CORP\Cheryl Read, Write and Delete
have no implied access, if there is no ACE for have no implied access, if there is no ACE for
requesting user, then access is denied requesting user, then access is denied
applications must request correct type of accessapplications must request correct type of access if just request “all access” when need less (e.g. read) if just request “all access” when need less (e.g. read)
More SD’s & Access Checks
More SD’s & Access Checks
each ACE in the DACL determines access
each ACE in the DACL determines access
an ACE can be an allow or a deny ACE
an ACE can be an allow or a deny ACE
Windows evaluates each ACE in the ACL
Windows evaluates each ACE in the ACL
until access is granted or explicitly denied
until access is granted or explicitly denied
so deny ACEs come before allow ACEs
so deny ACEs come before allow ACEs
default if set using GUIdefault if set using GUI
explicitly order if create programmaticallyexplicitly order if create programmatically
when user attempts to access a protected
when user attempts to access a protected
object, the O/S performs an access check
object, the O/S performs an access check
Impersonation
Impersonation
process can have multiple threads
process can have multiple threads
common for both clients and serverscommon for both clients and servers
impersonation allows a server to serve a
impersonation allows a server to serve a
user, using their access privileges
user, using their access privileges
e.g. ImpersonateNamedPipeClient function e.g. ImpersonateNamedPipeClient function
sets user’s token on the current thread sets user’s token on the current thread
then access checks for that thread are then access checks for that thread are
performed against this token not server’s performed against this token not server’s
Mandatory Access Control
Mandatory Access Control
have Integrity Control in Windows Vistahave Integrity Control in Windows Vista
that limits operations changing an object’s statethat limits operations changing an object’s state objects and principals are labeled (using SID) objects and principals are labeled (using SID)
as: as:
Low integrity (S-1-16-4096)Low integrity (S-1-16-4096)
Medium integrity (S-1-16-8192)Medium integrity (S-1-16-8192) High integrity (S-1-16-12288) High integrity (S-1-16-12288) System integrity (S-1-16-16384)System integrity (S-1-16-16384)
when write operation occurs first check subject’s when write operation occurs first check subject’s
integrity level dominates object’s integrity level integrity level dominates object’s integrity level
Vista
Vista
Windows Vulnerabilities
Windows Vulnerabilities
Windows, like all O/S’s, has security bugs
Windows, like all O/S’s, has security bugs
and bugs have been exploited by attackers to and bugs have been exploited by attackers to
compromise customer operating systems compromise customer operating systems
Microsoft now uses process improvement
Microsoft now uses process improvement
called the Security Development Lifecycle
called the Security Development Lifecycle
net effect approx 50% reduction in bugsnet effect approx 50% reduction in bugs
Windows Vista used SDL start to finish
Windows Vista used SDL start to finish
IIS v6 (in Windows Server 2003) had only
IIS v6 (in Windows Server 2003) had only
3 vulnerabilities in 4 years, none critical
Windows Security Defenses
Windows Security Defenses
attackers are now criminals rather than
attackers are now criminals rather than
young, anarchic miscreants, and are
young, anarchic miscreants, and are
highly motivated by money
highly motivated by money
have categories of security defenses:
have categories of security defenses:
account defenses account defenses
network defenses network defenses
buffer overrun defenses. buffer overrun defenses.
Windows System Hardening
Windows System Hardening
process of shoring up defenses, reducing process of shoring up defenses, reducing
exposed functionality, disabling features exposed functionality, disabling features
known as attack surface reductionknown as attack surface reduction use 80/20 rule on featuresuse 80/20 rule on features
not always achievablenot always achievable
e.g. requiring RPC authentication in XP SP2e.g. requiring RPC authentication in XP SP2 e.g. strip mobile code support on serverse.g. strip mobile code support on servers
servers easier to harden:servers easier to harden:
1.
1. are used for very specific and controlled purposesare used for very specific and controlled purposes
2.
2. perceive server users are administrators with better perceive server users are administrators with better
Account Defenses
Account Defenses
user accounts can have privileged SIDsuser accounts can have privileged SIDs
least privilege dictates that users operate with least privilege dictates that users operate with
just enough privilege for tasks just enough privilege for tasks
Windows XP users in local AdministratorsWindows XP users in local Administrators for application compatibility reasonsfor application compatibility reasons
can use “Secondary Logon” to run appscan use “Secondary Logon” to run apps
also restricted tokens reduce per-thread privilegealso restricted tokens reduce per-thread privilege Windows Vista reverses default with UACWindows Vista reverses default with UAC
Low Privilege Service Accounts
Low Privilege Service Accounts
Windows services are long-lived processes Windows services are long-lived processes
started after booting started after booting
many ran with elevated privilegesmany ran with elevated privileges
but many do not need elevated requirementsbut many do not need elevated requirements
Windows XP added Local Service and Network Windows XP added Local Service and Network
service accounts service accounts
allow a service local or network accessallow a service local or network access
otherwise operate at much lower privilege levelotherwise operate at much lower privilege level
Windows XP SP2 split RPC service (RPCSS) in Windows XP SP2 split RPC service (RPCSS) in
two (RPCSS and DCOM Server Process) two (RPCSS and DCOM Server Process)
Stripping Privileges
Stripping Privileges
another defense is to strip privileges from
another defense is to strip privileges from
an account soon after an application starts
an account soon after an application starts
e.g. Index server process runs as system to e.g. Index server process runs as system to
access all disk volumes access all disk volumes
but then sheds any unneeded privileges as but then sheds any unneeded privileges as
soon as possible soon as possible
using AdjustTokenPrivilegesusing AdjustTokenPrivileges
Windows Vista can define privileges
Windows Vista can define privileges
required by a service
required by a service
Network Defenses
Network Defenses
need more than user defenses
need more than user defenses
vulnerable to attack via network service
vulnerable to attack via network service
have IPSec and IPv6 with authenticated
have IPSec and IPv6 with authenticated
network packets enabled by default in
network packets enabled by default in
Windows Vista
Windows Vista
IPv4 also enabled by default, expect less useIPv4 also enabled by default, expect less use
have built-in software firewall
have built-in software firewall
block inbound connections on specific portsblock inbound connections on specific ports • Vista can allow local net access onlyVista can allow local net access only
optionally block outbound connections (Vista)optionally block outbound connections (Vista)
Buffer Overrun Defenses
Buffer Overrun Defenses
many compromises exploit buffer overruns
many compromises exploit buffer overruns
Windows Vista has “Stack-Based Buffer
Windows Vista has “Stack-Based Buffer
Overrun Detection (/GS)” default enabled
Overrun Detection (/GS)” default enabled
source code compiled with special /GS optionsource code compiled with special /GS option
does not affect every function; only those with does not affect every function; only those with
at least 4-bytes of contiguous stack data and at least 4-bytes of contiguous stack data and
that takes a pointer or buffer as an argument that takes a pointer or buffer as an argument
Buffer Overrun Defenses
Buffer Overrun Defenses
No eXecuteNamed (NX) / Data Execution No eXecuteNamed (NX) / Data Execution
Prevention (DEP) / eXecution Disable (XD) Prevention (DEP) / eXecution Disable (XD)
prevent code executing in data segmentsprevent code executing in data segments
as commonly used by buffer overrun exploitsas commonly used by buffer overrun exploits applications linked with /NXCOMPAT optionapplications linked with /NXCOMPAT option Stack Randomization (Vista only)Stack Randomization (Vista only)
randomizes thread stack base addressesrandomizes thread stack base addresses Heap-based buffer overrun defenses:Heap-based buffer overrun defenses:
add and check random value on each heap blockadd and check random value on each heap block heap integrity checkingheap integrity checking
Other Defenses
Other Defenses
Image Randomization
Image Randomization
O/S boots in one of 256 configurationsO/S boots in one of 256 configurations
makes O/S less predictable for attackersmakes O/S less predictable for attackers
Service Restart Policy
Service Restart Policy
services can be configured to restart if failservices can be configured to restart if fail
great for reliability but lousy for securitygreat for reliability but lousy for security
Vista sets some critical services so can only Vista sets some critical services so can only
restart twice, then manual restart needed restart twice, then manual restart needed
Browser Defenses
Browser Defenses
web browser is a key point of attack
web browser is a key point of attack
via script code, graphics, helper objectsvia script code, graphics, helper objects
Microsoft added many defenses to IE7
Microsoft added many defenses to IE7
ActiveX opt-inActiveX opt-in
• unloads ActiveX controls by defaultunloads ActiveX controls by default
• when any then first run prompts user to confirmwhen any then first run prompts user to confirm
protected modeprotected mode
• IE runs at low integrity level (see earlier)IE runs at low integrity level (see earlier)
Cryptographic Services
Cryptographic Services
low-level crypto for encryption, hashing, signinglow-level crypto for encryption, hashing, signing Encrypting File System (EFS)Encrypting File System (EFS)
allows files / directories to be encrypted / decrypted allows files / directories to be encrypted / decrypted
transparently for authorized users transparently for authorized users
generates random key, protected by DPAPIgenerates random key, protected by DPAPI Data Protection API (DPAPI)Data Protection API (DPAPI)
manages encryption key maintenance protectionmanages encryption key maintenance protection keys derived in part from user’s passwordkeys derived in part from user’s password
BitLocker Drive EncryptionBitLocker Drive Encryption
Summary
Summary
Windows security architecture
Windows security architecture
vulnerabilities
vulnerabilities
security defenses
security defenses
account, network, buffer, browseraccount, network, buffer, browser