Book description
Uncover the secrets of Linux binary analysis with this handy guide
About This Book
- Grasp the intricacies of the ELF binary format of UNIX and Linux
- Design tools for reverse engineering and binary forensic analysis
- Insights into UNIX and Linux memory infections, ELF viruses, and binary protection schemes
Who This Book Is For
If you are a software engineer or reverse engineer and want to learn more about Linux binary analysis, this book will provide you with all you need to implement solutions for binary analysis in areas of security, forensics, and antivirus. This book is great for both security enthusiasts and system level engineers. Some experience with the C programming language and the Linux command line is assumed.
What You Will Learn
- Explore the internal workings of the ELF binary format
- Discover techniques for UNIX Virus infection and analysis
- Work with binary hardening and software anti-tamper methods
- Patch executables and process memory
- Bypass anti-debugging measures used in malware
- Perform advanced forensic analysis of binaries
- Design ELF-related tools in the C language
- Learn to operate on memory with ptrace
In Detail
Learning Linux Binary Analysis is packed with knowledge and code that will teach you the inner workings of the ELF format, and the methods used by hackers and security analysts for virus analysis, binary patching, software protection and more.
This book will start by taking you through UNIX/Linux object utilities, and will move on to teaching you all about the ELF specimen. You will learn about process tracing, and will explore the different types of Linux and UNIX viruses, and how you can make use of ELF Virus Technology to deal with them.
The latter half of the book discusses the usage of Kprobe instrumentation for kernel hacking, code patching, and debugging. You will discover how to detect and disinfect kernel-mode rootkits, and move on to analyze static code. Finally, you will be walked through complex userspace memory infection analysis.
This book will lead you into territory that is uncharted even by some experts; right into the world of the computer hacker.
Style and approach
The material in this book provides detailed insight into the arcane arts of hacking, coding, reverse engineering Linux executables, and dissecting process memory. In the computer security industry these skills are priceless, and scarce. The tutorials are filled with knowledge gained through first hand experience, and are complemented with frequent examples including source code.
Table of contents
-
Learning Linux Binary Analysis
- Table of Contents
- Learning Linux Binary Analysis
- Credits
- About the Author
- Acknowledgments
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. The Linux Environment and Its Tools
- 2. The ELF Binary Format
-
3. Linux Process Tracing
- The importance of ptrace
- ptrace requests
- The process register state and flags
- A simple ptrace-based debugger
- A simple ptrace debugger with process attach capabilities
- Advanced function-tracing software
- ptrace and forensic analysis
- Process image reconstruction – from the memory to the executable
- Code injection with ptrace
- Simple examples aren't always so trivial
- Demonstrating the code_inject tool
- A ptrace anti-debugging trick
- Summary
-
4. ELF Virus Technology – Linux/Unix Viruses
- ELF virus technology
- ELF virus engineering challenges
- ELF virus parasite infection methods
- The PT_NOTE to PT_LOAD conversion infection method
- Infecting control flow
-
Process memory viruses and rootkits – remote code injection techniques
- Shared library injection – .so injection/ET_DYN injection
- .so injection with LD_PRELOAD
- .so injection with open()/mmap() shellcode
- .so injection with dlopen() shellcode
- .so injection with VDSO manipulation
- Text segment code injections
- Executable injections
- Relocatable code injection – the ET_REL injection
- ELF anti-debugging and packing techniques
- ELF virus detection and disinfection
- Summary
-
5. Linux Binary Protection
- ELF binary packers – dumb protectors
- Stub mechanics and the userland exec
- Other jobs performed by protector stubs
- Existing ELF binary protectors
- Downloading Maya-protected binaries
- Anti-debugging for binary protection
- Resistance to emulation
- Obfuscation methods
- Protecting control flow integrity
- Other resources
- Summary
-
6. ELF Binary Forensics in Linux
- The science of detecting entry point modification
- Detecting other forms of control flow hijacking
- Identifying parasite code characteristics
- Checking the dynamic segment for DLL injection traces
- Identifying reverse text padding infections
- Identifying text segment padding infections
- Identifying protected binaries
- IDA Pro
- Summary
-
7. Process Memory Forensics
- What does a process look like?
- Process memory infection
-
Detecting the ET_DYN injection
- Azazel userland rootkit detection
- Mapping out the process address space
- Finding LD_PRELOAD on the stack
- Detecting PLT/GOT hooks
- ET_DYN injection internals
- Manipulating VDSO to perform dirty work
- Shared object loading – legitimate or not?
- Heuristics for .so injection detection
- Tools for detecting PLT/GOT hooks
- Linux ELF core files
- Summary
-
8. ECFS – Extended Core File Snapshot Technology
- History
- The ECFS philosophy
- Getting started with ECFS
- libecfs – a library for parsing ECFS files
- readecfs
- Examining an infected process using ECFS
- The ECFS reference guide
- Process necromancy with ECFS
- Learning more about ECFS
- Summary
-
9. Linux /proc/kcore Analysis
- Linux kernel forensics and rootkits
- stock vmlinux has no symbols
- /proc/kcore and GDB exploration
- Direct sys_call_table modifications
- Kprobe rootkits
- Debug register rootkits – DRR
- VFS layer rootkits
- Other kernel infection techniques
- vmlinux and .altinstructions patching
- Using taskverse to see hidden processes
- Infected LKMs – kernel drivers
- Notes on /dev/kmem and /dev/mem
- /dev/mem
- K-ecfs – kernel ECFS
- Kernel hacking goodies
- Summary
- Index
Product information
- Title: Learning Linux Binary Analysis
- Author(s):
- Release date: February 2016
- Publisher(s): Packt Publishing
- ISBN: 9781782167105
You might also like
book
Linux System Programming
This book is about writing software that makes the most effective use of the system you're …
book
Linux System Programming, 2nd Edition
Write software that draws directly on services offered by the Linux kernel and core system libraries. …
video
Linux Fundamentals
The second edition of this video title is available. Please go to Linux Fundamentals, 2nd Edition …
book
Mastering Embedded Linux Programming - Second Edition
Master the techniques needed to build great, efficient embedded devices on Linux About This Book Discover …