Book Image

Penetration Testing with Raspberry Pi - Second Edition

By : Michael McPhee, Jason Beltrame
Book Image

Penetration Testing with Raspberry Pi - Second Edition

By: Michael McPhee, Jason Beltrame

Overview of this book

This book will show you how to utilize the latest credit card sized Raspberry Pi 3 and create a portable, low-cost hacking tool using Kali Linux 2. You’ll begin by installing and tuning Kali Linux 2 on Raspberry Pi 3 and then get started with penetration testing. You will be exposed to various network security scenarios such as wireless security, scanning network packets in order to detect any issues in the network, and capturing sensitive data. You will also learn how to plan and perform various attacks such as man-in-the-middle, password cracking, bypassing SSL encryption, compromising systems using various toolkits, and many more. Finally, you’ll see how to bypass security defenses and avoid detection, turn your Pi 3 into a honeypot, and develop a command and control system to manage a remotely-placed Raspberry Pi 3. By the end of this book you will be able to turn Raspberry Pi 3 into a hacking arsenal to leverage the most popular open source toolkit, Kali Linux 2.0.
Table of Contents (13 chapters)
Penetration Testing with Raspberry Pi - Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Cloning the Raspberry Pi SD card


We recommend backing up the original system software that came with our Raspberry Pi before formatting it for a Kali Linux installation. Most Raspberry Pi microSD cards come with a form of NOOBS that contains various operating system options from which you can select our primary operating system. Hopefully, we took our own advice earlier and copied the default files that came on our microSD card to another location. If so, we can just copy them back to the SD card. But, if we didn't copy those files off, we can download the NOOBS software again from the following URL if needed:

https://www.raspberrypi.org/downloads/

One of the best use cases for cloning is to create a gold image of Kali Linux for our Raspberry Pi. Once we have that image all set, we can clone that image to use on other microSD cards. In our example, we will copy our gold image to a file named raspberrypi.img.

The cloning process for our SD card is very simple. Many Windows utilities, such as Win32 Disk Imager, which was covered earlier in the chapter, will make an exact copy of the SD card. On a Mac, we can open a command prompt to identify our SD card and type the diskutil list command:

In the preceding screenshot, our microSD card is /dev/disk2. On another system, our microSD card might be different than in this example, so we'll need to make sure to verify naming for each setup. We can clone our card by creating a disk image and saving it to the desktop. We will issue the following command to accomplish this task:

sudo dd if=/dev/disk2 of=raspberrypi.img

The following screenshot shows how we had to enter our password before the command would execute:

It can take 30 minutes or more to clone an SD card. The speed of creating the image will depend on the size and speed of the microSD card, the amount of data on it, the speed of the copying computer, and the block size we specify. In other words, we will need to be patient and let it copy.

Tip

You may experience a permission denied error when you write the image to the microSD card on OS X systems if you do not include the sudo comma.