Learn how to think like an attacker—and identify potential security issues in your software. In this essential guide, security testing experts offer practical, hands-on guidance and code samples to help you find, classify, and assess security bugs before your software is released.
Discover how to:
Identify high-risk entry points and create test cases
Test clients and servers for malicious request/response bugs
Use black box and white box approaches to help reveal security vulnerabilities
Uncover spoofing issues, including identity and user interface spoofing
Detect bugs that can take advantage of your program’s logic, such as SQL injection
Test for XML, SOAP, and Web services vulnerabilities
Recognize information disclosure and weak permissions issues
Identify where attackers can directly manipulate memory
Test with alternate data representations to uncover canonicalization issues
Expose COM and ActiveX repurposing attacks
PLUS—Get code samples and debugging tools on the Web
Chapter 1 General Approach to Security Testing
Different Types of Security Testers
An Approach to Security Testing
Summary
Chapter 2 Using Threat Models for Security Testing
Threat Modeling
How Testers Can Leverage a Threat Model
Data Flow Diagrams
Enumeration of Entry Points and Exit Points
Enumeration of Threats
How Testers Should Use a Completed Threat Model
Implementation Rarely Matches the Specification or Threat Model
Summary
Chapter 3 Finding Entry Points
Finding and Ranking Entry Points
Common Entry Points
Summary
Chapter 4 Becoming a Malicious Client
Client/Server Interaction
Testing HTTP
Testing Specific Network Requests Quickly
Testing Tips
Summary
Chapter 5 Becoming a Malicious Server
Understanding Common Ways Clients Receive Malicious Server Responses
Does SSL Prevent Malicious Server Attacks?
Manipulating Server Responses
Examples of Malicious Response Bugs
Myth: It Is Difficult for an Attacker to Create a Malicious Server
Understanding Downgrade MITM Attacks
Testing Tips
Summary
Chapter 6 Spoofing
Grasping the Importance of Spoofing Issues
Finding Spoofing Issues
General Spoofing
User Interface Spoofing
Testing Tips
Summary
Chapter 7 Information Disclosure
Problems with Information Disclosure
Locating Common Areas of Information Disclosure
Identifying Interesting Data
Summary
Chapter 8 Buffer Overflows and Stack and Heap Manipulation
Understanding How Overflows Work
Testing for Overruns: Where to Look for Cases
Black Box (Functional) Testing
White Box Testing
Additional Topics
Testing Tips
Summary
Chapter 9 Format String Attacks
What Are Format Strings?
Understanding Why Format Strings Are a Problem
Testing for Format String Vulnerabilities
Walkthrough: Seeing a Format String Attack in Action
Testing Tips
Summary
Chapter 10 HTML Scripting Attacks
Understanding Reflected Cross-Site Scripting Attacks Against Servers
Understanding Persistent XSS Attacks Against Servers
Identifying Attackable Data for Reflected and Persistent XSS Attacks
Common Ways Programmers Try to Stop Attacks
Understanding Reflected XSS Attacks Against Local Files
Understanding Script Injection Attacks in the My Computer Zone
Ways Programmers Try to Prevent HTML Scripting Attacks
Understanding How Internet Explorer Mitigates XSS Attacks Against Local Files
Identifying HTML Scripting Vulnerabilities
Finding HTML Scripting Bugs Through Code Review
Summary
Chapter 11 XML Issues
Testing Non-XML Security Issues in XML Input Files
Testing XML-Specific Attacks
Simple Object Access Protocol
Testing Tips
Summary
Chapter 12 Canonicalization Issues
Understanding the Importance of Canonicalization Issues
Finding Canonicalization Issues
File-Based Canonicalization Issues
Web-Based Canonicalization Issues
Testing Tips
Summary
Chapter 13 Finding Weak Permissions
Understanding the Importance of Permissions
Finding Permissions Problems
Understanding the Windows Access Control Mechanism
Finding and Analyzing Permissions on Objects
Recognizing Common Permissions Problems
Determining the Accessibility of Objects
Other Permissions Considerations
Summary
Chapter 14 Denial of Service Attacks
Understanding Types of DoS Attacks
Testing Tips
Summary
Chapter 15 Managed Code Issues
Dispelling Common Myths About Using Managed Code
Understanding the Basics of Code Access Security
Finding Problems Using Code Reviews
Understanding the Issues of Using APTCA
Decompiling .NET Assemblies
Testing Tips
Summary
Chapter 16 SQL Injection
Exactly What Is SQL Injection?
Understanding the Importance of SQL Injection
Finding SQL Injection Issues
Avoiding Common Mistakes About SQL Injection
Understanding Repurposing of SQL Stored Procedures
Recognizing Similar Injection Attacks
Testing Tips
Summary
Chapter 17 Observation and Reverse Engineering
Observation Without a Debugger or Disassembler
Using a Debugger to Trace Program Execution and Change its Behavior
Using a Decompiler or Disassembler to Reverse Engineer a Program
Analyzing Security Updates
Testing Tips
Legal Considerations
Summary
Chapter 18 ActiveX Repurposing Attacks
Understanding ActiveX Controls
ActiveX Control Testing Walkthrough
Testing Tips
Summary
Chapter 19 Additional Repurposing Attacks
Understanding Document Formats That Request External Data
Web Pages Requesting External Data
Understanding Repurposing of Window and Thread Messages
Summary
Chapter 20 Reporting Security Bugs
Reporting the Issue
Contacting the Vendor
What to Expect After Contacting the Vendor
Public Disclosure
Addressing Security Bugs in Your Product
Summary
Appendix Tools of the Trade
General
ActiveX/COM
Canonicalization
Code Analysis
Debugging
Documents and Binaries
Fuzzers
Memory/Runtime
Network
Permissions
SQL
Appendix Security Test Cases Cheat Sheet
Network Requests and Responses
Spoofing
Information Disclosures
Buffer Overflows
Format Strings
Cross-Site Scripting and Script Injection
XML
SOAP
Canonicalization Issues
Weak Permissions
Denial of Service
Managed Code
SQL Injection
ActiveX
Appendix
Tom Gallagher
Bryan Jeffries
Lawrence Landauer
Title:
Hunting Security Bugs
By:
Tom Gallagher, Bryan Jeffries, Lawrence Landauer
Publisher:
Microsoft Press
Formats:
Print
Ebook
Safari Books Online
Print:
June 2006
Ebook:
January 2011
Pages:
592
Print ISBN:
978-0-7356-2187-9
| ISBN 10:
0-7356-2187-X
Ebook ISBN:
978-0-7356-9059-2
| ISBN 10:
0-7356-9059-6
Tom Gallagher
Tom Gallagher is the lead of the Microsoft® Office Security Test team, where he focuses on penetration testing, writing security testing tools, and providing security education.
Bryan Jeffries
Bryan Jeffries is a software engineer responsible for driving security testing on Microsoft® SharePoint® Products and Technologies.
Lawrence Landauer
Lawrence Landauer is a software engineer at Microsoft® where he works on coding, testing, and training projects related to security, personal productivity, and deployment.
Comments about Microsoft Press Hunting Security Bugs:
Hunting Security Bugs covers the methodology of testing software, large numbers of attacks, and some useful cheatsheets to use during testing.The first section covers the approach to security testing, models to classify software threats and discusses the common areas that attackers use; namely input.The coverage of the various types of security bugs is excellent although the coverage on web issues is a little light. The big names in web application defects have entire chapters such as SQL injection and Cross Site Scripting. However, some issues in the OWASP Top Ten and other web issues do not get coverage. Given that XSS and SQL injection are still the top web issues, this is fair but there should probably be a chapter on Cross Site Request Forgery due to its power, and Insecure Direct Object References because of the commonness of unprotected inputs in web pages.The coverage of buffer overflow and format string attacks is both solid and also offers easy to understand explanations with helpful diagrams.Two sections that are excellent are on XML and permissions. Many application security testing books mention permission issues but dont provide the amount of information needed or the focus which this book gives. There is a full chapter on XML which is helpful given the amount of XML used to transport data and XMLs use in Web 2.0 aka AJAX technology.The defenses recommeded are generally very good. There was an overdone focus on filtering in some cases. For example, in the SQL injection chapter filtering or escaping certain characters was recommended. Using stored procedures should have been given the highest recommendation and placed first on the "to do" list of defenses with dangerous charater escaping getting second billing. Dangeerous character escaping or filter is a type of blocklisting which is not a good first defense.The chapter on Cross Site Scripting correct points out that HTML encoding is an excellent defense and proceeds to demonstrate how to use this defense but also states that HTML injection will nto work when the context is not HTML (for example in JavaScript). While this is certainly true, the book should show how to encode in non-HTML web contexts. Instead of saying HTML encoding wont work in JavaScript, it would be better to simply state that JavaScript encoding should be used in the JavaScript context. Most developers will understand that using the wrong encoding for the context wont work if presented with all encoding choices (HTML Encoding, JavaScript Encoding, Cascading Style Sheet Encoding, HTML Attribute Encoding, HTTP Header Encoding, URL Query String Parameter Encoding).Overall the book has a great methodology for testing security defects and has the right mind-set for approaching security issues. The book advises to stop trying to test that functionilty works when good input is entered and start trying to find tests which show how to misuse the functionalty when mallicious input is entered.