Hacking SQL Server
Hacking SQL Server
Hacking SQL Server
/ Hacking
Exposed
Color profile: Generic
CMYK printer
profile
Composite Default screen
Windows 2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3
/ Front Matter
CONTENTS
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xix
xxi
xxiii
Part I
Foundations
4
7
7
9
10
12
12
13
15
15
16
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
xi
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:49 AM
/ Hacking
Color Hacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
xii
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17
18
19
20
22
24
24
27
29
30
32
Part II
Profiling
38
43
54
54
54
4 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
57
58
58
59
66
67
81
85
89
91
. .
.
. .
. .
.
. .
. .
. .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
37
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Part III
Divide and Conquer
5 Hacking CIFS/SMB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Guessing SMB Passwords . . . . . . . . . . . . . . . . . . . .
Close Existing Null Sessions to Target . . . . . . . . . .
Review Enumeration Results . . . . . . . . . . . . . . .
Avoid Account Lockout . . . . . . . . . . . . . . . . . .
The Importance of Administrator and Service Accounts
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:50 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
95
96
97
97
98
99
/ Hacking
ColorzHacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
Contents
112
126
127
6 Privilege Escalation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
129
131
133
136
137
137
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7 Getting Interactive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command-line Control . . . . . . . . . . . . .
Graphical User Interface (GUI) Control . . .
Summary . . . . . . . . . . . . . . . . . . . . .
References and Further Reading . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
140
146
149
149
8 Expanding Influence . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
151
152
154
154
154
156
156
164
169
170
172
176
179
179
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
139
.
.
.
.
Auditing . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extracting Passwords . . . . . . . . . . . . . . . . . . . . .
Pulling Reversibly Encrypted Passwords . . . . . .
Grabbing Cleartext Passwords from the LSA Cache
Password Cracking . . . . . . . . . . . . . . . . . . . . . .
The LM Hash Weakness . . . . . . . . . . . . . . . .
File Searching . . . . . . . . . . . . . . . . . . . . . . . . .
Trojan GINAs . . . . . . . . . . . . . . . . . . . . . . . . .
Sniffing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Island Hopping . . . . . . . . . . . . . . . . . . . . . . . .
Port Redirection . . . . . . . . . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .
References and Further Reading . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9 Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Rogue User Accounts . . . . . . . . . . . . . . . . .
Trojan Logon Screens . . . . . . . . . . . . . . . . . . . . . . .
Remote Control . . . . . . . . . . . . . . . . . . . . . . . . . .
Back-Door Server Packages . . . . . . . . . . . . . . . .
Where Back Doors and Trojans Are Planted . . . . . . . . . .
Startup Folders . . . . . . . . . . . . . . . . . . . . . . .
Startup Registry Keys . . . . . . . . . . . . . . . . . . .
Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a Web Browser Startup Page to Download Code
Scheduled Jobs . . . . . . . . . . . . . . . . . . . . . . .
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:50 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
181
182
183
183
183
185
186
186
187
187
188
xiii
/ Hacking
Color Hacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
xiv
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
Rootkits . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Covering tracks . . . . . . . . . . . . . . . . . . . . . . . .
Erasing the Logs . . . . . . . . . . . . . . . . . . . .
Hiding Files . . . . . . . . . . . . . . . . . . . . . . .
General Countermeasures: A Mini-Forensic Examination
Automated Tools . . . . . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .
References and Further Reading . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
188
190
190
190
194
194
201
201
Part IV
Exploiting Vulnerable Services and Clients
206
206
212
222
229
234
238
249
249
250
251
252
253
255
255
258
261
267
268
272
272
273
273
273
274
274
275
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:50 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
205
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
/ Hacking
ColorzHacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
Contents
.
.
.
.
.
.
.
.
.
.
276
277
279
289
293
.
.
.
.
.
.
.
.
298
302
306
307
309
310
311
311
311
312
315
319
319
321
322
323
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:50 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
325
326
327
327
327
330
330
330
335
338
342
345
348
350
355
356
357
363
364
xv
/ Hacking
Color Hacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
xvi
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
References and Further Reading . . . . . . . . . . . . . . . . . . .
365
366
14 Physical Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
371
372
374
381
382
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
15 Denial of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Current Windows 2000 DoS Attacks . . .
Best Practices for Defending DoS . . . . .
Best Practices . . . . . . . . . . . . .
Windows 2000Specific DoS Advice
Summary . . . . . . . . . . . . . . . . . . .
References and Further Reading . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
385
.
.
.
.
.
.
387
395
396
396
399
399
403
404
405
408
408
409
410
411
413
413
413
418
424
426
427
428
429
431
431
433
433
Part V
Playing Defense
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:51 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
/ Hacking
ColorzHacking
profile: Generic
CMYKExposed
printer Windows
profile
Composite Default screen
2000: Network Security Secrets & Solutions / Scambray & McClure / 9262-3 / Front Matter
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
451
452
452
453
453
458
460
461
461
462
465
467
468
470
470
471
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
473
435
436
436
437
438
438
438
438
439
448
449
449
P:\010Comp\Hacking\262-3\fm.vp
Monday, August 13, 2001 11:49:51 AM
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
xvii