Foreword, |
|
xv | |
Preface, |
|
xvii | |
Authors, |
|
xxiii | |
Section I Our View Of The Security World |
|
|
Chapter 1 View Of The It Security World |
|
|
3 | (26) |
|
1.1 Brief History Of Web Security |
|
|
3 | (4) |
|
1.1.1 Brief History Of Chinese Hackers |
|
|
4 | (1) |
|
1.1.2 Development Process Of Hacking Techniques |
|
|
4 | (2) |
|
1.1.3 Rise Of Web Security |
|
|
6 | (1) |
|
|
7 | (1) |
|
1.3 Back To Nature: The Essence Of Secret Security |
|
|
8 | (2) |
|
1.4 Superstition: There Is No Silver Bullet |
|
|
10 | (1) |
|
1.4.1 Security: An Ongoing Process |
|
|
10 | (1) |
|
|
11 | (1) |
|
1.6 How To Implement Safety Assessment |
|
|
11 | (6) |
|
1.6.1 Asset Classification |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
14 | (2) |
|
1.6.4 Design Of Security Programs |
|
|
16 | (1) |
|
1.7 Art Of War For White Hat |
|
|
17 | (6) |
|
1.7.1 Principle Of Secure By Default |
|
|
17 | (2) |
|
1.7.1.1 Blacklist, Whitelist |
|
|
17 | (1) |
|
1.7.1.2 Principle Of Least Privilege |
|
|
18 | (1) |
|
1.7.2 Principle Of Defense In Depth |
|
|
19 | (1) |
|
1.7.3 Principles Of Data And Code Separation |
|
|
20 | (2) |
|
1.7.4 Unpredictability Of The Principles |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
23 | (6) |
Section II Safety On The Client Script |
|
|
Chapter 2 Security Of Browser |
|
|
29 | (16) |
|
|
29 | (5) |
|
|
34 | (2) |
|
2.3 Malicious URL Intercept |
|
|
36 | (3) |
|
2.4 Rapid Development Of Browser Security |
|
|
39 | (4) |
|
|
43 | (2) |
|
Chapter 3 Cross-Site Scripting Attack |
|
|
45 | (78) |
|
|
45 | (4) |
|
3.1.1 First Type: Reflected XSS |
|
|
47 | (1) |
|
3.1.2 Second Type: Stored XSS |
|
|
47 | (1) |
|
3.1.3 Third Type: Dom-Based XSS |
|
|
47 | (2) |
|
|
49 | (53) |
|
3.2.1 Preliminary Study On XSS Pay Load |
|
|
49 | (3) |
|
|
52 | (18) |
|
3.2.2.1 Structure Get And Post Request |
|
|
52 | (6) |
|
|
58 | (1) |
|
3.2.2.3 Identify The User's Browser |
|
|
59 | (3) |
|
3.2.2.4 Identify User-Installed Software |
|
|
62 | (2) |
|
|
64 | (4) |
|
3.2.2.6 Get The User's Real IP Address |
|
|
68 | (2) |
|
3.2.3 XSS Attack Platform |
|
|
70 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
71 | (1) |
|
3.2.4 Ultimate Weapon: XSS Worm |
|
|
71 | (12) |
|
|
71 | (7) |
|
3.2.4.2 Baidu Space Worms |
|
|
78 | (5) |
|
3.2.5 Debugging Javascript |
|
|
83 | (2) |
|
|
83 | (1) |
|
3.2.5.2 IE 8 Developer Tools |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
85 | (1) |
|
3.2.6 Construction Skills Of XSS |
|
|
85 | (8) |
|
3.2.6.1 Use Character Encoding |
|
|
86 | (1) |
|
3.2.6.2 Bypass The Length Limit |
|
|
87 | (3) |
|
3.2.6.3 Using <Base> Tags |
|
|
90 | (1) |
|
3.2.6.4 Magical Effect Of Window.Name |
|
|
91 | (2) |
|
3.2.7 Turning Waste Into Treasure: Mission Impossible |
|
|
93 | (4) |
|
3.2.7.1 Apache Expect Header XSS |
|
|
93 | (2) |
|
|
95 | (2) |
|
3.2.8 Easily Overlooked Corner: Flash XSS |
|
|
97 | (2) |
|
3.2.9 Really Sleep Without Any Anxiety: Javascript Development Framework |
|
|
99 | (3) |
|
|
100 | (1) |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
102 | (20) |
|
3.3.1 Skillfully Deflecting The Question: HTTPonly |
|
|
102 | (4) |
|
|
106 | (2) |
|
|
108 | (4) |
|
3.3.3.1 Secure Coding Function |
|
|
108 | (3) |
|
3.3.3.2 Only Need One Kind Of Coding |
|
|
111 | (1) |
|
3.3.4 Defense XSS Correctly Designed |
|
|
112 | (4) |
|
3.3.4.1 Output In HTML Attributes |
|
|
113 | (1) |
|
3.3.4.2 Output In The Event |
|
|
114 | (1) |
|
|
114 | (1) |
|
3.3.4.4 Output In Address |
|
|
115 | (1) |
|
3.3.5 Dealing With Rich Text |
|
|
116 | (1) |
|
3.3.6 Defense DOM-Based XSS |
|
|
117 | (5) |
|
3.3.7 See XSS From Another Angle Of Risk |
|
|
122 | (1) |
|
|
122 | (1) |
|
Chapter 4 Cross-Site Request Forgery |
|
|
123 | (18) |
|
|
123 | (2) |
|
|
125 | (11) |
|
4.2.1 Cookie Policy Of Browsers |
|
|
125 | (3) |
|
4.2.2 Side Effect Of P3P Header |
|
|
128 | (3) |
|
|
131 | (2) |
|
|
133 | (1) |
|
|
134 | (2) |
|
|
136 | (4) |
|
|
136 | (1) |
|
|
136 | (1) |
|
|
136 | (18) |
|
|
137 | (1) |
|
|
138 | (2) |
|
|
140 | (1) |
|
|
141 | (16) |
|
5.1 What Is Clickjacking? |
|
|
141 | (3) |
|
|
144 | (3) |
|
5.3 Image-Covering Attacks |
|
|
147 | (1) |
|
5.4 Drag Hijacking And Data Theft |
|
|
148 | (4) |
|
5.5 Clickjacking 3.0: Tapjacking |
|
|
152 | (2) |
|
5.6 Defense Against Clickjacking |
|
|
154 | (2) |
|
|
154 | (2) |
|
|
156 | (1) |
|
|
156 | (1) |
|
Chapter 6 HTML5 Securities |
|
|
157 | (16) |
|
|
157 | (6) |
|
|
157 | (1) |
|
|
158 | (1) |
|
6.1.3 Link Types: NoReferrer |
|
|
159 | (1) |
|
6.1.4 Magical Effect Of Canvas |
|
|
159 | (4) |
|
6.2 Other Security Problems |
|
|
163 | (7) |
|
6.2.1 Cross-Origin Resource Sharing |
|
|
163 | (2) |
|
6.2.2 Postmessage: Send Message Across Windows |
|
|
165 | (2) |
|
|
167 | (3) |
|
|
170 | (3) |
Section III Application Security On The Server Side |
|
|
Chapter 7 Injection Attacks |
|
|
173 | (34) |
|
7.1 SQL Injection Attacks |
|
|
173 | (6) |
|
|
174 | (1) |
|
|
175 | (4) |
|
7.2 Database Attacking Techniques |
|
|
179 | (15) |
|
7.2.1 Common Attack Techniques |
|
|
179 | (1) |
|
|
180 | (7) |
|
7.2.3 Stored Procedure Attacks |
|
|
187 | (2) |
|
|
189 | (2) |
|
7.2.5 SQL Column Truncation |
|
|
191 | (3) |
|
7.3 Properly Defending Against SQL Injection |
|
|
194 | (4) |
|
7.3.1 Using Precompiled Statements |
|
|
195 | (1) |
|
7.3.2 Using Stored Procedures |
|
|
196 | (1) |
|
7.3.3 Checking The Data Type |
|
|
196 | (1) |
|
7.3.4 Using Safety Functions |
|
|
197 | (1) |
|
7.4 Other Injection Attacks |
|
|
198 | (6) |
|
|
198 | (1) |
|
|
199 | (2) |
|
|
201 | (3) |
|
|
204 | (3) |
|
Chapter 8 File Upload Vulnerability |
|
|
207 | (14) |
|
8.1 File Upload Vulnerability Overview |
|
|
207 | (3) |
|
8.1.1 FCKEditor File Upload Vulnerability |
|
|
208 | (1) |
|
8.1.2 Bypassing The File Upload Check Function |
|
|
209 | (1) |
|
8.2 Functionality Or Vulnerability |
|
|
210 | (8) |
|
8.2.1 Apache File Parsing Problem |
|
|
211 | (1) |
|
8.2.2 IIS File Parsing Problem |
|
|
212 | (3) |
|
8.2.3 PHP CGI Path Parsing Problem |
|
|
215 | (2) |
|
8.2.4 Upload Files Phishing |
|
|
217 | (1) |
|
8.3 Designing Secure File Upload Features |
|
|
218 | (1) |
|
|
219 | (2) |
|
Chapter 9 Authentication And Session Management |
|
|
221 | (14) |
|
|
221 | (1) |
|
|
222 | (2) |
|
9.3 Multi Factor Authentication |
|
|
224 | (1) |
|
9.4 Session Management And Authentication |
|
|
225 | (2) |
|
9.5 Session Fixation Attacks |
|
|
227 | (1) |
|
|
228 | (3) |
|
|
231 | (2) |
|
|
233 | (2) |
|
Chapter 10 Access Control |
|
|
235 | (18) |
|
|
235 | (4) |
|
10.2 Vertical Rights Management |
|
|
239 | (3) |
|
10.3 Horizontal Rights Management |
|
|
242 | (2) |
|
10.3.1 Unauthorized User Access Problems On Youku.Com (Vulnerability No. Wooyun-2010-0129) |
|
|
242 | (1) |
|
10.3.2 Unauthorized User Access Problems On Iayifen.Com (Loopholes No. Wooyun-2010-01576) |
|
|
242 | (2) |
|
|
244 | (8) |
|
|
252 | (1) |
|
Chapter 11 Encryption Algorithms And Random Numbers |
|
|
253 | (72) |
|
|
253 | (2) |
|
11.2 Stream Cipher Attack |
|
|
255 | (14) |
|
|
255 | (8) |
|
11.2.2 Bit-Flipping Attack |
|
|
263 | (2) |
|
11.2.3 Issue Of Weak Random IV |
|
|
265 | (4) |
|
|
269 | (4) |
|
|
273 | (3) |
|
11.5 Padding Oracle Attack |
|
|
276 | (15) |
|
|
291 | (2) |
|
11.7 Problems With A Pseudorandom Number |
|
|
293 | (16) |
|
11.7.1 Trouble With A Weak Pseudorandom Number |
|
|
294 | (3) |
|
11.7.2 Time Is Really Random |
|
|
297 | (1) |
|
11.7.3 Breaking The Pseudorandom Number Algorithm Seed |
|
|
298 | (10) |
|
11.7.4 Using Secure Random Numbers |
|
|
308 | (1) |
|
|
309 | (1) |
|
11.A Appendix: Understanding The Md5 Length Extension Attack |
|
|
309 | (16) |
|
Chapter 12 Web Framework Security |
|
|
325 | (18) |
|
12.1 MVC Framework Security |
|
|
325 | (2) |
|
12.2 Template Engine And XSS Defenses |
|
|
327 | (3) |
|
12.3 Web Framework And CSRF Defense |
|
|
330 | (3) |
|
12.4 HTTP Header Management |
|
|
333 | (1) |
|
12.5 Data Persistence Layer And SQL Injection |
|
|
334 | (1) |
|
12.6 What More Can We Think Of? |
|
|
335 | (1) |
|
12.7 Web Framework Self-Security |
|
|
336 | (4) |
|
12.7.1 Struts 2 Command Execution Vulnerability |
|
|
336 | (2) |
|
|
338 | (1) |
|
12.7.3 Spring MVC Execution Vulnerability |
|
|
339 | (1) |
|
12.7.4 Django Execution Vulnerability |
|
|
340 | (1) |
|
|
340 | (3) |
|
Chapter 13 Application-Layer Denial-Of-Service Attacks |
|
|
343 | (26) |
|
13.1 Introduction To DDoS |
|
|
343 | (2) |
|
13.2 Application-Layer DDoS |
|
|
345 | (5) |
|
|
345 | (1) |
|
13.2.2 Restriction Of Request Frequency |
|
|
346 | (3) |
|
13.2.3 The Priest Climbs A Post, The Devil Climbs Ten |
|
|
349 | (1) |
|
13.3 About Verification Code |
|
|
350 | (3) |
|
13.4 DDoS In The Defense Application Layer |
|
|
353 | (2) |
|
13.5 Resource Exhaustion Attack |
|
|
355 | (7) |
|
|
355 | (4) |
|
|
359 | (2) |
|
|
361 | (1) |
|
13.6 Dos Caused By Regular Expression: Redos |
|
|
362 | (6) |
|
|
368 | (1) |
|
|
369 | (44) |
|
14.1 File Inclusion Vulnerability |
|
|
369 | (17) |
|
14.1.1 Local File Inclusion |
|
|
371 | (5) |
|
14.1.2 Remote File Inclusion |
|
|
376 | (1) |
|
14.1.3 Using Skill Of Local File Inclusion |
|
|
376 | (10) |
|
14.2 Variable Coverage Vulnerability |
|
|
386 | (5) |
|
14.2.1 Global Variable Coverage |
|
|
386 | (2) |
|
14.2.2 The Extract() Variable Coverage |
|
|
388 | (2) |
|
14.2.3 Traversal Initializing Variables |
|
|
390 | (1) |
|
14.2.4 The Import_request_variables Variable Coverage |
|
|
390 | (1) |
|
14.2.5 The Parse_str() Variable Coverage |
|
|
391 | (1) |
|
14.3 Code Execution Vulnerability |
|
|
391 | (15) |
|
14.3.1 "Dangerous Function" Executes The Code |
|
|
391 | (10) |
|
14.3.1.1 The Phpmyadmin 3.4.3.1 Remote Code Execution Vulnerability |
|
|
392 | (5) |
|
14.3.1.2 Mybb1.4 Remote Code Execution Vulnerability |
|
|
397 | (4) |
|
14.3.2 File Writing Code Execution |
|
|
401 | (1) |
|
14.3.3 Other Methods Of Code Execution |
|
|
402 | (27) |
|
14.3.3.1 Functions That Directly Execute Code |
|
|
402 | (1) |
|
|
403 | (1) |
|
14.3.3.3 Writing In Local File |
|
|
403 | (1) |
|
14.3.3.4 Execution Of The Preg_replace() Code |
|
|
403 | (1) |
|
14.3.3.5 Dynamic Function Execution |
|
|
404 | (1) |
|
|
404 | (1) |
|
14.3.3.7 Callback Function Execution Code |
|
|
404 | (1) |
|
14.3.3.8 Unserialize() Results In Code Execution |
|
|
405 | (1) |
|
14.4 Customize Secure PHP Environment |
|
|
406 | (5) |
|
|
411 | (2) |
|
Chapter 15 Web Server Configuration Security |
|
|
413 | (16) |
|
|
413 | (2) |
|
|
415 | (2) |
|
15.3 Jboss Remote Command Execution |
|
|
417 | (5) |
|
15.4 Tomcat Remote Command Execution |
|
|
422 | (3) |
|
15.5 HTTP Parameter Pollution |
|
|
425 | (1) |
|
|
426 | (3) |
Section IV Safety Operations Of Internet Companies |
|
|
Chapter 16 Security Of Internet Business |
|
|
429 | (38) |
|
16.1 What Kind Of Security Do Products Require? |
|
|
429 | (5) |
|
16.1.1 Security Requirements Of Internet Products |
|
|
430 | (2) |
|
16.1.2 What Is A Good Security Program? |
|
|
432 | (2) |
|
16.1.2.1 Complex Password Security |
|
|
433 | (1) |
|
16.2 Business Logic Security |
|
|
434 | (3) |
|
16.2.1 Loopholes In Password Security |
|
|
434 | (1) |
|
16.2.2 Who Will Be The Big Winner? |
|
|
434 | (1) |
|
16.2.3 Practice Deception |
|
|
435 | (1) |
|
16.2.4 Password Recovery Process |
|
|
436 | (1) |
|
16.3 How The Account Is Stolen |
|
|
437 | (3) |
|
16.3.1 Various Ways Of Account Theft |
|
|
438 | (1) |
|
16.3.2 Analysis On Why Accounts Get Stolen |
|
|
439 | (1) |
|
|
440 | (4) |
|
|
440 | (1) |
|
|
441 | (3) |
|
|
444 | (13) |
|
16.5.1 Details About Phishing |
|
|
444 | (3) |
|
|
447 | (1) |
|
16.5.3 Prevention And Control Of Phishing Sites |
|
|
448 | (4) |
|
16.5.3.1 Control The Routes Of Transmission Of Phishing Sites |
|
|
449 | (1) |
|
16.5.3.2 Direct Fight Against Phishing Sites |
|
|
450 | (1) |
|
|
450 | (1) |
|
16.5.3.4 Automatic Identification Of Phishing Sites |
|
|
451 | (1) |
|
16.5.4 Phishing In Online Shopping |
|
|
452 | (4) |
|
16.5.5 Analysis Of Phishing In Online Shopping And Its Prevention |
|
|
456 | (1) |
|
16.6 User Privacy Protection |
|
|
457 | (3) |
|
16.6.1 Challenges In Internet User Privacy |
|
|
457 | (1) |
|
16.6.2 How To Protect User Privacy |
|
|
458 | (1) |
|
|
459 | (1) |
|
|
460 | (1) |
|
16.A Appendix: Trouble Terminator |
|
|
461 | (6) |
|
Chapter 17 Security Development Lifecycle |
|
|
467 | (20) |
|
|
467 | (4) |
|
|
471 | (1) |
|
17.3 SDL Actual Combat Experience |
|
|
472 | (3) |
|
17.4 Requirements Analysis And Design Phase |
|
|
475 | (5) |
|
|
480 | (4) |
|
17.5.1 Providing Security Functions |
|
|
480 | (3) |
|
17.5.2 Code Security Audit Tool |
|
|
483 | (1) |
|
|
484 | (2) |
|
|
486 | (1) |
|
Chapter 18 Security Operations |
|
|
487 | (12) |
|
18.1 Make The Security Operated |
|
|
487 | (1) |
|
18.2 Process Of Vulnerability Patch |
|
|
488 | (2) |
|
|
490 | (1) |
|
|
491 | (3) |
|
18.5 Emergency Response Process |
|
|
494 | (2) |
|
|
496 | (1) |
|
|
496 | (3) |
Index |
|
499 | |