0% found this document useful (0 votes)
8 views

Onion Router

crea tu propio onion router on un raspberry pi

Uploaded by

biorisk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Onion Router

crea tu propio onion router on un raspberry pi

Uploaded by

biorisk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...

Share Your Project

Find your DIY supplies in the Maker Shed → Kits, Books, Components, 3D Printers, Arduino, Raspberry Pi,
More!

MAKE: PROJECTS
How to Bake an Onion Pi
By Phillip Torrone and Limor Fried Category: Computers & Mobile, Electronics, Raspberry Pi
Difficulty: Moderate

1 de 15 18/01/15 10:38
How Feel like
to Bake ansomeone is snooping
Onion Pi | MAKE on you? Browse the web anonymously anywhere you
http://makezine.com/projects/make-36-boards/ho...

go with the Onion Pi Tor proxy. This is a cool weekend project that uses a Raspberry
Pi mini computer, USB wi-fi adapter, and Ethernet cable to create a small, low-power,
and portable privacy Pi.

Using it is easy-as-pie. First, plug the Ethernet cable into any internet connection in
your home, work, hotel, or conference/event. Next, power up the Pi with the
Micro-USB cable connected to your laptop, or with a wall adapter. The Pi will boot up
and create a new secure wireless access point. Connecting to that access point will
then automatically route any web browsing from your computer through the
anonymizing Tor network. Your tracks are swept clean.

What Is Tor?
Tor is an “onion routing” service: Internet traffic is wrapped in layers of encryption and
sent through a random circuit of relays before reaching its destination. This makes it
much harder for the server you’re accessing (or anyone snooping on your internet
use) to figure out who and where you are. It’s an excellent way for people who are
blocked from accessing websites to get around those restrictions. Journalists,
activists, businesspeople, law enforcement agents, and even military intelligence
operatives use Tor to protect their privacy and security online.

Why Use a Proxy?


You may have a guest or friend who wants to use Tor but doesn’t have the ability or
time to set it up on their computer. You may not want to, or may not be able to, install
Tor on your work laptop or “loaner” computer. You may want to browse anonymously
on a netbook, tablet, phone, or other mobile or console device that cannot run Tor
and does not have an Ethernet connection. There are lots of reasons you may want to
build and use an Onion Pi, not least of which is that it is an interesting way to learn
about Raspberry Pi, network interfaces, and the Linux command line.

WARNING
Before you start using your proxy, remember that there are a lot of ways to identify
you, even if your IP address is “randomized.” So delete and block your browser
cache, history, and cookies — some browsers even allow “anonymous sessions.” Do
not log into existing accounts with personally identifying information (unless you’re
sure that’s what you want to do). Use SSL whenever available to encrypt your
communication end-to-end. And visit torproject.org for more info on how to use Tor in
a smart, safe way.
2 de 15 18/01/15 10:38
This tutorial is a great way to make something fun and useful with your Raspberry Pi,  Follow
How but we an
to Bake can’t guarantee
Onion Pi | MAKE it’s 100% anonymous andhttp://makezine.com/projects/make-36-boards/ho...
secure. Be smart and paranoid
about your Tor usage.

PREVIEW

Buy Volume 36 for complete access or

Subscribe to MAKE and Save!

PARTS

Raspberry Pi Starter Kit, (Option 1) #MSRPIK from Maker Shed, makershed.com.


Our kit is the best way to get started using your Raspberry Pi. Includes
Raspberry Pi Model B, 4GB SD Card, 5V 2A power supply, Micro-USB and HDMI
3 de 15cables, custom MAKE: Pi enclosure, Adafruit’s Cobbler GPIO (General Purpose
18/01/15 10:38
Input/Output) breakout, a breadboard for electronics prototyping, a selectionofFollow
How tocommon components,
Bake an Onion Pi | MAKE and a copy of our bestselling book, Getting Started with
http://makezine.com/projects/make-36-boards/ho...
Raspberry Pi.
Mini USB wi-fi module, (Option 1) Maker Shed #MKAD55
Onion Pi Bundle (Tor Router) w/Mini Wi-Fi , (Option 2) Maker Shed #MSBUN44.
For more experienced users who want to build a dedicated wireless Tor proxy.
Includes Raspberry Pi Model B, Adafruit Pi case, Mini USB WiFi module, 10’
Ethernet cable, Micro-USB cable, 5V 1A power supply, USB console cable, and
4GB SD card.
Raspberry Pi Model B, (Option 3) Ethernet is required.
Raspberry Pi case, (Optional for Option 3)
USB wi-fi adapter, (Option 3) that supports the RTL8192CU chipset
Ethernet cable
SD card, (Option 3) 4GB or more
5V Micro-USB power supply, (Option 3) rated at least 700mA
TOOLS

Computer Windows, Mac, or Linux


Router with working internet connection
USB keyboard
Display with HDMI or composite video-in

STEPS
PROJECT STEPS
1. Prepare your SD card.
2. Boot and configure.
3. Connect Ethernet/Wi-Fi.
4. Set up the “PiFi” access point.
5. Install Tor.
6. Browse anonymously.
7. Going Further

4 de 15 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...

Step #1: Prepare your SD card.

5 de 15 18/01/15 10:38
 Follow
NOTE:
How to Bake anThis tutorial
Onion assumes
Pi | MAKE you’ll be using Raspbian,http://makezine.com/projects/make-36-boards/ho...
and may not work exactly as written with
other Linux distributions.
When you buy a Raspberry Pi, it may or may not come with an SD card. The SD card is important
because this is where Raspberry Pi keeps its operating system and it’s also where you’ll store
your documents and programs. Even if your Pi came with an SD card with the operating system
already installed, it’s a good idea to update it to the latest version, as improvements and bug fixes
are going in all the time.
Experienced users have many options for preparing an SD card. We recommend new users visit
raspberrypi.org and follow the instructions in their Quick Start Guide for formatting an SD card
and installing the official New Out Of Box Software (NOOBS) package. Briefly, the steps are:

Format the card. The Raspberry Pi Foundation recommends using the SD card foundation’s
official formatting tool, SD Formatter, which is available for Windows, Mac, and Linux. The
settings may vary depending on your OS. Refer to the Quick Start Guide for details.
Download NOOBS. You can get the .ZIP archive directly from the Raspberry Pi website, one of
several mirror servers, or through BitTorrent.
Extract the NOOBS archive to your SD card. The contents of the archive, including the file
bootcode.bin and the images and slides folders, should be in the top-level directory.

Step #2: Boot and configure.

6 de 15 18/01/15 10:38
If you want to mount your Pi in a case, now’s a good time.
 Follow
Insert the SD card you just prepared into the Pi’s drive slot, being careful to note the correct
orientation
How to Bake of the
an Onion Pi |contacts.
MAKE Connect your display andhttp://makezine.com/projects/make-36-boards/ho...
keyboard before plugging in the
Micro-USB power cable. The Pi should boot automatically.
Install Raspbian. From the NOOBS boot screen, select Raspbian, press Enter, and confirm that
you want to overwrite the disk. When installation is complete, press Enter again to dismiss the
notice, and your Pi should reboot automatically.
After a lot of scrolling text, you’ll arrive at the raspi-config options screen. Using the arrow keys
to navigate and Enter to select, first update the default password (“raspberry”) for the default
user account (“pi”) to a secure phrase known only to you.
TIP: You may notice a short lag between selecting options or entering commands and the
system’s response. This is normal. Be patient.
Select Internationalisation Options and set the time zone, language, and keyboard layout
options to match your preference. Then select Finish and press Enter.

Step #3: Connect Ethernet/Wi-Fi.

For most home networks, you should also be able to connect to the internet through the Ethernet
connection via your router without any further configuration. After raspi-config exits, you’ll be
presented with the Raspbian command prompt:
pi@raspberrypi ~ $_

7 de 15 When you see the prompt, connect your Pi to your router using a standard network cable. As
18/01/15 10:38
soon as you plug your Pi in, you should see its network LEDs start to flicker.  Follow
At theanRaspbian
How to Bake Onion Pi command
| MAKE line, type in: http://makezine.com/projects/make-36-boards/ho...

sudo wget makezine.com/go/onionpi

The Linux command sudo allows one user to assume the security privileges of another,
commonly the superuser or root. (Think: “ superuser do.”) The next command, wget, will not run
correctly unless preceded by sudo.
NOTE: Linux user rights and privileges can get pretty complicated, but as a general rule, you’ll
need to sudo any commands that involve making changes to the disk. Read-only commands, like
listing directories or displaying (without modifying) the contents of files, can usually be executed
without sudo.
The command wget instructs the operating system to retrieve a file from the web, and takes as
argument the web address of the file to be retrieved. In this case, we’re grabbing a pair of shell
scripts that will automate much of the fiddly typing for configuring your Pi as a wireless access
point.
TIP: If you get tired of typing sudo all the time, the command sudo su allows you to become the
superuser as long as you want.
When you understand what the command is supposed to do, press Enter to execute it. If your
Ethernet connection is working, you’ll shortly be notified that the file has been saved.
If your Ethernet connection is not working, you’ll see an error message (such as failed: Name or
service not known). Make sure that your Pi is correctly connected to your router, the network
cable is good, and your router is correctly configured for DHCP (Dynamic Host Configuration
Protocol).
Don’t plug in your wi-fi adapter yet — you’ll crash the Pi and corrupt the SD card. First, turn off
your Pi by entering sudo halt. After shutdown, plug in the wi-fi adapter. Now restart your Pi by
cycling the power.

Step #4: Set up the “PiFi” access point.

8 de 15 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...

Now we’ll set up the Pi to broadcast a wi-fi service and route wireless internet traffic through the
Ethernet cable. One of the great things about Linux is that every little detail of a system’s
configuration can be easily modified to suit your application by typing in commands or modifying
the contents of text files.
The tradeoff is that the details can get pretty complicated, and you have to know what you’re
doing to understand exactly what needs to be changed, and how.
To make the process easier, we’ve prepared a script (which you just downloaded with wget) that
will automatically make these changes for you (see image). If you just want to get it working, all
you have to do is run the script, as explained below.
After your Pi reboots, you’ll be prompted to log in. Enter the default user ID “pi” followed by the
password you set from raspi-config.
At the Raspbian command prompt, enter these commands to extract the shell scripts:
sudo unzip onionpi
sudo bash pifi.sh

We just made friends with sudo; now it’s time to meet bash, the Linux command-line interpreter.
In fact, you’ve already been introduced: whenever you enter text at the command prompt, you
are interacting with bash, which is the program that processes what you’ve typed and figures out
what to do with it. bash runs automatically whenever you’re working from the Linux command
line, but can also be called as a command, itself, to execute a script file.
In this case, we’re telling bash to read through the script pifi.sh and execute each line of text as if
9 de 15 it had been typed in at the command prompt. 18/01/15 10:38
 Follow
Press Enter and you’ll soon see the script splash screen, with the option to start the script or
abort.an
How to Bake Press Enter
Onion again to
Pi | MAKE start. http://makezine.com/projects/make-36-boards/ho...
When prompted, enter the name (SSID) for your new wireless network, and the password
required to access it.
NOTE: Both network name and password can be updated later by editing the config file with any
text editor.
When the script is complete, your Pi should reboot automatically, after which you should be able
to detect your new “PiFi” network from nearby computers, smartphones, and other wi-fi
appliances. Log on to the wireless network using the password you just set, open a web browser,
and navigate to your favorite web page to verify that everything is working properly.
If you just want to configure your Pi as a wireless access point, you’re done! You shouldn’t even
have to log in to Raspbian again; the Pi will now automatically function as a wireless router
whenever it’s on.
NOTE: For a slower and more instructive experience, we recommend opening the pifi.sh script
(which is just a text file) in another computer and typing in the commands by hand, to get a feel
for what each one does and how the system responds. The script file also contains comments
that explain each step in more technical detail, for those who are interested.

Step #5: Install Tor.

To continue setting up your Pi to anonymize your wi-fi traffic with Tor, log in to Linux again and
run the second script with:
10 de 15 18/01/15 10:38
sudo bash tor.sh  Follow
This script
How to Bake is less
an Onion Pi |complicated.
MAKE Basically, it installs andhttp://makezine.com/projects/make-36-boards/ho...
configures the Tor software, then updates
your IP tables to route everything through it. As always, it's a good idea to read through the
commands and comments in the script file before running it. More technical detail is available
there.
The Pi will automatically reboot again when the script is done. Your Tor proxy may not work until
the reboot is complete.

Step #6: Browse anonymously.

When your Pi has finished rebooting, log on to your “PiFi” wireless network from a
nearby computer, smartphone, or other wi-fi appliance. Then open your favorite
internet browser and visit check.torproject.org. If your Onion Pi is working correctly,
you should see something like the screen shot shown here.

Step #7: Going Further

11 de 15 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...

We use Ethernet because it requires no configuration or passwords — just click the cable to get
DHCP. But if you want, it’s not too hard to set up a wi-fi-to-wi-fi proxy. You’ll need to use two wi-fi
adapters and edit the settings in /etc/networks/interfaces to add the wlan1 interface with SSID
and password to match your internet provider. See makezine.com/go/pifi2wifi for more details.
It’s also pretty easy to configure Tor to give you a presence in any country you choose. For
example, here’s a torrc configuration file that sets up a Pi at IP address 192.168.0.178 to appear
“present” in Great Britain:

Log notice file /var/log/tor/notices.log


SocksListenAddress 192.168.0.178
ExitNodes {GB}
StrictNodes 1

You’ll also need to configure your browser to use a SOCKS5 proxy on 192.168.0.178 (or whatever
your Pi’s IP address may be), port 9050.
If you like using Tor, you can help make it faster by joining as a relay, or increase its effectiveness
by becoming an exit node. Check out torproject.org for details.
Finally, if you want to support Tor but can’t run your own relay or exit node, please consider
donating to the project to help cover development, equipment, and other expenses. Your
donation is even tax-deductible if you live in the United States.

12 de 15 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE PHILLIP TORRONE http://makezine.com/projects/make-36-boards/ho...
Editor at large - Make magazine. Creative director - Adafruit
Industries, contributing editor - Popular Science. Previously:
Founded - Hack-a-Day, how-to editor - Engadget, Director of
product development - Fallon Worldwide, Technology
Director - Braincraft.

ADAFRUIT // MAKE

LIMOR FRIED

13 de 15 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...
7 Comments MAKE  Login

Sort by Best Share ⤤ Favorite ★

Join the discussion…

Jelimoore • 6 months ago


Why does the RasPi say "[....]Starting advanced IEEE 802.11 management:
hostapdioctl[SIOCSIWMODE]: Invalid Argument failed!"
EDIT: Looking at that, the problem seems to be in the driver, mode, or both!
Configuration file: /etc/hostapd/hostapd.conf
drv_>ifindex=3
I2_sock_recv==I2_sock_xmit=0x0x106e636
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rt1871xdrv driver initalization failed.
5 • Reply • Share ›

Patrick Erb-White • 6 months ago


Why does my pi-fi not work?
• Reply • Share ›

Guest > Patrick Erb-White • 6 months ago


Now that i re-read the article, i understand that it uses ethernet, and my pi-fi isn't working
because i am not connected to ethernet. Nevertheless, I must ask: will pi-fi interfere with
the original wi-fi at all?
• Reply • Share ›

Jelimoore > Guest • 6 months ago


Shouldn't...It just acts as another WiFi access point
• Reply • Share ›

Guest • 6 months ago


What would happen if i used s wireless reciever that i had already set up for step #3? anything
bad?
• Reply • Share ›

Guest • 6 months ago


what happens if i do step 3 with the wi-fi adapter?
• Reply • Share ›

Guest > Guest • 6 months ago


NVMD i have a solution
14 de 15 • Reply • Share › 18/01/15 10:38
 Follow
How to Bake an Onion Pi | MAKE http://makezine.com/projects/make-36-boards/ho...

15 de 15 18/01/15 10:38
 Follow

You might also like