Raspberry Pi for Secret Agents
Turn your Raspberry Pi into your very own secret agent toolbox with this set of exciting projects!
Overview Detect an intruder on camera and set off an alarm Listen in or record conversations from a distance Find out what the other computers on your network are up to Unleash your Raspberry Pi on the world
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.
What you will learn from this book Install and configure Raspbian OS for maximum mischief Schedule a prank to happen when your foe least expects it Listen in or talk to people from a distance Detect an intruder with motion detection and set off an alarm Distort your voice in weird and wonderful ways Push unexpected images into browser windows Knock all visitors off your Wi-Fi network Control the Pi with your smartphone Keep your data secret with encryption
A playful, informal approach to using the Raspberry Pi for mischief!
Who this book is written for
Raspberry Pi for Secret Agents 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.
Apart from the Raspberry Pi board itself, a USB microphone and/or a webcam is required for most of the audio/video topics and a Wi-Fi dongle is recommended for the networking examples. A Windows/Mac OS X/Linux computer (or second Raspberry Pi) is also recommended for remote network access.
- Paperback: 152 pages
- Publisher: Packt Publishing (April 25, 2013)
- Language: English
- ISBN-10: 1849695784
- ISBN-13: 978-1849695787
- Product Dimensions: 0.3 x 7.4 x 9.1 inches
- Shipping Weight: 9.9 ounces
I spy with Raspberry Pi
Now with this book we’re in for a treat. At least we don’t get the usual starter point of view, and get some trickery instead. The book is very educating on an operating system level. Reading it, I was able to fill some large gaps in my modest but constantly expanding Linux knowledge. Once the reader starts, it quickly becomes clear that the installments built up are simple enough, yet powerful and effective. And I wouldn’t be surprised if such tools are employed in a real-life espionage activities.
The layout of the book is presented to be dead simple. Its significance is another story
After the mandatory introduction of the Raspberry Pi’s basics (in terms of hardware and OS) to the reader in the first chapter, the actual contents related to the main topic begin from the second one. The four sub-topics of the book are respectively: Audio, Video, WiFi and Portable Pi. The simplicity is only on the surface.
Concerning the audio tasks, at first I had a difficulty to set-up a microphone due to my profanity. Without giving the proper attention to all of the Pi’s interfaces I was (wrongfully) thinking that the audio output connector can deliver also an input. After a few lessons learned and a correct setup I was ready to meet some handy tools. Most of the chapter is dedicated to the SoX tool – the working horse of the audio mechanics. Combined with the rest of the tools (some of which are built-in Linux commands) and through the secure shell a lot of possible “spy techniques” are given. Those tools include tmux, espeak and at commands. They’re for running SoX independently of the user’s session, for speech and task-in-time automation respectively.
Apart from the auxiliary elements the main idea is to be shown how the ALSA sound system is employed in the Raspberry Pi, and how easily it can be used for various projects.
Regarding the video tasks, maybe the book was written and released a bit too early, because two weeks ago the guys behind the Raspberry Pi released its own camera, plugged into the dedicated CSI connector. I guess that if written today, this chapter would look a bit different. At least it could include additional information about the Pi camera and its dedicated software tools and capabilities.
Well without that info the chapter is comprised of two main projects – video streaming with recording the stream and detection of moving objects.
For the purpose of the first task the tools related to the framework around the UVC and V4L drivers are used in order to generate a MJPG video stream. The stream then can be accessed on the network by the VLC media player and if necessary recorded by it (without sound of course).
And for the purpose of the second task the very powerful Motion software is shown to easily gather input from even more than one camera.
The chapter about the WiFi networking can make a very nice addition to another of the PACKT’s books, which I reviewed recently – Networking with Raspberry Pi by Rick Golden. Here the tool of the trade is the detection system Kismet. For it to work not only configuration but also building from source is required. And to be preserved consistency between the projects (and between the chapters of the book of course) it is shown a collaboration with SoX for the purpose of attaching sound signals to its processing events.
Further a network mapping is done with Nmap, which leads to the logical next step – to dive into the common (or not so common) network security techniques for attack and/or monitoring with programs like Ettercap and Wireshark.
In the last chapter the Raspberry Pi had to prepare its back-pack, for it was going on a field trip. Regarding the mandatory warnings for battery life, secure and low profile package and most importantly – avoiding any moisture, the portable computer can pretty quickly step outside.
Setting up an ad hoc WiFi network is not difficult following the instructions in this (and partly in the previous) chapter.
Two of the most interesting projects in the book (which I unfortunately haven’t tested yet for some reasons) are the GPS tracking of the Pi in Google Earth, and remote controlling it from a smart-phone while tweeting its current status to the social media. Merely reading through them, they seemed to comprise a powerful, portable setup and just whet one’s appetite for some future projects.
The book aims to teach us how to employ the Raspberry Pi in a set up that is robust, automated and portable. All of these are actually achieved thanks to the software tools built-in or separately added to the Linux operating system. In that sense this could be regarded as the only (although not real) drawback of the book. The small computer is there, but still in the background. Everything described can be done on a regular Linux system’s shell. No wires, no soldering, no bread-boards, no hardware projects. Yet the Pi is most suitable and prepared for taking these actions to the field and in real life situations. So the existing hardware is enough to become the real spy and the book just gives the vision on how prepared it is to do the job.
In conclusion I can say that this book very easily achieves the goal of being funny, informative and deep at the same time.
Great book on RasPi for audio, video and network real scenarios
I won’t list all the details as you can find them in the TOC. All sections in the book explain how to do the experiments it in Mac, Linux and Windows.
After the intro on how to set up the device with a touch of history comes the real thing.
First on Audio: Recording, listening, distortion, voice generation, broadcasting, scheduling the actions. A lot of real world situations to learn the how-to behind it.
Then comes webcam and video wizardry: first check camera possibilities, then capturing the images and showing them using the web server included. Also recording of the video stream. Then comes the “spy” content… Detecting an intruder and setting off an alarm! But why limit to one camera… How to hook more cameras and a security monitoring videowall showing all the streams. After that, turning a TV on and OFF using HDMI or scheduling video recording. Plenty of fun!
After that the so called “Wi-Fi Pranks” gets a little more technical covering network exploration and mapping, wi-fi airspace monitoring, pushing unexpected images into other computer browser windows, using the RasPi as a firewall and analyzing packet dumps.
Then the last part covers how to make your RasPi really portable, autonomous and headless using a battery, a case and wi-fi, bluetooth and GPS USB modules. Setting a point-to-point network between the RasPi and your computer or controlling it with your mobile device using SSH, wi-fi and an app. Or making the RasPi tweet or PM to your profile even with GPS coordinates. After that comes encryption to the game!
Again, I think you’ll enjoy every single page. I did!
Very well done.
Entertaining and Full of Good Information
The requisite intro chapter was short and to the point, giving you just what you needed to know to get started. The inclusion of information related to updating the firmware was a nice touch as I haven’t read about that aspect in too many places.
The chapter on audio for the Raspberry Pi was an unexpected surprise, as it had a wealth of information on ALSA command line information I wish I had months ago when I first started working with the device. I eventually found all the information I needed on the internet back then, but it was nice seeing the pertinent commands right here in this book. It doesn’t go into solving driver issues or anything like that, but it does walk you through it in such a way where it’s not too difficult to make adjustments. This section gets into audio processing, remote connections, audio file formats, creating alias/shortcut commands, and process scheduling. Again, while the context may be a bit contrived, I didn’t see too much fluff in the content.
The third chapter is the video complement to the audio information of chapter two. It gets into determining the capabilities of your USB webcam using UVC, streaming video over HTTP with MJPG-streamer, and saving video with VLC. It then goes into setting up a rudimentary but functional motion based video security system, and controlling your TV using CEC. There isn’t much depth there, but the examples given are easily understandable and are a great jumping off point for doing something more sophisticated.
The fourth chapter gets into monitoring WiFi traffic with Kismet, and then later on using some other tools for doing some network mapping, traffic logging, and packet sniffing. It is presented under the guise of using these tools as a way to protect yourself, essentially using them for good and not for evil. It was a good overview to get you started but not much depth, as one would of course expect from a book this size. Lastly, this chapter introduces you to Wireshark and analyzing network traffic.
The last chapter provides tips on using your Raspberry Pi “unlugged”. It goes into networking tweaks, utilizing GPS data for tracking purposes, encrypting your data, and accessing your RPi from a smartphone via SSH. I was a little surprised that the author didn’t go into any ways of maximizing battery life with the Raspberry Pi in this chapter by shutting down unneeded services and reducing processor useage.
Other than the “secret agent” goofiness (OK I admit it, it *was* kind of fun) this book offers quite a bit of information on configuring peripherals on your Raspberry Pi, performing essential linux system maintenance, and giving you some ideas on how you can use your RPi to capture and/or control the world around you. It was a good read and the information, while maybe a bit lacking in detail at times, was well presented. Bottom line is that if you want to learn how to make more use of audio and video on the Raspberry Pi, or get started with the details of networking in general, this book may be of some help.
Surprises for Would-Be Spies
As I worked through the chapters, there were a series of pleasant surprises. First, Stefan starts with audio and video recording, explaining how to capture conversations at a distance and how to detect motion to start recording. Further, he shows how to package the RasPi for mobile use, covering WiFi mapping, sniffing, and packet dumping, along with GPS, auto twittering, and of course, encryption. Besides explaining how to do these `spy’ activities, Stefan introduces many (nonobvious) tools for the RasPi, such as: ALSA, SoX, Motion, Kismet, Ettercap, Wireshark, GISKismet, ttytter, Coversal/NetIO, and crpytsetup. Finally, Stefan emphasizes the importance of a `sneaky headless’ RasPi, using SSH with a command line interface from a remote Win/Mac laptop. As a spy, he reminds us that your RasPi must be hidden with as few wires as possible. Moreover, the RasPi Linux GUI eats lots of memory and power!
In summary, the book is well motivated (with the spy theme) and well worth the price for RasPi experimenters who push the limits. My only complaint was that the book was too short. I wanted to read more…
Recipes for Mischief
Great evil-genius tutorial.
The RaspberryPi and James Bond
This is a useful cookbook with a “provocative title”.
If I were a professional secret agent I hope that I would be using considerably more powerful techniques than those described in this book. However, I suspect that if I was to start experimenting with such techniques I would probably get a visit from those “strange men in grey macs that don’t officially exist” and feel that they “know what’s best for me – on behalf of whatever the current elite they represent is”. Nonetheless, in an age where “those that know best” feel that they have a “god given right” (literally in some cases I suspect given my impressions of the spectrum of the kind of psychological profiles individuals attracted to the “shady orgranisations” we are alluding to) it is important to develop secure unofficial channels of communication. The argument – “if you have nothing to hide then you have nothing to fear is a very specious one” Think of soome of the atrocious things that have been espoused by “worthy people” e.g. Eugenics (championed in the US before the second world war … and used to justify the extermination and sterilisation of e.g the mentally ill, homosexuals, members of other races and cultures), think of McCarthyism and the nasty witchunts that characterised it (and also think of various US politicians who began their careers as McCarthyite “stooges”) … you get my point.
It is also, at times, important to be able to record in both audio and video format with various individuals and organisation so that they cannot later be “plausibly denied”. Being a “whistleblower” involves often difficult and often painful choices, and being subject to often vindictive and spiteful treatment by the powerful and secretive when some of their more nasty goings on are brought into the glare of public scrutiny.
The RaspberryPi and associated small Linux platforms are a useful starting point for the serious development of “spook proof” communications systems, recording and data transmission systems.
Of course it can be argued that the use and deployment of such systems is subversive and illegal.
How many of you are aware of the assertion by a senior Microsoft executive that open source developers are commnists and worse [...], and, I can envisage scenarious where it most certainly would be. However, I can also envisage scenarios involving “potential conflict with state interests” where it can be argued that it would not be.
I am thinking for example of labour disputes in which a right wing government is using the intelligence services to defeat a large scale trade union organised protest. See e.g.[...]
and also, [...]
Also, and this is particularly aposite consider the case of David Snowden [see e.g. [...]
So, what practical projects does this book provide for those who wish to use “spook like technology” for their own (let us hope socially useful – for context see e.g. [...] purposes.
Here I am thinking of legitimate trade union activities, protection of human rights and civil liberties, unmasking the corruption of the “good and the great” especially bankers and politicians.
The sections on audio and video are a good starting point. The audio section illustrates some useful applications of audio including voice distortion (albeit simplistic), but does not cover such techniques as e.g voice encryption that will produce audio like signals that can be used in conjunction with mobile phones. The chapter on webcam and video wizardy is also a useful starting point and can form the starting point for many useful projects, not only “spookish ones” e.g. in monitoring of e.g. bird and animal behaviour as part of a school or University project.
The section on monitoring of WiFi networks and the use of the Wireshark protocol analyser, once again should be thought of as a “starter for 10″ , to be followed up by more extensive reading and research. I felt that the use of the word “pranks” in the title was unwise, implying as it does that “snooping” around in your current local “WiFi” neighbourhood is just some kind of “light hearted jape” … Personally I would have preferred a title along the lines of e.g. “exploring and monitoring WiFi” networks and systems. I have not use Ettercap before and must therefore thank the author for making me aware of it and its various uses. The Wireshark section was little more than a brief overview and I would hope that it will serve to inspire those who have not used Wireshark “in anger” to “dig deeper”
The final chapter had some intriguing topics … but was disappointingly brief.
The section on AdHoc networks ( a topic that I find of great interest and have looked into fairly extensively and even given the odd course and presentation on) was extremely brief.
The section on GPS was useful and I enjoyed the section on using communications between a smartphone (Android in the example used in the book) and a RaspberryPi.
The final part on data encryption barely scratched the surface.
So there you have it. A useful book for the curious and inventive, especially reasonably bright teenagers with a technical disposition. Not much use for spies though. However, you never know.
When I read my copy of “Spycatcher” in the days when “they were trying to ban its publication” what surprised me was the apparent “sheer technological incompetence” of the “spying fraternity”. Maybe this book might be of use to them … though I suspect they are probably better resourced and technically competent these days. Would it be possible to use this book as a jumping of point for developing applications to “outspook the spooks”. Definitiely yes … though do be careful and do be discreet. Play safe and conduct small “private” experiments with close and trusted friends. Also do check out the law in your part of the world as regards the use of advanced encryption technologies and the monitoring of radio communications. Also remember when sending “secret data” its not the volume but the quality. Indulge in thought experiments concerning the creation of “secret communications channels”. Once when teaching an embedded Linux kernel and device driver programming course to a group of “technical communications specialists” one of the exercises involved “hacking a keyboard driver” Much to my amusement one of the class hacked into a colleague’s computer and had that person’s keyboard LEDs “flashing morse code”. I am sure that given a bit more time he could have had the keyboard LEDs “flashing encrypted morse code”, and with multiple LEDs could even have devised multiple channel communication. Now there’s a little challenge – not too easy, not too difficult … Let me know how you get on …
Oh, and by the way .. you could adapt it to send morse from a RaspberryPi to a mobile phone and then “further afield” …. I think you get the picture.
Also, there are many interesting add on boards for the RaspberryPi that can serve as starting points for devising some of your own. How about a board with some interesting encryption or image processing software programmed into an FPGA device ?
It is possible to read Raspberry Pi for Secret Agents as an entertaining and stimulating title providing insights into a whole lot of interesting technologies and aspects of working with the RaspberryPi. If this is the spirit in which you are approaching the book then I can heartily recommend it.
Good luck and happy reading. Take care and be both sensible and socially responsible.