McGraw Hill HackNotes Windows Security Portable Reference eBook

Reference Center
Hacking Fundamentals: Concepts . . . . . . . . . . . . . . . . . . . . RC 2
ICMP Message Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 5
Common Ports and Services . . . . . . . . . . . . . . . . . . . . . . . . . RC 7
Common NetBIOS Name Table Definitions . . . . . . . . . . . . RC 12
Windows Security Fundamentals: Concepts . . . . . . . . . . . RC 13
Windows Default User Accounts . . . . . . . . . . . . . . . . . . . . . RC 14
Windows Authentication Methods . . . . . . . . . . . . . . . . . . . RC 15
Common Security Identifiers (SIDs) . . . . . . . . . . . . . . . . . . . RC 16
Windows NT File System Permissions . . . . . . . . . . . . . . . . RC 17
Useful Character Encodings . . . . . . . . . . . . . . . . . . . . . . . . . RC 18
Testing for Internet Information Services
ISAPI Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 21
Security Related Group Policy Settings . . . . . . . . . . . . . . . . RC 22
Useful Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 26
Quick Command Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 28
WinPcap / libpcap Filter Reference . . . . . . . . . . . . . . . . . . . RC 29
nslookup Command Reference . . . . . . . . . . . . . . . . . . . . . . . RC 30
Microsoft Management Console . . . . . . . . . . . . . . . . . . . . . . RC 31
Online References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 32
Part I
Hacking Fundamentals
■ 1 Footprinting: Knowing Where to Look . . . . . . . . . . . . . . . . . . . . . . . . 3
Footprinting Explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Footprinting Using DNS . . . . . . . . . . . . . . . . . . . . . . . . 4
Footprinting Using Public
Network Information . . . . . . . . . . . . . . . . . . . . . . . . 10
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
v
■ 2 Scanning: Skulking About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Scanning Explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
How Port Scanning Works . . . . . . . . . . . . . . . . . . . . . . 14
Port Scanning Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
■ 3 Enumeration: Social Engineering, Network Style . . . . . . . . . . . . . . . 31
Enumeration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
DNS Enumeration (TCP/53, UDP/53) . . . . . . . . . . . . 35
NetBIOS over TCP/IP Helpers (UDP/137,
UDP 138, TCP/139, and TCP/445) . . . . . . . . . . . . . 37
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
■ 4 Packet Sniffing: The Ultimate Authority . . . . . . . . . . . . . . . . . . . . . . 49
The View from the Wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Windows Packet Sniffing . . . . . . . . . . . . . . . . . . . . . . . 50
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
■ 5 Fundamentals of Windows Security . . . . . . . . . . . . . . . . . . . . . . . . . 59
Components of the Windows Security Model . . . . . . . . . . . 60
Security Operators: Users and User Contexts . . . . . . 60
Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Windows Security Providers . . . . . . . . . . . . . . . . . . . . 69
Active Directory and Domains . . . . . . . . . . . . . . . . . . . 70
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Part II
Windows 2000 and 2003 Server Hacking Techniques & Defenses
■ 6 Probing Common Windows Services . . . . . . . . . . . . . . . . . . . . . . . . 75
Most Commonly Attacked Windows Services . . . . . . . . . . . 76
Server Message Block Revisited . . . . . . . . . . . . . . . . . . 76
Probing Microsoft SQL Server . . . . . . . . . . . . . . . . . . . 89
Microsoft Terminal Services /
Remote Desktop (TCP 3389) . . . . . . . . . . . . . . . . . . 93
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
■ 7 Hacking Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . 97
Working with HTTP Services . . . . . . . . . . . . . . . . . . . . . . . . . 98
Simple HTTP Requests . . . . . . . . . . . . . . . . . . . . . . . . . 98
Speaking HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Delivering Advanced Exploits . . . . . . . . . . . . . . . . . . . 100
Introducing the Doors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
The Big Nasties: Command Execution . . . . . . . . . . . . 102
A Kinder, Gentler Attack . . . . . . . . . . . . . . . . . . . . . . . . 115
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
vi HackNotes Windows Security Portable Reference
Part III
Windows Hardening
■ 8 Understanding Windows Default Services . . . . . . . . . . . . . . . . . . . . 121
Windows Services Revealed . . . . . . . . . . . . . . . . . . . . . . . . . . 122
The Top Three Offenders . . . . . . . . . . . . . . . . . . . . . . . . 122
Internet Information Services/
World Wide Web Publishing Service . . . . . . . . . . . 122
Terminal Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Microsoft SQL Server / SQL
Server Resolution Service . . . . . . . . . . . . . . . . . . . . . 123
The Rest of the Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
■ 9 Hardening Local User Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Windows Access Control Facilities . . . . . . . . . . . . . . . . . . . . . 136
File System Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 136
Local Security Settings . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
■ 10 Domain Security with Group Policies . . . . . . . . . . . . . . . . . . . . . . . . 155
Group Policy Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Group Policy Application . . . . . . . . . . . . . . . . . . . . . . . 157
Working with Group Policies . . . . . . . . . . . . . . . . . . . . 157
Working with Group Policies in Active Directory . . . . . . . . 163
Editing Default Domain Policies . . . . . . . . . . . . . . . . . 164
Controlling Who Is Affected by
Group Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Using the Group Policy Management
Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
■ 11 Patch and Update Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
History of Windows Operating System Updates . . . . . . . . . 170
Automatic or Manual? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
How to Update Windows Manually . . . . . . . . . . . . . . 172
Manual Updates in Disconnected
Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Windows Update: What’s in a Name? . . . . . . . . . . . . 173
How to Update Windows Automatically . . . . . . . . . . 174
Verifying Patch Levels:
The Baseline Security Analyzer . . . . . . . . . . . . . . . . 177
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Contents vii
Part IV
Windows Security Tools
■ 12 IP Security Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
IP Security Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Working with IPSec Policies . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Default Policies: Quick and Easy . . . . . . . . . . . . . . . . . 186
Advanced IPSec Policies . . . . . . . . . . . . . . . . . . . . . . . . 191
Troubleshooting Notes . . . . . . . . . . . . . . . . . . . . . . . . . 197
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
■ 13 Encrypting File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
How EFS Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Public Key Cryptography and EFS . . . . . . . . . . . . . . . 200
User Encryption Certificates . . . . . . . . . . . . . . . . . . . . . 201
Implementing EFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Adding Data Recovery Agents . . . . . . . . . . . . . . . . . . . 203
Configuring Auto-Enroll User Certificates . . . . . . . . . 205
Setting Up Certificate Server . . . . . . . . . . . . . . . . . . . . . 206
Using Encrypting File System . . . . . . . . . . . . . . . . . . . . 209
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
■ 14 Securing IIS 5.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Simplifying Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The IIS Lockdown Tool . . . . . . . . . . . . . . . . . . . . . . . . . 215
How the IIS Lockdown Tool Works . . . . . . . . . . . . . . 217
URLScan ISAPI Filter Application . . . . . . . . . . . . . . . . 218
Disabling URLScan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
IIS Metabase Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
■ 15 Windows 2003 Security Advancements . . . . . . . . . . . . . . . . . . . . . . 223
What’s New in Windows 2003 . . . . . . . . . . . . . . . . . . . . . . . . 224
Internet Information Services 6.0 . . . . . . . . . . . . . . . . . 224
More Default Security . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Improved Security Facilities . . . . . . . . . . . . . . . . . . . . . 232
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
■ Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235