O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Penetration Testing with Raspberry Pi - Second Edition

Book Description

Learn the art of building a low-cost, portable hacking arsenal using Raspberry Pi 3 and Kali Linux 2

About This Book

  • Quickly turn your Raspberry Pi 3 into a low-cost hacking tool using Kali Linux 2
  • Protect your confidential data by deftly preventing various network security attacks
  • Use Raspberry Pi 3 as honeypots to warn you that hackers are on your wire

Who This Book Is For

If you are a computer enthusiast who wants to learn advanced hacking techniques using the Raspberry Pi 3 as your pentesting toolbox, then this book is for you. Prior knowledge of networking and Linux would be an advantage.

What You Will Learn

  • Install and tune Kali Linux 2 on a Raspberry Pi 3 for hacking
  • Learn how to store and offload pentest data from the Raspberry Pi 3
  • Plan and perform man-in-the-middle attacks and bypass advanced encryption techniques
  • Compromise systems using various exploits and tools using Kali Linux 2
  • Bypass security defenses and remove data off a target network
  • Develop a command and control system to manage remotely placed Raspberry Pis
  • Turn a Raspberry Pi 3 into a honeypot to capture sensitive information

In Detail

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.

Style and approach

This concise and fast-paced guide will ensure you get hands-on with penetration testing right from the start. You will quickly install the powerful Kali Linux 2 on your Raspberry Pi 3 and then learn how to use and conduct fundamental penetration techniques and attacks.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Penetration Testing with Raspberry Pi - Second Edition
    1. Penetration Testing with Raspberry Pi - Second Edition
    2. Credits
    3. About the Authors
    4. About the Reviewers
    5. www.PacktPub.com
      1. Why subscribe?
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    7. 1. Choosing a Pen Test Platform
      1. Hardware options and why the Pi
      2. Software option and why Kali
      3. Purchasing a Raspberry Pi
      4. Assembling a Raspberry Pi
      5. Installing Kali Linux
      6. Combining Kali Linux and the Raspberry Pi
      7. Cloning the Raspberry Pi SD card
      8. Avoiding common problems
      9. Summary
    8. 2. Preparing for Battle
      1. The Command and Control server
      2. Preparing for a penetration test
      3. Setting up the SSH service
      4. SSH default keys and management
      5. Reverse shell through SSH
      6. SSL tunnelling
        1. stunnel
          1. Server
          2. Client
        2. ncat
        3. ptunnel and other techniques
      7. Using the GUI
        1. Transporting X via SSH
        2. VNC and RDP
      8. Overclocking
      9. Setting up the wireless interface
      10. Setting up the Bluetooth interface
      11. Setting up a 3G or 4G modem
      12. Wrapping it up with an example
    9. 3. Planning the Attack
      1. Understanding the Cyber or Intrusion Kill Chain
        1. Reconnaissance
        2. Weaponization
        3. Delivery
        4. Exploitation
        5. Installation
        6. Command and Control
        7. Actions
      2. Preparing for the penetration test
      3. Common tools for web, wired, and wireless attacks
      4. Mapping our tools to the Penetration test Kill Chain
        1. Addition of non-standard tools to arsenal
        2. Positioning the Pi
      5. Summary
    10. 4. Explore the Target - Recon and Weaponize
      1. Prospecting the target
      2. Network scanning
      3. Seeing and cracking Wi-Fi
        1. Obtaining the key
        2. Cracking the key
      4. Capturing and cracking passwords
        1. Online cracking
        2. Offline cracking
      5. Getting data to the Pi
        1. Physically inline option
        2. Software based approach
          1. arpspoof (Part of dsniff)
          2. Ettercap
      6. Wireshark
      7. dsniff
      8. Firewalk
        1. Tuning our network capture
        2. Scripting tcpdump for future access
      9. Web application hacks
        1. DotDotPwn
      10. Driftnet
        1. W3af
      11. Summary
    11. 5. Taking Action - Intrude and Exploit
      1. Using the Metasploit framework to exploit targets
        1. Getting Recon data into Metasploit
        2. Scoping vectors and launching attacks
        3. Rolling our own exploits
        4. Wrapping payloads
      2. Social engineering
        1. The Social-Engineer Toolkit
        2. Phishing with BeEF
      3. Executing man-in-the-middle attacks
        1. SSLstrip
        2. parasite6
        3. Manipulating data
          1. Sniffing the network in Scapy
          2. Writing/reading PCAP files
          3. Creating/sending/receiving of packets
          4. Creating and sending malformed packets
          5. TCP SYN scan
      4. Rogue Access honeypot (revising and re-shooting)
        1. Easy-creds
      5. Bluetooth testing
        1. Bluelog
        2. Blueranger
        3. Btscanner
        4. Connecting to Bluetooth device using bluetoothctl
      6. Summary
    12. 6. Finishing the Attack - Report and Withdraw
      1. Covering our tracks
        1. Wiping logs
      2. Masking our network footprint
        1. Using ProxyChains
        2. Clearing the data off the Raspberry Pi
      3. Developing reports
        1. Collecting and correlating testing data
        2. Creating screenshots
          1. Using ImageMagick
          2. GIMP, Screenshot, and Shutter
      4. Moving data
        1. Compressing files with Zip/Unzip
          1. Using File Roller
          2. Using split
      5. Summary
    13. 7. Alternative Pi Projects
      1. Diving into PwnPi
      2. Discovering Raspberry Pwn
      3. Investigating PwnBerry Pi
      4. Defending your network
        1. Intrusion detection and prevention
          1. Exploring Snort
        2. Content filtering
          1. GateSentry as a content filtering option
        3. Remote access with OpenVPN
          1. Server installation
          2. Server Certificate Authority setup
          3. Server configuration and startup
          4. Client-Configuration and Startup
        4. Tor networking
          1. Raspberry Tor
          2. Tor Exit node or router
      5. Running Raspberry Pi on your PC with QEMU emulator
      6. Running Windows 10 on Raspberry Pi 3
      7. Other popular use cases for the Raspberry Pi
        1. Raspberry Weather
        2. PiAware
        3. PiPlay
        4. PrivateEyePi
      8. Summary