Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
BeagleBone for Secret Agents
BeagleBone for Secret Agents

BeagleBone for Secret Agents: Browse anonymously, communicate secretly, and create custom security solutions with open source software, the BeagleBone Black, and cryptographic hardware

eBook
$9.99 $16.99
Paperback
$26.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

BeagleBone for Secret Agents

Chapter 2. Circumventing Censorship with a Tor Bridge

In this chapter, you'll configure your BeagleBone Black (BBB) to run a bridge in the Tor network. This bridge will allow you and others to access the Internet more anonymously and provide an anti-censorship gateway. We'll add a simple hardware control interface to BBB so that we can see and adjust the bandwidth usage of the bridge in real time. We'll call this project BeagleBridge.

This chapter will discuss the following topics:

  • An introduction to Tor
  • The difference between a Tor relay and bridge
  • Obfuscated Tor proxies
  • How to download and install Tor on BBB
  • How to configure BBB as a Tor bridge running an obfuscated proxy
  • How to add hardware controls to adjust the bridge from a front panel

Learning about Tor

In this project, you will learn how to use Tor, a tool and network designed to protect your anonymity online. Tor originally developed from research, sponsored by the U.S. Naval Research Laboratory, on onion routing (Dingledine, Mathewson, and Syverson, 2004). In onion routing, the client builds a circuit of nodes in an overlay network, which is a network built on top of an existing network. The Tor network is an overlay network that runs on the Internet, although it can run on separate networks. The client sends a message to each node, which is specifically encrypted for that node, asking the node to send it to the next node in the circuit. Each node peels back a layer of encryption and forwards the result to the next hop in the circuit, and hence, the onion analogy. The last node contains the client's actual message, which is forwarded to the destination server.

Onion routing provides anonymity because the destination server does not know the IP address of the...

Installing Tor on BBB

The instructions provided in the following sections are geared towards the user running BeagleBridge on a home network. The bridge will consume some otherwise unused bandwidth and donate it to the Tor network. You should check your ISP's Terms of Service before running a server to see whether it's permitted. Also, you'll need to configure port forwarding from your home router. As there are numerous devices, each with their own configuration mechanism, you should consult your router's manual on how to enable port forwarding.

Installing Tor from the development repository

The Tor images in the official Debian repository are not as up to date as those from the Tor Project. We'll use the Tor Project's development repository to retrieve the latest software. This is especially important when you are running a bridge, as the bridge and the pluggable transport software are updated frequently.

Note

The latest instructions as well as the latest GPG...

Understanding Tor exit policies

A bridge, by definition, is the entry point to the Tor network. As such, the exit policy, which will allow traffic to exit the Tor network from the server, should be the following:

ExitPolicy reject *:*

This prevents your server from running as an exit node. If you do decide to run an exit node, be prepared to receive some complaints from your ISP if you are running it on a home network. This is why the Tor Project and the Electronic Frontier Foundation recommend that you don't run an exit relay on a home network. A thorough, legal FAQ prepared by the Electronic Frontier Foundation can be found at https://www.torproject.org/eff/tor-legal-faq.html.en.

Setting bridge-specific settings

There are three bridge specific settings: BridgeRelay, ServerTransportPlugin, and ExtORPort. The BridgeRelay setting is the key setting that defines your relay as a bridge. Your bridge's meta information is published in the bridge database instead of the public directory server, which keeps your bridge's IP less public than a Tor relay's IP address. ServerTransportPlugin defines which pluggable transport proxy your bridge supports. Currently, ScrambleSuit is the latest promising pluggable transport technology. However, obfs3, which is the transport enabled in our bridge configuration example, is slightly more mature and it is the more conservative recommendation. Lastly, ExtORPort allows the gathering and reporting of bridge statistics to the Tor Project.

Note

For those who are interested in running the ScrambleSuit obfsproxy, take a look at the following link on how to configure your bridge: https://lists.torproject.org/pipermail/torrelays...

Starting your new Tor bridge

With the time updated and the configuration set, it's time to turn on the bridge. At the moment, the bridge should be able to make a connection to the Tor network, but it will not be able to accept incoming connections as we have not yet configured port forwarding from your router. However, the obfsproxy port is randomly assigned, so we need to run the bridge first to find the port. Restart the Tor service with the following command:

sudo service tor restart

Next, let's check the log to see whether Tor has started correctly:

tail -n 20 /var/log/tor/notices.log

If you see something like the following, then your Tor client's behavior is working:

Mar 25 21:37:43.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Mar 25 21:37:43.000 [notice] Bootstrapped 100%: Done.

Enabling port forwarding

We know that we need to forward port 9001, as it is the ORPort, but we need to know which port the obfsproxy software runs on. This will be logged in the same file and will be discovered by searching the Tor log with the following command:

grep obfs3 /var/log/tor/notices.log

The previous command should yield the following search result:

Mar 05 01:56:04.000 [notice] Registered server transport 'obfs3' at '0.0.0.0:59519'

The obfsproxy port for our obfs3 service is on 59519. From your home router, configure port forwarding from 9001, and configure port forwarding from 59519 from your external IP to BBB. It will also help if you give your BBB a static internal IP. Consult your router's manual for directions. Alternatively, you can specify the port with the following line in the /etc/tor/torrc file:

ServerTransportListenAddr obfs3 0.0.0.0:xxxx

Replace the x's with the desired port address. However, it's best to let obfsproxy pick a random...

Adding physical interfaces to the bridge

Now you have a Tor bridge running and you can stop here. If you do, you'd be missing out on the ability to combine software with custom hardware on BBB. Our BBB Tor bridge currently has no visual feedback, so it's not obvious that it's working. Also, the only means to control the bridge is to log in to BBB over SSH and manipulate the configuration options. The Tor bridge is an appliance and it needs appliance controls. In this section, we'll add a front panel, which will give us an easy method to control the bridge's bandwidth and a quick indicator to know that the software hasn't crashed. In the following section, we'll add the software to interface with our bridge and control the hardware.

Note

If you decide to run a Tor relay, there are websites such as Tor atlas (https://atlas.torproject.org/) that will produce bandwidth graphs and display other information about your relay. Another tool that will also display...

Learning about Tor


In this project, you will learn how to use Tor, a tool and network designed to protect your anonymity online. Tor originally developed from research, sponsored by the U.S. Naval Research Laboratory, on onion routing (Dingledine, Mathewson, and Syverson, 2004). In onion routing, the client builds a circuit of nodes in an overlay network, which is a network built on top of an existing network. The Tor network is an overlay network that runs on the Internet, although it can run on separate networks. The client sends a message to each node, which is specifically encrypted for that node, asking the node to send it to the next node in the circuit. Each node peels back a layer of encryption and forwards the result to the next hop in the circuit, and hence, the onion analogy. The last node contains the client's actual message, which is forwarded to the destination server.

Onion routing provides anonymity because the destination server does not know the IP address of the client...

Installing Tor on BBB


The instructions provided in the following sections are geared towards the user running BeagleBridge on a home network. The bridge will consume some otherwise unused bandwidth and donate it to the Tor network. You should check your ISP's Terms of Service before running a server to see whether it's permitted. Also, you'll need to configure port forwarding from your home router. As there are numerous devices, each with their own configuration mechanism, you should consult your router's manual on how to enable port forwarding.

Installing Tor from the development repository

The Tor images in the official Debian repository are not as up to date as those from the Tor Project. We'll use the Tor Project's development repository to retrieve the latest software. This is especially important when you are running a bridge, as the bridge and the pluggable transport software are updated frequently.

Note

The latest instructions as well as the latest GPG fingerprint can be found on the...

Understanding Tor exit policies


A bridge, by definition, is the entry point to the Tor network. As such, the exit policy, which will allow traffic to exit the Tor network from the server, should be the following:

ExitPolicy reject *:*

This prevents your server from running as an exit node. If you do decide to run an exit node, be prepared to receive some complaints from your ISP if you are running it on a home network. This is why the Tor Project and the Electronic Frontier Foundation recommend that you don't run an exit relay on a home network. A thorough, legal FAQ prepared by the Electronic Frontier Foundation can be found at https://www.torproject.org/eff/tor-legal-faq.html.en.

Setting bridge-specific settings


There are three bridge specific settings: BridgeRelay, ServerTransportPlugin, and ExtORPort. The BridgeRelay setting is the key setting that defines your relay as a bridge. Your bridge's meta information is published in the bridge database instead of the public directory server, which keeps your bridge's IP less public than a Tor relay's IP address. ServerTransportPlugin defines which pluggable transport proxy your bridge supports. Currently, ScrambleSuit is the latest promising pluggable transport technology. However, obfs3, which is the transport enabled in our bridge configuration example, is slightly more mature and it is the more conservative recommendation. Lastly, ExtORPort allows the gathering and reporting of bridge statistics to the Tor Project.

Note

For those who are interested in running the ScrambleSuit obfsproxy, take a look at the following link on how to configure your bridge: https://lists.torproject.org/pipermail/torrelays/ 2014-February/003886...

Starting your new Tor bridge


With the time updated and the configuration set, it's time to turn on the bridge. At the moment, the bridge should be able to make a connection to the Tor network, but it will not be able to accept incoming connections as we have not yet configured port forwarding from your router. However, the obfsproxy port is randomly assigned, so we need to run the bridge first to find the port. Restart the Tor service with the following command:

sudo service tor restart

Next, let's check the log to see whether Tor has started correctly:

tail -n 20 /var/log/tor/notices.log

If you see something like the following, then your Tor client's behavior is working:

Mar 25 21:37:43.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Mar 25 21:37:43.000 [notice] Bootstrapped 100%: Done.
Left arrow icon Right arrow icon

Description

If you have some experience with the BeagleBone or similar embedded systems and want to learn more about security and privacy, this book is for you. Alternatively, if you have a security and privacy background and want to learn more about embedded development, this book is for you. You should have some familiarity with Linux systems and with the C and Python programming languages.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 23, 2014
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781783986057
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 23, 2014
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781783986057
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 108.97
Building a Home Security System with BeagleBone
$32.99
BeagleBone Robotic Projects
$48.99
BeagleBone for Secret Agents
$26.99
Total $ 108.97 Stars icon
Banner background image

Table of Contents

7 Chapters
1. Creating Your BeagleBone Black Development Environment Chevron down icon Chevron up icon
2. Circumventing Censorship with a Tor Bridge Chevron down icon Chevron up icon
3. Adding Hardware Security with the CryptoCape Chevron down icon Chevron up icon
4. Protecting GPG Keys with a Trusted Platform Module Chevron down icon Chevron up icon
5. Chatting Off-the-Record Chevron down icon Chevron up icon
A. Selected Bibliography Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(2 Ratings)
5 star 50%
4 star 0%
3 star 50%
2 star 0%
1 star 0%
David Horvath Jul 10, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Awesome book, I finally had a chance to read it and would highly recommend it.
Amazon Verified review Amazon
sipy Mar 27, 2021
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Good, if you need to get going with a BeagkeBone Black (BBB) and one of the projects in the index. Not a reference, otherwise. Good insights on using BBB with a Crypto Cape. A little thin, but achieves what the title promises (tongue-in-cheek).
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.