About the Author |
|
xix | |
Foreword |
|
xxi | |
Acknowledgments |
|
xxv | |
Introduction |
|
xxvii | |
|
Web Insecurity Contributing Factors |
|
|
1 | (12) |
|
|
1 | (2) |
|
Why Web Security Is Important |
|
|
3 | (1) |
|
Web Insecurity Contributing Factors |
|
|
4 | (1) |
|
Managerial/Procedural Issues |
|
|
4 | (3) |
|
Management and the Bottom Line |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
Development Environment Versus Production Environment |
|
|
6 | (1) |
|
Firefighting Approach to Web Security (Reacting to Fires) |
|
|
7 | (1) |
|
Technical Misconceptions Regarding Web Security |
|
|
7 | (4) |
|
``We have our web server in a Demilitarized Zone (DMZ).'' |
|
|
8 | (1) |
|
|
9 | (1) |
|
``We have a Network-Based Intrusion Detection System.'' |
|
|
9 | (2) |
|
``We have a Host-Based Intrusion Detection System.'' |
|
|
11 | (1) |
|
``We are using Secure Socket Layer (SSL).'' |
|
|
11 | (1) |
|
|
11 | (2) |
|
|
13 | (40) |
|
CIS Apache Benchmark for UNIX: OS-Level Issues |
|
|
13 | (37) |
|
Minimize/Patch Non-HTTP Services |
|
|
13 | (6) |
|
Example Service Attack: 7350wu---FTP Exploit |
|
|
19 | (3) |
|
Vulnerable Services' Impact on Apache's Security |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
24 | (1) |
|
Denial of Service Attacks |
|
|
25 | (3) |
|
Create the Web Groups and User Account |
|
|
28 | (3) |
|
Lock Down the Web Server User Account |
|
|
31 | (1) |
|
|
32 | (3) |
|
Accessing OS-Level Commands |
|
|
35 | (4) |
|
Update the Ownership and Permissions of System Commands |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
41 | (1) |
|
|
41 | (1) |
|
|
41 | (9) |
|
|
50 | (3) |
|
Downloading and Installing Apache |
|
|
53 | (28) |
|
|
53 | (1) |
|
Using Pre-Compiled Binary Versus Source Code |
|
|
54 | (2) |
|
Downloading the Apache Source Code |
|
|
56 | (7) |
|
Why Verify with MD5 and PGP? |
|
|
56 | (7) |
|
Uncompress and Open: Gunzip and Untar |
|
|
63 | (17) |
|
Patches---Get `em While They're Hot! |
|
|
64 | (2) |
|
Monitoring for Vulnerabilities and Patches |
|
|
66 | (4) |
|
What Modules Should I Use? |
|
|
70 | (10) |
|
|
80 | (1) |
|
Configuring the httpd.conf File |
|
|
81 | (44) |
|
CIS Apache Benchmark Settings |
|
|
84 | (1) |
|
|
85 | (1) |
|
Disable Un-Needed Modules |
|
|
86 | (1) |
|
|
86 | (1) |
|
Server-Oriented Directives |
|
|
87 | (3) |
|
Multi-Processing Modules (MPMs) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
89 | (1) |
|
|
89 | (1) |
|
|
89 | (1) |
|
|
90 | (2) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
91 | (1) |
|
Denial of Service (DoS) Protective Directives |
|
|
92 | (7) |
|
Testing with Apache HTTP Server Benchmarking Tool (ab) in Default Configuration |
|
|
92 | (2) |
|
|
94 | (1) |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
96 | (1) |
|
MinSpareServers and MaxSpareServers |
|
|
96 | (1) |
|
|
96 | (1) |
|
MaxClients and ServerLimit |
|
|
97 | (1) |
|
Testing with Apache HTTP Benchmarking Tool (ab) with Updated Configuration |
|
|
97 | (2) |
|
|
99 | (1) |
|
Software Obfuscation Directives |
|
|
99 | (5) |
|
|
99 | (2) |
|
|
101 | (1) |
|
|
102 | (2) |
|
Directory Functionality Directives |
|
|
104 | (3) |
|
|
104 | (1) |
|
|
104 | (1) |
|
FollowSymLinks and SymLinksIfOwnerMatch |
|
|
105 | (1) |
|
Includes and IncludesNoExec |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
106 | (1) |
|
|
107 | (1) |
|
Access Control Directives |
|
|
107 | (1) |
|
|
108 | (1) |
|
|
109 | (2) |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
Access Control: Where Clients Come From |
|
|
111 | (3) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
112 | (1) |
|
Protecting the Root Directory |
|
|
113 | (1) |
|
Limiting HTTP Request Methods |
|
|
114 | (1) |
|
Logging General Directives |
|
|
114 | (2) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
Removing Default/Sample Files |
|
|
116 | (2) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (1) |
|
Updating Ownership and Permissions |
|
|
118 | (2) |
|
Server Configuration Files |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (1) |
|
Updating the Apachectl Script |
|
|
120 | (2) |
|
|
122 | (1) |
|
|
122 | (3) |
|
Essential Security Modules for Apache |
|
|
125 | (46) |
|
Secure Socket Layer (SSL) |
|
|
125 | (19) |
|
|
126 | (2) |
|
|
128 | (4) |
|
|
132 | (1) |
|
|
133 | (1) |
|
Creating an SSL Certificate |
|
|
133 | (1) |
|
Testing the Initial Configuration |
|
|
134 | (3) |
|
|
137 | (7) |
|
|
144 | (1) |
|
|
144 | (3) |
|
|
145 | (2) |
|
|
147 | (1) |
|
|
147 | (2) |
|
|
149 | (6) |
|
|
149 | (1) |
|
Installing Mod_Dosevasive |
|
|
149 | (1) |
|
How Does Mod_Dosevasive Work? |
|
|
150 | (1) |
|
|
151 | (4) |
|
|
155 | (1) |
|
|
155 | (14) |
|
|
156 | (1) |
|
|
156 | (1) |
|
Features and Capabilities of Mod_Security |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
159 | (3) |
|
|
162 | (2) |
|
|
164 | (4) |
|
|
168 | (1) |
|
|
169 | (2) |
|
Using the Center for Internet Security Apache Benchmark Scoring Tool |
|
|
171 | (10) |
|
Downloading, Unpacking, and Running the Scoring Tool |
|
|
171 | (9) |
|
|
173 | (1) |
|
|
174 | (6) |
|
|
180 | (1) |
|
Mitigating the WASC Web Security Threat Classification with Apache |
|
|
181 | (74) |
|
|
182 | (1) |
|
Web Security Threat Classification Description |
|
|
182 | (2) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
184 | (2) |
|
|
186 | (1) |
|
|
186 | (9) |
|
|
187 | (4) |
|
Insufficient Authentication |
|
|
191 | (1) |
|
Weak Password Recovery Validation |
|
|
192 | (3) |
|
|
195 | (10) |
|
Credential/Session Prediction |
|
|
195 | (3) |
|
Insufficient Authorization |
|
|
198 | (1) |
|
Insufficient Session Expiration |
|
|
199 | (2) |
|
|
201 | (4) |
|
|
205 | (5) |
|
|
205 | (2) |
|
|
207 | (3) |
|
|
210 | (22) |
|
|
210 | (5) |
|
|
215 | (3) |
|
|
218 | (2) |
|
|
220 | (3) |
|
|
223 | (5) |
|
|
228 | (2) |
|
|
230 | (2) |
|
|
232 | (11) |
|
|
232 | (4) |
|
|
236 | (3) |
|
|
239 | (3) |
|
Predictable Resource Location |
|
|
242 | (1) |
|
|
243 | (10) |
|
|
244 | (2) |
|
|
246 | (4) |
|
Insufficient Anti-Automation |
|
|
250 | (1) |
|
Insufficient Process Validation |
|
|
251 | (2) |
|
|
253 | (2) |
|
Protecting a Flawed Web Application: Buggy Bank |
|
|
255 | (40) |
|
|
256 | (5) |
|
|
257 | (1) |
|
Turn Off Security Settings |
|
|
258 | (1) |
|
|
258 | (3) |
|
|
261 | (1) |
|
|
262 | (1) |
|
|
262 | (4) |
|
|
262 | (1) |
|
|
263 | (1) |
|
|
263 | (3) |
|
Buggy Bank Vulnerabilities |
|
|
266 | (16) |
|
|
266 | (1) |
|
Enumerating Account Numbers |
|
|
267 | (3) |
|
|
270 | (1) |
|
Brute Forcing the Account Numbers |
|
|
270 | (3) |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
274 | (2) |
|
Brute Forcing the PIN Numbers |
|
|
276 | (1) |
|
|
277 | (1) |
|
|
278 | (4) |
|
|
282 | (5) |
|
|
285 | (2) |
|
Cross-Site Scripting (XSS) |
|
|
287 | (3) |
|
|
289 | (1) |
|
Balance Transfer Logic Flaw |
|
|
290 | (3) |
|
|
292 | (1) |
|
|
293 | (2) |
|
Prevention and Countermeasures |
|
|
295 | (136) |
|
Why Firewalls Fail to Protect Web Servers/Applications |
|
|
296 | (3) |
|
Why Intrusion Detection Systems Fail as Well |
|
|
299 | (5) |
|
Deep Packet Inspection Firewalls, Inline IDS, and Web Application Firewalls |
|
|
304 | (5) |
|
Deep Packet Inspection Firewall |
|
|
304 | (1) |
|
|
305 | (2) |
|
Web Application Firewall (WAF) |
|
|
307 | (2) |
|
Web Intrusion Detection Concepts |
|
|
309 | (33) |
|
|
309 | (5) |
|
Positive Policy Enforcement (White-Listing) |
|
|
314 | (11) |
|
|
325 | (4) |
|
Protocol-Based Inspection |
|
|
329 | (7) |
|
Uniform Resource Identifier (URI) Inspection |
|
|
336 | (3) |
|
Heuristic-Based Inspection |
|
|
339 | (1) |
|
|
340 | (2) |
|
Web IDS Evasion Techniques and Countermeasures |
|
|
342 | (10) |
|
|
342 | (5) |
|
|
347 | (1) |
|
Evasion by Abusing Apache Functionality |
|
|
348 | (4) |
|
Identifying Probes and Blocking Well-Known Offenders |
|
|
352 | (11) |
|
|
352 | (2) |
|
Blocking Well-Known Offenders |
|
|
354 | (3) |
|
|
357 | (1) |
|
|
358 | (1) |
|
Why Change the Server Banner Information? |
|
|
359 | (2) |
|
Masking the Server Banner Information |
|
|
361 | (2) |
|
|
363 | (16) |
|
Implementation Differences of the HTTP Protocol |
|
|
364 | (6) |
|
|
370 | (1) |
|
Advanced Web Server Fingerprinting |
|
|
370 | (1) |
|
|
371 | (2) |
|
Web Server Fingerprinting Defensive Recommendations |
|
|
373 | (6) |
|
Bad Bots, Curious Clients, and Super Scanners |
|
|
379 | (9) |
|
Bad Bots and Curious Clients |
|
|
379 | (2) |
|
|
381 | (7) |
|
Reacting to DoS, Brute Force, and Web Defacement Attacks |
|
|
388 | (11) |
|
|
388 | (1) |
|
|
389 | (3) |
|
|
392 | (5) |
|
Defacement Countermeasures |
|
|
397 | (2) |
|
Alert Notification and Tracking Attackers |
|
|
399 | (13) |
|
|
402 | (1) |
|
Creating Historical Knowledge |
|
|
403 | (1) |
|
Filtering Out Noise and Thresholding Emails |
|
|
403 | (1) |
|
Request Snapshot and Attacker Tracking Links |
|
|
403 | (1) |
|
|
404 | (1) |
|
|
404 | (1) |
|
|
404 | (1) |
|
|
404 | (8) |
|
Log Monitoring and Analysis |
|
|
412 | (12) |
|
Real-Time Monitoring with Swatch |
|
|
413 | (4) |
|
Heuristic/Statistical Log Monitoring with SIDS |
|
|
417 | (7) |
|
|
424 | (5) |
|
|
424 | (1) |
|
|
425 | (2) |
|
OS Commanding Trap and Trace |
|
|
427 | (1) |
|
Mod_Rewrite (2.1) to the Rescue |
|
|
428 | (1) |
|
|
429 | (2) |
|
|
431 | (78) |
|
Why Deploy an Open Web Proxy Honeypot? |
|
|
431 | (2) |
|
Lack of Knowledge That an Attack Even Occurred |
|
|
432 | (1) |
|
Lack of Verbose/Adequate Logging of HTTP Transactions |
|
|
432 | (1) |
|
Lack of Interest in Public Disclosure of the Attack |
|
|
432 | (1) |
|
|
433 | (1) |
|
|
434 | (1) |
|
|
435 | (4) |
|
|
435 | (1) |
|
Turn Off Un-Needed Network Services |
|
|
436 | (1) |
|
Configure Apache for Proxy |
|
|
436 | (3) |
|
|
439 | (3) |
|
|
439 | (1) |
|
|
439 | (2) |
|
Utilizing Snort Signatures |
|
|
441 | (1) |
|
|
441 | (1) |
|
|
442 | (2) |
|
Real-Time Monitoring with Webspy |
|
|
444 | (1) |
|
Honeynet Project's Scan of the Month Challenge #31 |
|
|
444 | (3) |
|
|
445 | (1) |
|
|
446 | (1) |
|
Question: How Do You Think the Attackers Found the Honeyproxy? |
|
|
447 | (1) |
|
Question: What Different Types of Attacks Can You Identify? For Each Category, Provide Just One Log Example and Detail as Much Info About the Attack as Possible (Such as CERT/CVE/Anti-Virus ID Numbers). How Many Can You Find? |
|
|
448 | (22) |
|
Search Logs for Mod_Security-Message |
|
|
449 | (1) |
|
Utilization of the AllowConnect Proxying Capabilities |
|
|
450 | (1) |
|
Search Logs for Abnormal HTTP Status Codes |
|
|
451 | (3) |
|
Abnormal HTTP Request Methods |
|
|
454 | (1) |
|
Non-HTTP Compliant Requests |
|
|
455 | (2) |
|
Attack Category---SPAMMERS |
|
|
457 | (2) |
|
Attack Category---Brute Force Authentication |
|
|
459 | (1) |
|
Attack Category---Vulnerability Scans |
|
|
459 | (6) |
|
Attack Category---Web-Based Worms |
|
|
465 | (3) |
|
Attack Category---Banner/Click-Thru Fraud |
|
|
468 | (1) |
|
Attack Category---IRC Connections |
|
|
469 | (1) |
|
Question: Do Attackers Target Secure Socket Layer (SSL)-Enabled Web Servers? |
|
|
470 | (3) |
|
Did They Target SSL on Our Honeyproxy? |
|
|
471 | (1) |
|
Why Would They Want to Use SSL? |
|
|
472 | (1) |
|
Why Didn't They Use SSL Exclusively? |
|
|
472 | (1) |
|
Question: Are There Any Indications of Attackers Chaining Through Other Proxy Servers? Describe How You Identified This Activity. List Other Proxy Servers Identified. Can You Confirm That These Are Indeed Proxy Servers? Identifying the Activity |
|
|
473 | (8) |
|
Confirming the Proxy Servers |
|
|
475 | (4) |
|
Targeting Specific Open Proxies |
|
|
479 | (1) |
|
Targeting Specific Destination Servers |
|
|
480 | (1) |
|
Question: Identify the Different Brute Force Authentication Attack Methods. Can You Obtain the Clear-Text Username/Password Credentials? Describe Your Methods |
|
|
481 | (12) |
|
|
481 | (1) |
|
|
482 | (1) |
|
HTTP Basic Authentication |
|
|
483 | (2) |
|
Obtaining the Cleartext Authorization Credentials |
|
|
485 | (1) |
|
Distributed Brute Force Scan Against Yahoo Accounts |
|
|
486 | (1) |
|
Forward and Reverse Scanning |
|
|
487 | (6) |
|
Question: What Does the Mod_Security Error Message ``Invalid Character Detected'' Mean? What Were the Attackers Trying to Accomplish? |
|
|
493 | (4) |
|
SecFilterCheckURLEncoding---URL-Encoding Validation |
|
|
493 | (1) |
|
SecFilterCheckUnicodeEncoding---Unicode-Encoding Validation |
|
|
494 | (1) |
|
SecFilterForceByteRange---Byte Range Check |
|
|
494 | (1) |
|
|
494 | (1) |
|
Code Red/NIMDA Worm Attacks |
|
|
495 | (2) |
|
Question: Several Attackers Tried to Send SPAM by Accessing the Following URL: http://mail.sina.com.cn/cgi-bin/sendmsg.cgi. They Tried to Send Email with an HTML Attachment (Files Listed in the /upload Directory). What Does the SPAM Web Page Say? Who Are the SPAM Recipients? SPAM Recipients |
|
|
497 | (1) |
|
Question: Provide Some High-Level Statistics |
|
|
498 | (4) |
|
Top Ten Attacker IP Addresses |
|
|
498 | (2) |
|
|
500 | (1) |
|
Top User-Agents (Any Weird/Fake Agent Strings?) |
|
|
500 | (1) |
|
Attacker Correlation from DShield and Other Sources? |
|
|
501 | (1) |
|
Bonus Question: Why Do You Think the Attackers Were Targeting Pornography Web Sites for Brute Force Attacks? (Besides the Obvious Physical Gratification Scenarios) |
|
|
502 | (4) |
|
Even Though the Proxypot's IP/Hostname Was Obfuscated from the Logs, Can You Still Determine the Probable Network Block Owner? |
|
|
504 | (2) |
|
|
506 | (3) |
|
|
509 | (14) |
|
Example Vulnerability Alert |
|
|
509 | (1) |
|
Verify the Software Version |
|
|
510 | (1) |
|
|
510 | (1) |
|
|
511 | (6) |
|
Creating a Mod_Security Vulnerability Filter |
|
|
514 | (1) |
|
Testing the Vulnerability Filter |
|
|
515 | (1) |
|
First Aid Versus a Hospital |
|
|
516 | (1) |
|
Web Security: Beyond the Web Server |
|
|
517 | (5) |
|
|
517 | (1) |
|
|
517 | (2) |
|
|
519 | (1) |
|
|
520 | (1) |
|
News Ticker Manipulations |
|
|
521 | (1) |
|
Defacement or No Defacement? |
|
|
521 | (1) |
|
|
522 | (1) |
Appendix A Web Application Security Consortium Glossary |
|
523 | (10) |
Appendix B Apache Module Listing |
|
533 | (16) |
Appendix C Example httpd.conf File |
|
549 | (12) |
Index |
|
561 | |