Book Image

Binary Analysis Cookbook

By : Michael Born
Book Image

Binary Analysis Cookbook

By: Michael Born

Overview of this book

Binary analysis is the process of examining a binary program to determine information security actions. It is a complex, constantly evolving, and challenging topic that crosses over into several domains of information technology and security. This binary analysis book is designed to help you get started with the basics, before gradually advancing to challenging topics. Using a recipe-based approach, this book guides you through building a lab of virtual machines and installing tools to analyze binaries effectively. You'll begin by learning about the IA32 and ELF32 as well as IA64 and ELF64 specifications. The book will then guide you in developing a methodology and exploring a variety of tools for Linux binary analysis. As you advance, you'll learn how to analyze malicious 32-bit and 64-bit binaries and identify vulnerabilities. You'll even examine obfuscation and anti-analysis techniques, analyze polymorphed malicious binaries, and get a high-level overview of dynamic taint analysis and binary instrumentation concepts. By the end of the book, you'll have gained comprehensive insights into binary analysis concepts and have developed the foundational skills to confidently delve into the realm of binary analysis.
Table of Contents (12 chapters)

Analyzing a Simple Reverse Shell

In the previous chapter, we analyzed a potentially malicious binary that opened a socket; bound that socket to the localhost on port 4444/TCP; listened; accepted connections; redirected the socket through standard in, out, and error; and then executed /bin/bash. While that's great and that recipe was a good introduction to analyzing malicious binaries, it's time we stepped it up a notch. Most systems nowadays run on 64-bit processors and malicious users often prefer to have a victim host connect back to a listening host they control. As a penetration tester myself, I prefer reverse connections whenever possible, especially if I have the command and control infrastructure set up effectively. Don't get me wrong, though—a bind shell payload still comes in handy once in a while.

Because my vision for this book is to present the...