Learning Linux Binary Analysis

Uncover the secrets of Linux binary analysis with this handy guide
Preview in Mapt

Learning Linux Binary Analysis

Ryan "elfmaster" O'Neill

2 customer reviews
Uncover the secrets of Linux binary analysis with this handy guide
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning Linux Binary Analysis Book Cover
Learning Linux Binary Analysis
$ 35.99
$ 25.20
R: Recipes for Analysis, Visualization and Machine Learning Book Cover
R: Recipes for Analysis, Visualization and Machine Learning
$ 71.99
$ 50.40
Buy 2 for $35.00
Save $72.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781782167105
Paperback282 pages

Book Description

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.

Table of Contents

Chapter 1: The Linux Environment and Its Tools
Linux tools
Useful devices and files
Linker-related environment points
Summary
Chapter 2: The ELF Binary Format
ELF file types
ELF program headers
ELF section headers
ELF symbols
ELF relocations
ELF dynamic linking
Coding an ELF Parser
Summary
Chapter 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
Chapter 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
ELF anti-debugging and packing techniques
ELF virus detection and disinfection
Summary
Chapter 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
Chapter 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
Chapter 7: Process Memory Forensics
What does a process look like?
Process memory infection
Detecting the ET_DYN injection
Linux ELF core files
Summary
Chapter 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
Chapter 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

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

Authors

Table of Contents

Chapter 1: The Linux Environment and Its Tools
Linux tools
Useful devices and files
Linker-related environment points
Summary
Chapter 2: The ELF Binary Format
ELF file types
ELF program headers
ELF section headers
ELF symbols
ELF relocations
ELF dynamic linking
Coding an ELF Parser
Summary
Chapter 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
Chapter 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
ELF anti-debugging and packing techniques
ELF virus detection and disinfection
Summary
Chapter 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
Chapter 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
Chapter 7: Process Memory Forensics
What does a process look like?
Process memory infection
Detecting the ET_DYN injection
Linux ELF core files
Summary
Chapter 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
Chapter 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

Book Details

ISBN 139781782167105
Paperback282 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Arch Linux Environment Setup How-to Book Cover
Arch Linux Environment Setup How-to
$ 9.99
$ 7.00
Python Network Programming Cookbook Book Cover
Python Network Programming Cookbook
$ 26.99
$ 18.90
Linux Shell Scripting Cookbook, Second Edition Book Cover
Linux Shell Scripting Cookbook, Second Edition
$ 26.99
$ 5.40
Mastering Embedded Linux Programming Book Cover
Mastering Embedded Linux Programming
$ 39.99
$ 28.00