Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Fuzzing Against the Machine
Fuzzing Against the Machine

Fuzzing Against the Machine: Automate vulnerability research with emulated IoT devices on QEMU

Arrow left icon
Profile Icon Antonio Nappa Profile Icon Eduardo Blázquez
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (15 Ratings)
Paperback May 2023 238 pages 1st Edition
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Antonio Nappa Profile Icon Eduardo Blázquez
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (15 Ratings)
Paperback May 2023 238 pages 1st Edition
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Fuzzing Against the Machine

Who This Book is For

Do you hear that, Mr. Anderson? That is the sound of inevitability.” This is a famous phrase from the action movie The Matrix. We refer to this sound as Moore’s law. The constant and inevitable miniaturization of circuits has paved the way for the birth of thousands and thousands of new devices, all equipped with sensors, multiple connections, and operating systems. So, how can a vulnerability researcher cope with so many devices, firmware, and standards?

Owning devices is both expensive and logistically unfeasible – for example, the birth of emulators such as Bleem! In the 90s, emulating the PlayStation on a PC was surely a cheaper option than buying the console, and you could do everything on the same PC.

Nowadays, it is clear that there is a lot of space for doing vulnerability research about any kind of device. Pioneering research was done in the first decade of this century. Tools such as Quick Emulator (QEMU), PANDA, Avatar, and Avatar2 were created. They allow you to control an emulated device and interface it with simulated sensors or real ones. They do not offer 100% functionality and full code reachability for obvious reasons (they don’t replace a real device). Though, over the years, it has been demonstrated that it is possible to find vulnerabilities by emulating a real device stepping through its execution with a debugger attached through a JTAG port.

Still, if we decide to analyze a medium-sized corpus of devices, reversing the firmware code or reading the source code takes a lot of time. Hence, using a fuzzer on the interfaces that are dependent on inputs coming from the user, for instance, may stimulate anomalous behaviors that are easier to backtrack, instead of hunting for them directly.

We will not be able to cope with all devices, interfaces, and protocols, and this is outside the scope of this book. Our aim here is to provide you with the necessary toolkit to understand the process of emulating firmware and hooking it to a fuzzer to trigger anomalous conditions. The examples have been carefully picked to help you understand the process and enable you to adapt the concepts autonomously to new firmware.

In this chapter, we will cover the following topics:

  • Who is this book for?
  • A custom journey
  • Getting a primer
  • Jumping into the dirt

Who is this book for?

Passion, curiosity, and hard work – these are the main drivers for embarking on a journey through two techniques that have become fundamental to security research.

Regardless of whether you are an expert or not, this book is designed to help any kind of reader. We have designed two different paths that can be taken according to your level of experience. To keep you motivated, we have made the effort to provide you with examples, additional material, and useful information to help you foresee the end of every section, chapter, and ultimately this entire book.

Q1 – do you want to start a career in cybersecurity?

Internet of things (IoT) – does this phrase sound familiar now? After years of such claims, we are living in a period where many platforms are connected to our network. From voice assistants to vacuum cleaning robots, smart light bulbs, smart ovens, dishwashers, and, of course, smartphones. So, as software security researchers, how is it possible to analyze all these platforms, firmware, and software stacks?

One of the best candidates that will allow us to avoid buying all these devices is QEMU. QEMU will be our reference platform to embark on a journey into vulnerability research. The reason for our choice is motivated by the fact that QEMU can emulate many platforms and it’s a mature and modular project. Emulation is a great technique for using general-purpose computers (x86) to run any kind of software and firmware. Imagine you want to test an X-ray machine but the entire object doesn’t fit in your room. How would you proceed? For instance, you can get the firmware and emulate its interfaces, fuzz them, and make it crash, crash, crash.

Q2 – are you a passionate programmer? Hobbyist? Tinkerer?

Don’t get afraid of the words emulation, fuzzing, exploit, and vulnerability. Soon, you will become familiar with them. We suggest that you read this book from start to finish and practice the easiest examples. Then, try the most challenging ones.

Q3 – are you a hardened cybersecurity expert?

You are probably the kind of TLDR learner who looks directly at the code snippets in Stack Overflow (https://stackoverflow.com/questions/44991703/a-buffer-overflow-exercise-using-a-shellcode), without even reading the question. Our suggestion is to start from Part 2, Practical Examples, and follow along with all the examples.

Prerequisites

While this book tries to be as self-contained as possible, and the code snippets from the book will be commented, we recommend that you have a basic knowledge of the following topics:

  • The C programming language
  • The Linux operating system and general knowledge of operating systems
  • The Python scripting language
  • Embedded device functioning principles and electronics

A custom journey

This book has been designed to be in three self-contained parts – Foundations, Description of Emulation and Fuzzing, and Advanced Concepts – all of which include examples with famous open source firmware. The first part provides a deep and thoughtful understanding of emulation and fuzzing. These two techniques are extremely common and widespread in security research. Nonetheless, there are no reference books that talk about these matters in detail and help people start their journey toward understanding one of the most ancient and fascinating concepts in computer science, which is emulation. Fuzzing too is a very old technique, but it has become so sophisticated and advanced that evolutionary algorithms have been implemented to select the best inputs to trigger weird machine states and hunt for some vulnerabilities.

The second part has the hard task of gluing very ancient concepts together with everyday reality. 80 years in computer science are probably comparable to millions of years in biology if you think about circuit miniaturization as a reference point. For that reason, in the second part of this book, we will deep-dive into practical examples where we will use the main tools from this book to get in touch with the world of vulnerability analysis of IoT devices with fuzzing techniques. While this is just an introduction, you will grasp the main concepts, and you will be able to practice these concepts with the proposed exercises.

Finally, in the third part of this book, we will guide you through real examples of fuzzing IoT devices. Here, you will learn how to configure the tools to work with emulated hardware, such as the iPhone 11, and how to use emulation with the corresponding configuration to fuzz this machine to look for vulnerabilities. Once we find possible attack vectors (possible vulnerabilities found by the fuzzer), we will learn how to exploit them using the tools professionals use to search for and exploit those vulnerabilities (for example, disassemblers, and debuggers).

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the vulnerability landscape and useful tools such as QEMU and AFL
  • Explore use cases to find vulnerabilities and execute unknown firmware
  • Create your own firmware emulation and fuzzing environment to discover vulnerabilities
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Emulation and fuzzing are among the many techniques that can be used to improve cybersecurity; however, utilizing these efficiently can be tricky. Fuzzing Against the Machine is your hands-on guide to understanding how these powerful tools and techniques work. Using a variety of real-world use cases and practical examples, this book helps you grasp the fundamental concepts of fuzzing and emulation along with advanced vulnerability research, providing you with the tools and skills needed to find security flaws in your software. The book begins by introducing you to two open source fuzzer engines: QEMU, which allows you to run software for whatever architecture you can think of, and American fuzzy lop (AFL) and its improved version AFL++. You’ll learn to combine these powerful tools to create your own emulation and fuzzing environment and then use it to discover vulnerabilities in various systems, such as iOS, Android, and Samsung's Mobile Baseband software, Shannon. After reading the introductions and setting up your environment, you’ll be able to dive into whichever chapter you want, although the topics gradually become more advanced as the book progresses. By the end of this book, you’ll have gained the skills, knowledge, and practice required to find flaws in any firmware by emulating and fuzzing it with QEMU and several fuzzing engines.

Who is this book for?

This book is for security researchers, security professionals, embedded firmware engineers, and embedded software professionals. Learners interested in emulation, as well as software engineers interested in vulnerability research and exploitation, software testing, and embedded software development will also find it useful. The book assumes basic knowledge of programming (C and Python); operating systems (Linux and macOS); and the use of Linux shell, compilation, and debugging.

What you will learn

  • Understand the difference between emulation and virtualization
  • Discover the importance of emulation and fuzzing in cybersecurity
  • Get to grips with fuzzing an entire operating system
  • Discover how to inject a fuzzer into proprietary firmware
  • Know the difference between static and dynamic fuzzing
  • Look into combining QEMU with AFL and AFL++
  • Explore Fuzz peripherals such as modems
  • Find out how to identify vulnerabilities in OpenWrt

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 19, 2023
Length: 238 pages
Edition : 1st
Language : English
ISBN-13 : 9781804614976
Category :
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : May 19, 2023
Length: 238 pages
Edition : 1st
Language : English
ISBN-13 : 9781804614976
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 101.97
Data Science for Malware Analysis
€25.99
Fuzzing Against the Machine
€37.99
Burp Suite Cookbook
€37.99
Total 101.97 Stars icon

Table of Contents

17 Chapters
Part 1: Foundations Chevron down icon Chevron up icon
Chapter 1: Who This Book is For Chevron down icon Chevron up icon
Chapter 2: History of Emulation Chevron down icon Chevron up icon
Chapter 3: QEMU From the Ground Chevron down icon Chevron up icon
Part 2: Emulation and Fuzzing Chevron down icon Chevron up icon
Chapter 4: QEMU Execution Modes and Fuzzing Chevron down icon Chevron up icon
Chapter 5: A Famous Refrain: AFL + QEMU = CVEs Chevron down icon Chevron up icon
Chapter 6: Modifying QEMU for Basic Instrumentation Chevron down icon Chevron up icon
Part 3: Advanced Concepts Chevron down icon Chevron up icon
Chapter 7: Real-Life Case Study: Samsung Exynos Baseband Chevron down icon Chevron up icon
Chapter 8: Case Study: OpenWrt Full-System Fuzzing Chevron down icon Chevron up icon
Chapter 9: Case Study: OpenWrt System Fuzzing for ARM Chevron down icon Chevron up icon
Chapter 10: Finally Here: iOS Full System Fuzzing Chevron down icon Chevron up icon
Chapter 11: Deus Ex Machina: Fuzzing Android Libraries Chevron down icon Chevron up icon
Chapter 12: Conclusion and Final Remarks Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(15 Ratings)
5 star 66.7%
4 star 20%
3 star 13.3%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




c Aug 17, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Well written and easy to understand with plenty of history provided along with practical examples. Multiple tracks are present in the book based on your level of expertise. Great reference and guide.
Amazon Verified review Amazon
GUNDERSTONE Jun 04, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
"Fuzzing Against the Machine: Automate vulnerability research with emulated IoT devices on QEMU" is a comprehensive guide to understanding and utilizing the powerful tools of emulation and fuzzing in cybersecurity. This book, by Antonio Nappa and Eduardo Blázquez, provides practical examples and real-world use cases to help them grasp the fundamental concepts of fuzzing and emulation and advanced vulnerability research.This book's intended audience is security researchers, embedded firmware and software professionals, and learners interested in emulation. It is also helpful for those involved in vulnerability research and exploitation, software testing, and embedded software development. Basic knowledge of programming (C and Python), operating systems (Linux and macOS), and Linux shell usage, compilation, and debugging is assumed.To gain a complete comprehension of topics within this book, readers should have prior knowledge in the following areas:• General understanding of operating systems, particularly those that are POSIX-compliant• Familiarity with the C and Python programming languages• Basic knowledge of embedded devices and electronicsThe primary audience is early-career cybersecurity researchers or students seeking hands-on experience with fuzzing-embedded software. However, curious readers are also welcome to continue reading. Please refer to the following section, 'To get the most out of this book,' for more information."The book is divided into three main sections: Introduction, Fuzzing, and Emulation. An overview of the book's contents is provided in the Introduction section and an explanation of why these techniques are essential in cybersecurity. The authors stress the need for hands-on experience with these tools, which is part of what this book provides.The Fuzzing section covers everything from basic concepts to advanced techniques. It starts with explaining what fuzzing is and how it works, then moves on to cover topics such as mutation-based fuzzing, coverage-guided fuzzing, and black-box fuzzing. The authors provide practical examples throughout this section to help readers understand how these techniques can be applied in real-world scenarios.The Emulation section focuses on using emulated IoT devices for vulnerability research. It goes through topics such as setting up a virtual environment using QEMU, creating custom firmware images for emulated devices, and using emulated devices for network analysis. This section also includes practical examples to help readers understand how to apply these techniques in their work.The book excels in providing practical examples. The authors provide step-by-step instructions for setting up virtual environments and running tests using various tools. They also include screenshots and code snippets throughout the book to help readers visualize their learning.Another strength of this book is its clear writing style. The authors explain complex concepts in a way that is easy to understand without sacrificing technical accuracy. They also provide definitions for key terms throughout the book, making it accessible even to readers who are new to cybersecurity."Fuzzing Against the Machine" is an excellent resource for anyone interested in cybersecurity, particularly those looking to improve their vulnerability research skills. The book's focus on practical examples and clear writing style make it easy to understand and apply the concepts covered. Regardless of your level of expertise in cybersecurity, this book offers valuable insights and methods applicable to your work.
Amazon Verified review Amazon
Michael Gates Jun 15, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
“Fuzzing Against the Machine” is a good book for learning practical applications of emulation, specifically QEMU, and fuzzing various systems in it. The authors explain the concepts in a way that even someone new to cybersecurity can follow along and understand. The code snippets are definitely helpful, but make sure you get the free pdf that’s included at the end of the book so you can copy and paste if you need to!This book is a must read for any cybersecurity professionals who want to enhance their bug hunting skill set but aren’t very familiar with emulating IoT systems or the tools required for fuzzing them.
Amazon Verified review Amazon
Dwayne Natwick Jun 03, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Emulation and simulation of potential attacks is a common tactic to learn vulnerabilities and determine ways to decrease attack surfaces. One of these methods that is gaining popularity is fuzzing. Packt's Fuzzing Against the Machine from Antonio Nappa and Eduardo B. provides guidance and steps for performing these fuzzing emulations on IoT devices. It is an excellent practical guide for performing this vulnerability testing. A must have for anyone that is working to research their cybersecurity protection for these devices.
Amazon Verified review Amazon
Rodrigo Rubira Branco Jun 10, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I usually do not write reviews for books. A book is so personal, there are so many reasons why someone is interested in a given content, and so many ways to approach it. But this book was in my read list and when Packt folks approached me asking for an opinion, I thought it was a chance to help both the authors and the interested readers.The way I see it, this book replaces a full week of training on the topic. With the advantage that you are able to take it at your own pace. It has plenty of practical examples, with just enough introductory theory (the theory is highly condensed, so even in 'deep dives' we are talking about only a few pages). And then practical examples and use-cases. The reading is not boring at all, and one can easily follow what is going on thru the text, since the content and outputs are there (and later do it themselves).There are just two (very minimal) down-sides to the book: one is that when you condense the theory so much, there will be gaps. And the other is that references are provided across the book and not organized in a section per chapter. The former IMHO, is actually totally fine and even ideal for the book objectives which is to give hands-on experience on the topic. Anyone interested in diving deep on the theoretical aspects can easily follow other references to do so. The balance and compromises chosen by the authors are great. The later issue (about references) is really a matter of preferences (there are plenty of references, they are just not easy to view altogether, one has to read thru and collect them as they go).For folks that have been doing the work for a long time, the book is valuable to cover different use-cases, making sure one is aware of other tricks (and it is a fast read, therefore worth it). For folks that are just starting, the book is excellent to give then a practical start, with plenty of opportunity to continue from there.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.