Raspberry Pi for Secret Agents - Stefan Sjogelid - E-Book

Raspberry Pi for Secret Agents E-Book

Stefan Sjogelid

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Ever wished you could play around with all the neat gadgets your favorite spies use (like James Bond or Michael Westen)? With the introduction of the remarkable Raspberry Pi and a few USB accessories, anybody can now join in on the action.Discover how to turn your Raspberry Pi into a multipurpose secret agent tool! Through a series of fun, easy-to-follow projects you'll learn how to set up audio/video surveillance, explore your Wi-Fi network, play pranks on your friends, and even learn how to free your Raspberry Pi from the constraints of the wall socket.Raspberry Pi for Secret Agents starts out with the initial setup of your Raspberry Pi, guides you through a number of pranks and secret agent techniques, and then shows you how to apply what you've learned out in the real world.

Learn how to configure your operating system for maximum mischief and start exploring the audio, video, and Wi-Fi projects. Learn how to record, listen, or talk to people from a distance and how to distort your voice. You can even plug in your webcam and set up a motion detector with an alarm, or find out what the other computers on your Wi-Fi network are up to. Once you've mastered the techniques, combine them with a battery pack and GPS for the ultimate off-road spy kit.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 188

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Raspberry Pi for Secret Agents
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Up to No Good
A brief history lesson on the Pi
The ins and outs of the Raspberry Pi
GPIO
RCA video
Audio
LEDs
USB
LAN
HDMI
Power
SD card
Writing Raspbian OS to the SD card
Getting Raspbian
SD card image writing in Windows
SD card image writing in Mac OS X or Linux
Booting up and configuring Raspbian
Basic commands to explore your Pi
Accessing the Pi over the network using SSH
Wired network setup
Wi-Fi network setup
Connecting to the Pi from Windows
Connecting to the Pi from Mac OS X or Linux
The importance of a sneaky headless setup
Keeping your system up-to-date
Summary
2. Audio Antics
Configuring your audio gadgets
Introducing the ALSA sound system
Controlling the volume
Switching between HDMI and analog audio output
Testing the speakers
Preparing to record
Testing the microphone
Clipping, feedback distortion, and improving sound quality
Recording conversations for later retrieval
Writing to a WAV file
Writing to an MP3 or OGG file
Creating command shortcuts with aliases
Keep your recordings running safely with tmux
Listening in on conversations from a distance
Listening on Windows
Listening on Mac OS X or Linux
Talking to people from a distance
Talking on Windows
Talking on Mac OS X or Linux
Distorting your voice in weird and wonderful ways
Make your computer do the talking
Scheduling your audio actions
Start on power up
Start in a couple of minutes from now
Controlling recording length
Bonus one line sampler
Summary
3. Webcam and Video Wizardry
Setting up your camera
Meet the USB Video Class drivers and Video4Linux
Finding out your webcam's capabilities
Capturing your target on film
Viewing your webcam in VLC media player
Viewing in Windows
Viewing in Mac OS X
Viewing on Linux
Recording the video stream
Recording in Windows
Recording in Mac OS X
Recording in Linux
Detecting an intruder and setting off an alarm
Creating an initial Motion configuration
Trying out Motion
Collecting the evidence
Viewing the evidence
Hooking up more cameras
Preparing a webcam stream in Windows
Preparing a webcam stream in Mac OS X
Configuring Motion for multiple input streams
Building a security monitoring wall
Turning your TV on or off using the Pi
Scheduling video recording or staging a playback scare
Summary
4. Wi-Fi Pranks – Exploring your Network
Getting an overview of all the computers on your network
Monitoring Wi-Fi airspace with Kismet
Preparing Kismet for launch
First Kismet session
Adding sound and speech
Enabling rouge access point detection
Mapping out your network with Nmap
Finding out what the other computers are up to
How encryption changes the game
Traffic logging
Shoulder surfing in Elinks
Pushing unexpected images into browser windows
Knocking all visitors off your network
Protecting your network against Ettercap
Analyzing packet dumps with Wireshark
Running Wireshark on Windows
Running Wireshark on Mac OS X
Running Wireshark on Linux
Summary
5. Taking your Pi Off-road
Keeping the Pi dry and running with housing and batteries
Setting up point-to-point networking
Creating a direct wired connection
Static IP assignment on Windows
Static IP assignment on Mac OS X
Static IP assignment on Linux
Creating an ad hoc Wi-Fi network
Connecting to an ad hoc Wi-Fi network on Windows
Connecting to an ad hoc Wi-Fi network on Mac OS X
Tracking the Pi's whereabouts using GPS
Tracking the GPS position on Google Earth
Preparing a GPS beacon on the Pi
Setting up Google Earth
Setting up a GPS waypoint logger
Mapping GPS data from Kismet
Using the GPS as a time source
Setting up the GPS on boot
Controlling the Pi with your smartphone
Receiving status updates from the Pi
Tagging tweets with GPS coordinates
Scheduling regular updates
Keeping your data secret with encryption
Creating a vault inside a file
Summary
Graduation
Index

Raspberry Pi for Secret Agents

Raspberry Pi for Secret Agents

Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: April 2013

Production Reference: 1180413

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-84969-578-7

www.packtpub.com

Cover Image by Artie Ng (<[email protected]>)

Credits

Author

Stefan Sjogelid

Reviewers

Valéry Seys

Masumi Mutsuda Zapater

Acquisition Editor

Erol Staveley

Commissioning Editor

Ameya Sawant

Technical Editors

Dennis John

Ishita Malhi

Project Coordinator

Amigya Khurana

Proofreader

Ting Baker

Indexer

Monica Ajmera Mehta

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Author

Stefan Sjogelid grew up in 1980s Sweden, getting hooked on 8-bit consoles, Amigas and BBSes. With a background in system and network administration, he packed his bags for Southeast Asia and continued to work in IT for many years, before love and a magic 8-ball told him to seek new opportunities in the North American continent.

The Raspberry Pi is the latest gadget to grab Stefan's attention, and after much tinkering and learning a great deal about the unique properties of the Pi, he launched the "PiLFS" (http://www.intestinate.com/pilfs) website, which teaches readers how to build their own GNU/Linux distribution and applications that are particularly useful on the Raspberry Pi.

I'd like to thank Anton for putting up with my "alt-tabbing" during our movie marathons, and a special thanks to my brother for showing me Southeast Asia, and my parents, for buying me a PC instead of a moped.

About the Reviewers

Valéry Seys is a project engineer and a brilliant, self-taught man, having started his computer studies in the early 80s. He has come a long way, from working with the cheap Sinclair ZX81, to IBM Mainframe, and Unix. He is driven by a philosophy expressed by Stephen Wolfram:

"We are in the exciting stage that everyone, whether a scientist or not, can contribute"—(Santa Fe Institute, 1984).

He currently works as an independent consultant for major French companies working in the sectors of telecom, banking, press publishing, insurance, defense, and administration.

My thanks go to Stefan, for including me in this book, and the scientist pioneers Stephen Wolfram and Karl Sims.

Masumi Mutsuda Zapater is a graduate of the Computer Science Engineering program from the UPC BarcelonaTech University. He combines his artistic job as a voice actor with his technological job at Itnig, an Internet startup accelerator. He is also a partner of Camaloon, an Itnig accelerated startup, globally providing both custom-designed and original products.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

For Bradley Manning—a real human being and a real hero (www.bradleymanning.com).

Preface

The Raspberry Pi was developed with the intention of promoting basic computer science in schools, but the Pi also represents a welcome return to simple, fun, and open computing.

Using gadgets for purposes other than those intended, especially for mischief and pranks, has always been an important part of adopting a new technology and making it your own.

With a $25 Raspberry Pi computer and a few common USB gadgets, anyone can afford to become a secret agent.

What this book covers

Chapter 1, Getting Up to No Good, takes you through the initial setup of the Raspberry Pi and preparing it for sneaky headless operations over the network.

Chapter 2, Audio Antics, teaches you how to eavesdrop on conversations or play pranks on friends by broadcasting your own distorted voice from a distance.

Chapter 3, Webcam and Video Wizardry, shows you how to setup a webcam video feed that can be used to detect intruders, or to stage a playback scare.

Chapter 4, Wi-Fi Pranks – Exploring your Network, teaches you how to capture, manipulate, and spy on network traffic that flows through your network.

Chapter 5, Taking your Pi Off-road, shows you how to encrypt your Pi and send it away on missions while keeping in touch via GPS and Twitter updates.

What you need for this book

The following hardware is recommended for maximum enjoyment:

The Raspberry Pi computer (Model A or B)SD card (4 GB minimum)Powered USB hub (projects verified with Belkin F5U234V1)PC/laptop running Windows, Linux, or Mac OS X with an internal or external SD card readerUSB microphoneUSB webcam (projects verified with Logitech C110)USB Wi-Fi adapter (projects verified with TP-Link TL-WN822N)USB GPS receiver (projects verified with Columbus V-800)Lithium polymer battery pack (projects verified with DigiPower JS-Flip)Android smartphone (projects verified with HTC Desire)

All software mentioned in this book is free of charge and can be downloaded from the Internet.

Who this book is for

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

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Now we need to start the imagewriter.py script and tell it where to find the Raspbian IMG file."

A block of code is set as follows:

prepare_tv() { tv_off # We switch the TV off and on again to force the active channel to the Pi sleep 10 # Give it a few seconds to shut down echo "on 0" | cec-client -d 1 -s # Now send the on command sleep 10 # And give the TV another few seconds to wake up echo "as" | cec-client -d 1 -s # Now set the Pi to be the active source }

Any command-line input or output is written as follows:

pi@raspberrypi ~ $ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "When your image has finished downloading, you'll need to unzip it, usually by right-clicking on the ZIP file and selecting Extract all or by using an application such as WinZip."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

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 files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Getting Up to No Good

Welcome, fellow pranksters and mischief-makers, to the beginning of your journey towards a stealthier lifestyle. Naturally, you're all anxious to get started with this cool stuff, so we'll only devote this first, short chapter to the basic steps you need to get your Raspberry Pi up and running.

First we'll get to know the hardware a little better, and then we'll go through the installation and configuration of the Raspbian operating system.

At the end of this chapter you should be able to connect to your Raspberry Pi over the network and be up-to-date with the latest and greatest software for your Pi.

A brief history lesson on the Pi

The Raspberry Pi is a credit-card-sized computer created by the non-profit Raspberry Pi Foundation in the UK. It all started when a chap named Eben Upton (now an employee at Broadcom) got together with his colleagues at the University of Cambridge's computer laboratory, to discuss how they could bring back the kind of simple programming and experimentation that was widespread among kids in the 1980s on home computers such as the BBC Micro, ZX Spectrum, and Commodore 64.

After several years of tinkering, the Foundation came up with two designs for the Raspberry Pi. The $35 Model B was released first, around February 2012, originally with 256 MB of RAM. A second revision, with 512 MB of RAM, was announced in October 2012 and around that time the Pi hardware assembly was moved from China to Sony's facility in the UK. The $25 Model A is expected to go on sale in the first quarter of 2013.

Note

What are the differences between the $25 Model A and the $35 Model B?

The Model A has only 256 MB of RAM, one USB port, and no Ethernet controller. With fewer components, the power consumption of Model A is roughly half that of Model B.

Writing Raspbian OS to the SD card

Computers can't do anything useful without an operating system, and the Pi is no exception. There is a growing collection of operating systems available for the Pi, but we'll stick with the "officially recommended" OS—the Raspbian GNU/Linux distribution.

Getting Raspbian

There are two main ways to obtain Raspbian. You can either buy it preinstalled on an SD card from your Raspberry Pi dealer, or download a Raspbian image yourself and write it to an empty SD card on a computer with an SD card slot.

Note

If you do have access to a computer but it lacks an SD card slot, it's a wise choice to invest in an external SD card reader/writer. They don't cost much and chances are you'll want to re-install or try a different operating system on your SD card sooner or later.

To download a Raspbian