| Foreword |
|
xxvii | |
|
|
|
1 | (94) |
|
|
|
2 | (3) |
|
|
|
5 | (30) |
|
A Methodology for Reconnaissance |
|
|
5 | (2) |
|
|
|
7 | (12) |
|
|
|
19 | (6) |
|
|
|
25 | (10) |
|
|
|
35 | (15) |
|
|
|
35 | (1) |
|
|
|
36 | (1) |
|
|
|
37 | (1) |
|
|
|
38 | (1) |
|
Domain Name Registries and Registrars |
|
|
38 | (2) |
|
|
|
40 | (1) |
|
|
|
40 | (1) |
|
|
|
40 | (4) |
|
|
|
44 | (2) |
|
|
|
46 | (1) |
|
|
|
46 | (1) |
|
|
|
47 | (1) |
|
The Regional Internet Registries |
|
|
47 | (3) |
|
|
|
50 | (45) |
|
Intelligence-Gathering Tools |
|
|
50 | (1) |
|
|
|
51 | (4) |
|
|
|
55 | (10) |
|
Open Source Windows Tools |
|
|
65 | (1) |
|
WinBiLE (www.sensepost.com/research) |
|
|
66 | (1) |
|
|
|
67 | (1) |
|
|
|
68 | (1) |
|
|
|
69 | (3) |
|
Open Source Windows Tools |
|
|
72 | (1) |
|
|
|
73 | (1) |
|
|
|
74 | (3) |
|
|
|
77 | (3) |
|
Case Studies---The Tools in Action |
|
|
80 | (1) |
|
Intelligence Gathering, Footprinting, and Verification of an Internet-Connected Network |
|
|
81 | (7) |
|
|
|
88 | (2) |
|
|
|
90 | (5) |
|
|
|
95 | (54) |
|
|
|
96 | (1) |
|
|
|
97 | (3) |
|
|
|
97 | (1) |
|
|
|
98 | (2) |
|
|
|
100 | (8) |
|
|
|
100 | (1) |
|
|
|
101 | (4) |
|
Going Behind the Scenes with Enumeration |
|
|
105 | (1) |
|
|
|
105 | (1) |
|
|
|
106 | (1) |
|
|
|
106 | (1) |
|
Being Loud, Quiet, and All that Lies Between |
|
|
106 | (1) |
|
|
|
107 | (1) |
|
|
|
107 | (1) |
|
|
|
108 | (1) |
|
|
|
108 | (23) |
|
|
|
108 | (1) |
|
|
|
108 | (7) |
|
|
|
115 | (1) |
|
|
|
116 | (1) |
|
|
|
117 | (2) |
|
|
|
119 | (1) |
|
|
|
119 | (6) |
|
Windows Enumeration: smbgetserverinfo/smbdumpusers |
|
|
125 | (6) |
|
Case Studies---The Tools in Action |
|
|
131 | (15) |
|
|
|
131 | (5) |
|
|
|
136 | (4) |
|
|
|
140 | (3) |
|
|
|
143 | (3) |
|
|
|
146 | (3) |
|
Introduction to Testing Databases |
|
|
149 | (40) |
|
|
|
150 | (1) |
|
|
|
150 | (1) |
|
|
|
151 | (1) |
|
|
|
151 | (2) |
|
Context of Database Assessment |
|
|
152 | (1) |
|
Process of Penetration Testing a Database |
|
|
152 | (1) |
|
|
|
153 | (10) |
|
|
|
153 | (2) |
|
|
|
155 | (1) |
|
Default Users and New Users |
|
|
156 | (2) |
|
|
|
158 | (3) |
|
|
|
161 | (2) |
|
|
|
163 | (16) |
|
|
|
163 | (1) |
|
Footprinting, Scanning, and Enumeration Tools |
|
|
164 | (1) |
|
Locating Database Servers by Port |
|
|
164 | (2) |
|
|
|
166 | (1) |
|
Unauthenticated Enumeration |
|
|
166 | (8) |
|
Vulnerability Assessment and Exploit Tools |
|
|
174 | (1) |
|
|
|
174 | (1) |
|
Interpreting Nessus Database Vulnerabilities |
|
|
174 | (2) |
|
|
|
176 | (1) |
|
|
|
177 | (1) |
|
|
|
178 | (1) |
|
Case Studies---The Tools in Action |
|
|
179 | (9) |
|
|
|
180 | (3) |
|
|
|
183 | (5) |
|
|
|
188 | (1) |
|
|
|
188 | (1) |
|
|
|
188 | (1) |
|
Web Server & Web Application Testing |
|
|
189 | (88) |
|
|
|
190 | (2) |
|
|
|
190 | (1) |
|
Web Server Vulnerabilities---A Short History |
|
|
190 | (1) |
|
Web Applications---The New Challenge |
|
|
191 | (1) |
|
|
|
192 | (1) |
|
|
|
192 | (4) |
|
Approach: Web Server Testing |
|
|
193 | (2) |
|
Approach: CGI and Default Pages Testing |
|
|
195 | (1) |
|
Approach: Web Application Testing |
|
|
196 | (1) |
|
|
|
196 | (12) |
|
Web Server Exploit Basics |
|
|
196 | (1) |
|
What Are We Talking About? |
|
|
196 | (6) |
|
CGI and Default Page Exploitation |
|
|
202 | (2) |
|
Web Application Assessment |
|
|
204 | (1) |
|
Information Gathering Attacks |
|
|
205 | (1) |
|
File System and Directory Traversal Attacks |
|
|
205 | (1) |
|
Command Execution Attacks |
|
|
205 | (1) |
|
Database Query Injection Attacks |
|
|
206 | (1) |
|
|
|
207 | (1) |
|
Authentication and Authorization |
|
|
207 | (1) |
|
Parameter Passing Attacks |
|
|
207 | (1) |
|
|
|
208 | (40) |
|
Intelligence Gathering Tools |
|
|
208 | (9) |
|
|
|
217 | (12) |
|
|
|
229 | (2) |
|
|
|
231 | (11) |
|
|
|
242 | (3) |
|
|
|
245 | (3) |
|
Case Studies---The Tools in Action |
|
|
248 | (29) |
|
|
|
248 | (6) |
|
CGI and Default Page Exploitation |
|
|
254 | (9) |
|
Web Application Assessment |
|
|
263 | (14) |
|
Wireless Penetration Testing Using Auditor |
|
|
277 | (40) |
|
|
|
278 | (1) |
|
|
|
278 | (1) |
|
|
|
279 | (2) |
|
Understanding WLAN Vulnerabilities |
|
|
279 | (1) |
|
Evolution of WLAN Vulnerabilities |
|
|
280 | (1) |
|
|
|
281 | (9) |
|
|
|
282 | (1) |
|
Choosing the Right Antenna |
|
|
283 | (1) |
|
|
|
284 | (1) |
|
Wired Equivalent Privacy (WEP) |
|
|
284 | (1) |
|
WiFi Protected Access (WPA/WPA2) |
|
|
285 | (1) |
|
Extensible Authentication Protocol (EAP) |
|
|
285 | (1) |
|
Virtual Private Network (VPN) |
|
|
286 | (1) |
|
|
|
286 | (1) |
|
|
|
286 | (2) |
|
|
|
288 | (1) |
|
|
|
289 | (1) |
|
|
|
289 | (1) |
|
|
|
290 | (17) |
|
|
|
290 | (1) |
|
Intelligence Gathering Tools |
|
|
291 | (1) |
|
|
|
292 | (1) |
|
Google (Internet Search Engines) |
|
|
292 | (1) |
|
|
|
293 | (1) |
|
|
|
293 | (2) |
|
|
|
295 | (3) |
|
|
|
298 | (1) |
|
Vulnerability Assessment Tools |
|
|
299 | (2) |
|
|
|
301 | (1) |
|
|
|
301 | (1) |
|
Deauthentication with Void11 |
|
|
302 | (1) |
|
Cracking WEP with the Aircrack Suite |
|
|
303 | (3) |
|
Cracking WPA with the CoWPAtty |
|
|
306 | (1) |
|
|
|
307 | (7) |
|
Case Study---Cracking WEP |
|
|
307 | (4) |
|
Case Study---Cracking WPA-PSK |
|
|
311 | (3) |
|
|
|
314 | (3) |
|
Additional GPSMap Map Servers |
|
|
314 | (3) |
|
|
|
317 | (42) |
|
|
|
318 | (1) |
|
|
|
318 | (1) |
|
|
|
319 | (1) |
|
|
|
320 | (24) |
|
|
|
320 | (1) |
|
|
|
320 | (1) |
|
|
|
321 | (1) |
|
|
|
322 | (1) |
|
|
|
323 | (1) |
|
|
|
324 | (2) |
|
|
|
326 | (1) |
|
|
|
326 | (3) |
|
|
|
329 | (2) |
|
|
|
331 | (1) |
|
|
|
332 | (1) |
|
|
|
332 | (1) |
|
|
|
332 | (2) |
|
|
|
334 | (1) |
|
Vulnerability Assessment Tools |
|
|
334 | (1) |
|
|
|
334 | (1) |
|
|
|
335 | (1) |
|
|
|
335 | (1) |
|
|
|
336 | (2) |
|
|
|
338 | (1) |
|
|
|
339 | (1) |
|
Internet Routing Protocol Attack Suite (IRPAS) |
|
|
340 | (3) |
|
|
|
343 | (1) |
|
Case Studies---The Tools in Action |
|
|
344 | (9) |
|
Obtaining a Router Configuration by Brute Force |
|
|
344 | (9) |
|
|
|
353 | (6) |
|
Common and Default Vendor Passwords |
|
|
355 | (1) |
|
|
|
356 | (1) |
|
|
|
356 | (1) |
|
|
|
357 | (2) |
|
Writing Open Source Security Tools |
|
|
359 | (70) |
|
|
|
360 | (1) |
|
Why Would You Want to Learn to Code? |
|
|
360 | (5) |
|
The Process of Programming |
|
|
360 | (1) |
|
Step 1: Solve the Right Problem by Asking the Right Questions |
|
|
361 | (1) |
|
Step 2: Breaking the Problem into Smaller, Manageable Problems |
|
|
362 | (2) |
|
|
|
364 | (1) |
|
Step 4: Implement the Actual Code |
|
|
365 | (1) |
|
|
|
365 | (6) |
|
|
|
366 | (1) |
|
|
|
366 | (1) |
|
|
|
367 | (1) |
|
|
|
367 | (1) |
|
|
|
368 | (1) |
|
|
|
368 | (1) |
|
|
|
369 | (1) |
|
|
|
370 | (1) |
|
|
|
370 | (1) |
|
Web Application Languages |
|
|
371 | (1) |
|
|
|
371 | (1) |
|
|
|
371 | (1) |
|
Interactive Development Environments |
|
|
371 | (24) |
|
|
|
372 | (10) |
|
|
|
382 | (6) |
|
Microsoft Visual Studio .NET |
|
|
388 | (4) |
|
|
|
392 | (3) |
|
|
|
395 | (28) |
|
|
|
395 | (1) |
|
Basic Program Structure, Data Structures, Conditionals, and Loops |
|
|
395 | (3) |
|
Basic File IO and Subroutines |
|
|
398 | (3) |
|
Writing to a Socket and Using MySQL |
|
|
401 | (5) |
|
Consuming a Web Service and Writing a CGI |
|
|
406 | (6) |
|
|
|
412 | (1) |
|
Basic Program Structure, Data Structures, Conditionals, and Loops |
|
|
412 | (3) |
|
Basic File IO and Databases |
|
|
415 | (4) |
|
|
|
419 | (4) |
|
|
|
423 | (1) |
|
Useful functions and code snippets |
|
|
423 | (5) |
|
|
|
423 | (4) |
|
|
|
427 | (1) |
|
Links to Resources in this Chapter / Further Reading |
|
|
428 | (1) |
|
|
|
429 | (42) |
|
|
|
430 | (1) |
|
|
|
430 | (1) |
|
|
|
431 | (4) |
|
|
|
431 | (3) |
|
|
|
434 | (1) |
|
|
|
435 | (1) |
|
|
|
435 | (13) |
|
Running Nessus from Auditor |
|
|
436 | (1) |
|
Point and Click: Launching Nessus From Within Auditor |
|
|
436 | (4) |
|
Behind the Scenes: Analyzing Auditor's start-nessus Script |
|
|
440 | (2) |
|
From The Ground Up: Nessus Without A Startup Script |
|
|
442 | (4) |
|
Running Nessus on Windows |
|
|
446 | (2) |
|
|
|
448 | (9) |
|
|
|
448 | (1) |
|
Auditor's Plug-In Update: Method #1 |
|
|
449 | (3) |
|
Auditor's Plug-In Update: Method #2 |
|
|
452 | (4) |
|
Updating the Nessus Program |
|
|
456 | (1) |
|
|
|
457 | (10) |
|
|
|
458 | (1) |
|
Prefs (The Preferences Tab) |
|
|
459 | (5) |
|
|
|
464 | (2) |
|
|
|
466 | (1) |
|
|
|
467 | (1) |
|
|
|
467 | (2) |
|
|
|
469 | (1) |
|
Frequently Asked Questions |
|
|
469 | (2) |
|
|
|
471 | (72) |
|
|
|
472 | (2) |
|
|
|
472 | (1) |
|
|
|
473 | (1) |
|
Simplicity and Convenience |
|
|
473 | (1) |
|
Modularity and Efficiency |
|
|
473 | (1) |
|
|
|
474 | (1) |
|
|
|
474 | (1) |
|
|
|
474 | (13) |
|
|
|
474 | (1) |
|
|
|
475 | (3) |
|
|
|
478 | (5) |
|
|
|
483 | (4) |
|
|
|
487 | (7) |
|
Writing Personal-Use Tools in NASL |
|
|
488 | (1) |
|
|
|
488 | (1) |
|
|
|
488 | (1) |
|
Packet Manipulation Functions |
|
|
488 | (1) |
|
String Manipulation Functions |
|
|
489 | (1) |
|
|
|
489 | (1) |
|
The NASL Command-Line Interpreter |
|
|
489 | (2) |
|
Programming in the Nessus Framework |
|
|
491 | (1) |
|
|
|
491 | (3) |
|
Case Study: The Canonical NASL Script |
|
|
494 | (3) |
|
|
|
497 | (11) |
|
|
|
498 | (1) |
|
|
|
498 | (1) |
|
|
|
499 | (1) |
|
|
|
500 | (1) |
|
Porting to NASL from C/C++ |
|
|
501 | (6) |
|
|
|
507 | (1) |
|
|
|
508 | (1) |
|
Microsoft IIS HTR ISAPI Extension Buffer Overflow Vulnerability |
|
|
508 | (1) |
|
Case Study: IIS .HTR ISAPI Filter Applied CVE-2002-0071 |
|
|
509 | (5) |
|
Microsoft IIS/Site Server codebrws.asp Arbitrary File Access |
|
|
513 | (1) |
|
Case Study: Codebrws.asp Source Disclosure Vulnerability CVE-1999-0739 |
|
|
514 | (3) |
|
Microsoft SQL Server Bruteforcing |
|
|
516 | (1) |
|
Case Study: Microsoft's SQL Server Bruteforce |
|
|
517 | (10) |
|
ActivePerl perlIIS.dll Buffer Overflow Vulnerability |
|
|
526 | (1) |
|
Case Study: ActivePerl perlIS.dll Buffer Overflow |
|
|
527 | (4) |
|
Microsoft FrontPage/IIS Cross-Site Scripting shtml.dll Vulnerability |
|
|
531 | (1) |
|
Case Study: Microsoft FrontPage XSS |
|
|
531 | (5) |
|
|
|
536 | (1) |
|
|
|
537 | (2) |
|
|
|
539 | (1) |
|
Frequently Asked Questions |
|
|
540 | (3) |
|
NASL Extensions and Custom Tests |
|
|
543 | (20) |
|
|
|
544 | (1) |
|
Extending NASL Using Include Files |
|
|
544 | (6) |
|
|
|
544 | (6) |
|
Extending the Capabilities of Tests Using the Nessus Knowledge Base |
|
|
550 | (2) |
|
Extending the Capabilities of Tests Using Process Launching and Results Analysis |
|
|
552 | (10) |
|
What Can We Do with Trusted Functions? |
|
|
553 | (1) |
|
|
|
554 | (8) |
|
|
|
562 | (1) |
|
Understanding the Extended Capabilities of the Nessus Environment |
|
|
563 | (18) |
|
|
|
564 | (1) |
|
Windows Testing Functionality Provided by the smb_nt.inc Include File |
|
|
564 | (16) |
|
Windows Testing Functionality Provided by the smb_hotfixes.inc Include File |
|
|
569 | (4) |
|
UNIX Testing Functionality Provided by the Local Testing Include Files |
|
|
573 | (7) |
|
|
|
580 | (1) |
|
|
|
581 | (44) |
|
|
|
582 | (1) |
|
|
|
582 | (37) |
|
|
|
583 | (14) |
|
|
|
597 | (1) |
|
|
|
597 | (1) |
|
General msfconsole Commands |
|
|
598 | (1) |
|
|
|
599 | (5) |
|
Exploiting with msfconsole |
|
|
604 | (9) |
|
|
|
613 | (6) |
|
|
|
619 | (2) |
|
|
|
621 | (1) |
|
|
|
621 | (1) |
|
|
|
621 | (1) |
|
Frequently Asked Questions |
|
|
622 | (3) |
|
|
|
625 | (54) |
|
|
|
626 | (1) |
|
Exploit Development with Metasploit |
|
|
626 | (39) |
|
Determining the Attack Vector |
|
|
627 | (1) |
|
|
|
628 | (6) |
|
Selecting a Control Vector |
|
|
634 | (7) |
|
|
|
641 | (6) |
|
|
|
647 | (1) |
|
Determining Bad Characters |
|
|
648 | (2) |
|
Determining Space Limitations |
|
|
650 | (2) |
|
|
|
652 | (2) |
|
Choosing a Payload and Encoder |
|
|
654 | (11) |
|
Integrating Exploits into the Framework |
|
|
665 | (10) |
|
Understanding the Framework |
|
|
666 | (1) |
|
Analyzing an Existing Exploit Module |
|
|
667 | (6) |
|
|
|
673 | (2) |
|
|
|
675 | (1) |
|
|
|
675 | (1) |
|
|
|
676 | (1) |
|
Frequently Asked Questions |
|
|
677 | (2) |
| Index |
|
679 | |