Book description
As malware increasingly obfuscates itself and applies anti-analysis techniques to thwart our analysis, we need more sophisticated methods that allow us to raise that dark curtain designed to keep us out—binary analysis can help. The goal of all binary analysis is to determine (and possibly modify) the true properties of binary programs to understand what they really do, rather than what we think they should do. While reverse engineering and disassembly are critical first steps in many forms of binary analysis, there is much more to be learned.
This hands-on guide teaches you how to tackle the fascinating but challenging topics of binary analysis and instrumentation and helps you become proficient in an area typically only mastered by a small group of expert hackers. It will take you from basic concepts to state-of-the-art methods as you dig into topics like code injection, disassembly, dynamic taint analysis, and binary instrumentation. Written for security engineers, hackers, and those with a basic working knowledge of C/C++ and x86-64, Practical Binary Analysis will teach you in-depth how binary programs work and help you acquire the tools and techniques needed to gain more control and insight into binary programs.
Once you’ve completed an introduction to basic binary formats, you’ll learn how to analyze binaries using techniques like the GNU/Linux binary analysis toolchain, disassembly, and code injection. You’ll then go on to implement profiling tools with Pin and learn how to build your own dynamic taint analysis tools with libdft and symbolic execution tools using Triton. You’ll learn how to:
•Parse ELF and PE binaries and build a binary loader with libbfd
•Use data-flow analysis techniques like program tracing, slicing, and reaching definitions analysis to reason about runtime flow of your programs
•Modify ELF binaries with techniques like parasitic code injection and hex editing
•Build custom disassembly tools with Capstone
•Use binary instrumentation to circumvent anti-analysis tricks commonly used by malware
•Apply taint analysis to detect control hijacking and data leak attacks
•Use symbolic execution to build automatic exploitation tools
With exercises at the end of each chapter to help solidify your skills, you’ll go from understanding basic assembly to performing some of the most sophisticated binary analysis and instrumentation. Practical Binary Analysis gives you what you need to work effectively with binary programs and transform your knowledge from basic understanding to expert-level proficiency.
Table of contents
- Cover Page
- Title Page
- Copyright Page
- Dedication
- About the Author
- BRIEF CONTENTS
- CONTENTS IN DETAIL
- FOREWORD
- PREFACE
- ACKNOWLEDGMENTS
- INTRODUCTION
- PART I: BINARY FORMATS
- 1 ANATOMY OF A BINARY
- 2 THE ELF FORMAT
- 3 THE PE FORMAT: A BRIEF INTRODUCTION
- 4 BUILDING A BINARY LOADER USING LIBBFD
- PART II: BINARY ANALYSIS FUNDAMENTALS
-
5 BASIC BINARY ANALYSIS IN LINUX
- 5.1 Resolving Identity Crises Using file
- 5.2 Using ldd to Explore Dependencies
- 5.3 Viewing File Contents with xxd
- 5.4 Parsing the Extracted ELF with readelf
- 5.5 Parsing Symbols with nm
- 5.6 Looking for Hints with strings
- 5.7 Tracing System Calls and Library Calls with strace and ltrace
- 5.8 Examining Instruction-Level Behavior Using objdump
- 5.9 Dumping a Dynamic String Buffer Using gdb
- 5.10 Summary
- Exercise
- 6 DISASSEMBLY AND BINARY ANALYSIS FUNDAMENTALS
- 7 SIMPLE CODE INJECTION TECHNIQUES FOR ELF
- PART III: ADVANCED BINARY ANALYSIS
- 8 CUSTOMIZING DISASSEMBLY
- 9 BINARY INSTRUMENTATION
- 10 PRINCIPLES OF DYNAMIC TAINT ANALYSIS
- 11 PRACTICAL DYNAMIC TAINT ANALYSIS WITH LIBDFT
- 12 PRINCIPLES OF SYMBOLIC EXECUTION
- 13 PRACTICAL SYMBOLIC EXECUTION WITH TRITON
- PART IV: APPENDIXES
- A A CRASH COURSE ON X86 ASSEMBLY
-
B IMPLEMENTING PT_NOTE OVERWRITING USING LIBELF
- B.1 Required Headers
- B.2 Data Structures Used in elfinject
- B.3 Initializing libelf
- B.4 Getting the Executable Header
- B.5 Finding the PT_NOTE Segment
- B.6 Injecting the Code Bytes
- B.7 Aligning the Load Address for the Injected Section
- B.8 Overwriting the .note.ABI-tag Section Header
- B.9 Setting the Name of the Injected Section
- B.10 Overwriting the PT_NOTE Program Header
- B.11 Modifying the Entry Point
- C LIST OF BINARY ANALYSIS TOOLS
- D FURTHER READING
- INDEX
Product information
- Title: Practical Binary Analysis
- Author(s):
- Release date: December 2018
- Publisher(s): No Starch Press
- ISBN: 9781593279127
You might also like
book
A Common-Sense Guide to Data Structures and Algorithms, Second Edition, 2nd Edition
Algorithms and data structures are much more than abstract concepts. Mastering them enables you to write …
book
Introducing Python, 2nd Edition
Easy to understand and fun to read, this updated edition of Introducing Python is ideal for …
book
Serious Cryptography
"This practical guide to modern encryption breaks down the fundamental mathematical concepts at the heart of …
book
Fundamentals of Data Engineering
Data engineering has grown rapidly in the past decade, leaving many software engineers, data scientists, and …