Raspberry Pi for Secret Agents - Third Edition

Book description

Turn your Raspberry Pi into a secret agent toolbox with this set of exciting projects

About This Book

  • Turn your Raspberry Pi into a multi-purpose secret agent gadget for audio and video surveillance, Wi-Fi exploration, or playing pranks on your friends
  • Detect an intruder on camera or with sensors and set off an alarm or receive messages to your phone
  • Find out what the other computers on your network are up to and make yourself anonymous on the Internet
  • This book has been updated for new additions to your toolkit featuring the tiny, recently released Raspberry Pi Zero board

Who This Book Is For

This book is for those who are new to the Raspberry Pi Zero ,Raspberry Pi 2 or Raspberry Pi 3 and have some experience with the original Raspberry Pi models, and even for those budding secret agents who would like to use Pi Zero as a secret agent toolbox. No programming experience is assumed. Suitable for the novice and expert alike, each topic provides a fast and easy way to get started with exciting applications, with practical examples in every chapter.

What You Will Learn

  • Install and configure the Raspbian Jessie operating system for maximum mischief
  • Detect an intruder with motion detection or a laser trip wire and set off an alarm
  • Listen in to conversations from a distance over Bluetooth
  • Distort your voice in weird and wonderful ways
  • Track the Pi's whereabouts using GPS
  • Connect your Pi to the mobile Internet using a 3G dongle and make yourself anonymous on the net
  • Display secret messages and codes to fellow agents on a LED display

In Detail

This book is for all mischievous Raspberry Pi owners who'd like to see their computer transform into a neat spy gadget to be used in a series of practical pranks and projects. No previous skills are required to follow along, and if you're completely new to Linux, you'll pick up much of the basics for free.

We'll help you set up your Raspberry Pi Zero , Raspberry Pi 2 and Raspberry Pi 3 and guide you through a number of pranks and secret agent techniques that are so inconspicuous yet high on mischief. You'll learn how to configure your operating system for maximum mischief and start exploring audio, video, or Wi-Fi techniques. We'll show you how to record, listen, or talk to people from a distance and how to set up your own phone network. Then, you'll plug in your webcam and set up a motion detector with an alarm and find out what the other computers on your Wi-Fi network are up to. Once you've mastered the techniques, we'll combine them with a battery pack and GPS for the ultimate off-road spy kit.

Style and Approach

This easy-to-follow guide is for budding secret agents who want to create tools for mischief, stealth, and reconnaissance. It's full of fun, practical examples and easy-to-follow recipes, guaranteeing maximum mischief for all skill levels.

Table of contents

  1. Raspberry Pi for Secret Agents - Third Edition
    1. Raspberry Pi for Secret Agents - Third Edition
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Why subscribe?
      2. Free access for Packt account holders
    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. Getting up to No Good
      1. A brief history lesson on the Pi
        1. Raspberry Pi Model A
        2. Raspberry Pi Model B
        3. Raspberry Pi Model B+
        4. Raspberry Pi Model 2
        5. Raspberry Pi Zero
      2. Raspberry Pi 3
        1. So, which Pi for us spies?
        2. Where to buy a Pi
      3. The ins and outs of the Raspberry Pi
        1. GPIO headers
        2. Audio/Video jack
        3. Status LEDs
        4. USB
        5. Ethernet port
        6. CSI camera connector
        7. Display Serial Interface
        8. HDMI
        9. Power
        10. MicroSD card
          1. Preparing the SD card
        11. Download the Raspbian image
        12. Using Microsoft Windows
        13. Using Linux
        14. Boot up your Pi
        15. Expand the filesystem
          1. Goodbye GUI
          2. Using the raspi-config utility
      4. Setting up your Pi
      5. The importance of a sneaky headless setup
      6. Keeping your system up to date
      7. Backing up your SD card
        1. Complete SD card backup in Windows
        2. Complete SD card backup in MAC OS X
        3. Complete SD card backup in Linux
      8. Summary
    8. 2. Audio Antics
      1. Configuring your audio gadgets
        1. Sound variations
        2. Introducing the ALSA sound system
        3. Controlling the volume
        4. Switching between HDMI and analog audio output
        5. Testing the speakers
        6. Preparing to record
        7. Testing the microphone
        8. Clipping, feedback distortion, and improving sound quality
      2. Recording conversations for later retrieval
        1. Writing to a WAV file
        2. Writing to an MP3 or OGG file
        3. Creating command shortcuts with aliases
        4. Keep your recordings running safely with tmux
      3. Making a covert wearable recorder with Pi Zero
      4. Listening in on conversations from a distance
        1. Listening in Windows
        2. Listening in Mac OS X or Linux
      5. Listening in over Bluetooth
        1. Introducing Bluetooth audio
        2. Setting up Bluetooth on the Pi
        3. Installing PulseAudio
        4. Connect to your Bluetooth headset or speaker
        5. Bluetooth by default
      6. Talking to people from a distance
        1. Talking in Windows
        2. Talking in Mac OS X or Linux
        3. Attention Mac users
        4. Talking in Bluetooth
      7. Distorting your voice in weird and wonderful ways
      8. Make your computer do the talking
      9. Scheduling your audio actions
        1. Start on power up
        2. Scheduled start
        3. Controlling recording length
        4. Start recording with noise detection
      10. Calling your fellow agents
        1. Setting up SIP Witch
          1. Connecting the softphones
        2. Windows (MicroSIP)
        3. Configuring the MicroSIP softphone for Windows
        4. Mac OS X (Telephone)
        5. Linux (Ring)
        6. Android (CSipSimple)
        7. iPhone/iPad (Linphone)
        8. Running a softphone on the Pi
          1. Encrypting SIP Witch passwords
          2. Setting up Linphone
          3. Playing files with Linphone
      11. Using your voice to control things
        1. Give your Pi some ears
      12. Bonus one-line sampler
      13. Summary
    9. 3. Webcam and Video Wizardry
      1. Meet the USB Video Class drivers and Video4Linux
      2. Raspberry Pi Camera Module
        1. Connecting the camera module
        2. Setting up the camera module
        3. Using USB cameras
        4. Connecting the webcam
        5. Finding out your webcam's capabilities
        6. Capturing your target on film
        7. Viewing your camera in VLC media player
          1. Viewing in Windows
          2. Viewing in Mac OS X
          3. Viewing in Linux
          4. Recording the video stream
          5. Recording in Windows
          6. Recording in Mac OS X
          7. Recording in Linux
        8. Detecting an intruder and setting off an alarm
          1. Creating a motion detection configuration
          2. Trying out Motion
          3. Collecting the evidence
          4. Viewing and e-mailing the evidence
        9. Hooking up more cameras
          1. Preparing a webcam stream in Windows
          2. Preparing a webcam stream in Mac OS X
          3. Configuring MotionEye for multiple input streams
        10. Watching your camera over the Internet
          1. The link between the Pi and the broadcasting service
        11. Night vision
      3. Make a covert wearable recorder with Pi Zero
      4. Turning your TV on or off using the Pi
        1. Scheduling a playback scare
      5. Summary
    10. 4. Wi-Fi Pranks – Exploring Your Network
      1. Getting an overview of all the computers on your network
        1. Monitoring Wi-Fi airspace with Kismet
          1. Preparing Kismet for launch
          2. First Kismet session
          3. Adding sound and speech
          4. Enabling rogue access point detection
        2. Mapping out your network with Nmap
      2. Finding out what the other computers are up to
        1. How encryption changes the game
        2. Traffic logging
        3. Shoulder surfing in Elinks
      3. Pushing unexpected images to browser windows
      4. Knocking all visitors off your network
      5. Protecting your network against Ettercap
      6. Analyzing packet dumps with Wireshark
        1. Running Wireshark in Windows
        2. Running Wireshark in Mac OS X
          1. Running Wireshark in Linux
          2. Exploring dynamic DNS, port forwarding, and tunneling
        3. Dynamic DNS
          1. Choosing your domain name
          2. Verifying your domain name
          3. Updating your domain name
        4. Port forwarding
          1. Adding the forwarding rule
          2. Verifying your port forwarding
          3. Port forwarding security
          4. Connected at last
        5. Tunneling
          1. Port tunneling in Windows
          2. Port tunneling in Linux or Mac OS X
      7. Creating a diversion using a chat bot
        1. Introducing XMPP
        2. Useful Profanity
          1. Connecting to Google chat
          2. Connecting to XMPP servers
          3. Getting around Profanity
          4. Project AgentBot
          5. Awakening the bot
      8. Keeping your conversations secret with encryption
      9. Summary
    11. 5. Taking Your Pi Off-Road
      1. Keeping the Pi dry and running with housing and batteries
      2. Setting up point-to-point networking
        1. Creating a direct wired connection
        2. Static IP assignment in Windows
        3. Static IP assignment in Mac OS X
        4. Static IP assignment in Linux
      3. Turning the Pi into a Wi-Fi hotspot
      4. Connecting the Pi to the mobile Internet
        1. Multiple personalities
        2. Switching modes
          1. Automatic mode-switching
      5. Be anonymous on the Internet
        1. Know your onions
        2. Setting up the Wi-Fi access point
        3. Installing and setting up a DHCP server
        4. Set up the routing tables
        5. Installing and setting up Tor
          1. Test your anonymity
      6. Tracking the Pi's whereabouts using GPS
        1. Tracking the GPS position on Google Earth
          1. Preparing a GPS beacon on the Pi
          2. Setting up Google Earth
          3. Setting up a GPS waypoint logger
          4. Mapping GPS data from Kismet
        2. Using GPS as a time source
        3. Setting up GPS on boot
      7. Controlling the Pi with your smartphone
        1. Android (Raspi SSH)
        2. iPhone/iPad (SSH Remote)
        3. Common remote control commands
      8. Receiving status updates from the Pi
        1. Tagging tweets with GPS coordinates
        2. Sending e-mail updates
          1. Installing and setting  up the SMTP client
          2. Sending attachments
        3. Scheduling regular updates
      9. Accessing your files from anywhere with Dropbox
      10. Keeping your data secret with encryption
      11. Erasing the Pi should it fall into the wrong hands
        1. Encrypting your home with eCryptfs
        2. Rigging the self-destruct mechanism
      12. Jam the airwaves with a Pi Zero
        1. Installing PiFm
        2. Broadcasting to the airwaves
      13. Summary
    12. 6. Detecting and Protecting Against Your Enemies
      1. Say hello to the GPIO
        1. Power connections
      2. Building a laser trip wire
        1. How it works
        2. Wiring it up
          1. Writing the detection script
        3. Protecting an entire area
        4. Wiring it up
        5. Implementing the detection script
      3. Sending alerts to your phone using SMS
        1. SMS gateway
          1. Sending messages through the API
      4. Use your phone as an access control device
        1. Probe Requests
        2. Scanning with tshark
      5. Displaying secret codes and messages
        1. Enabling the serial port
        2. Connecting the Pi-Lite
        3. Encoding our messages
          1. Writing the encoder script
          2. Sending our text to the display
      6. Better security with a true random number generator
        1. Kernel entropy pool
        2. Setting up our hardware RNG
          1. Enabling the hardware RNG in Raspbian Wheezy
          2. Enabling the hardware RNG in Raspbian Jessie
          3. Testing the hardware RNG
        3. Using the HWRNG for our entropy pool
        4. Exporting the HWRNG data to another Linux server
          1. Connecting the UART pins
          2. Transferring entropy to the serial port
          3. Receiving entropy on the server
      7. Summary
      8. Graduation

Product information

  • Title: Raspberry Pi for Secret Agents - Third Edition
  • Author(s): Matthew Poole
  • Release date: July 2016
  • Publisher(s): Packt Publishing
  • ISBN: 9781786463548