hiro@torproject.org
https://mastodon.social/@nopressure
https://twitter.com/nopressure
(we have stickers)
What is Tor and what it can do for you.
Onion services and bidirectional anonymity.
Using onion services in your personal and web projects.
Alice wants to talk to some Bob. Alice also wants to stay safe.
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice's Tor client obtains a list of Tor nodes from a directory server and picks a random path to destination server.
Alice
bob.com
DS
The connection between Alice and the tor network is encrypted. The connection between the last exit node and Bob is not.
That's why it is important to use HTTPS!
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice's Tor client peaks another random path to destination server.
Alice
jane.info
Tor browser is designed to:
Onion services can be started from your computer
Onion services are p2p
Onion services are decentralised
Onion services have a smaller attack surface
Onion services provide by-directional anonymity
Onion services addresses are 54 chars public keys [ed|curve25519 - Keccak(SHA3)]
Bob is an onion service and Alice a Tor Browser user.
Bob picks 3 introduction points and builds a circuit.
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
Bob picks some introduction points and builds a circuit to them...
Bob builds a descriptor and uploads it to the directory
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
Bob picks some introduction points and builds a circuit to them, then advertises its service at the database...
🖳
DS
Alice fetches the descriptor from the directory and learns how to reach Bob.
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
🖳
Alice hears that bob.onion exists and they request more info from the database. They also setup a rendezvous point.
DS
Alice tells Bob to meet her at the rendezvous point.
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
🖳
Alice writes a message to Bob listing the rendezvous point and a one time secret, and asks an introduction point to deliver it to Bob.
DS
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
Bob connects to Alice's rendezvous point and provides their one-time secret.
Both Alice and Bob connect with a 3 hops circuit to the RP.
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
🖳
Alice
bob.onion
Bob and Alice use their circuit normally.
ssh:
container_name: onion_ssh
hostname: onion_ssh
build: ${PWD}/config/ssh
command: /home/root/init.sh
volumes:
- ./config/ssh/tor/torrc:/etc/tor/torrc
- ./config/ssh/keys/:/home/root/.ssh/keys
- ./config/ssh/init.sh:/home/root/init.sh
- ./config/ssh/sshd_config:/home/root/.ssh/ssh/sshd_config
ports:
- "2222:22"
FROM debian
MAINTAINER hiro <hiro@torproject.org>
RUN apt-get update
RUN apt-get install -y sudo vim openssh-server tor
USER root
RUN mkdir -p 700 /home/root/.ssh \
&& mkdir /var/run/sshd \
&& mv /etc/ssh /home/root/.ssh/ssh \
&& ln -s /home/root/.ssh/ssh /etc/ssh
WORKDIR /home/root
VOLUME /home/root
EXPOSE 22
## /etc/torcc
##
############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.
HiddenServiceDir /home/tor/onion_ssh_service/
HiddenServicePort 22 127.0.0.1:22
$ torsocks curl http://yjuwkcxlgo7f7o6s.onion/
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
proxies = {
'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'
}
r = requests.get('http://yjuwkcxlgo7f7o6s.onion/', proxies=proxies)
Onion services can also be used for p2p applications:
NEXT STEP
Use Onionshare to share static websites.
MyOnion is a proof of concept to run onion services into docker containers from your command line, via cli, or more simply via gui.
This project explore the idea of running ephemeral onion services on the Tor network.
https://github.com/hiromipaw/myonion/
NEXT STEP
Start a container from any device and share any kind of service and make this as easy as opening an app!
api_client = docker.APIClient(base_url='unix://var/run/docker.sock')
client = docker.from_env()
build = [line for line in
api_client.build(
path=self.common.get_resource_path('containers/website'), tag='website', dockerfile='./Dockerfile'
)
]
container = client.containers.run('website:latest', detach=True)
FROM debian
RUN \
apt-get update && \
apt-get install -y nginx tor && \
rm -rf /var/lib/apt/lists/* && \
echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
chown -R www-data:www-data /var/lib/nginx
COPY tor/torrc /etc/tor
COPY default /etc/nginx/sites-available/
...
Because .onion services live on the Tor network, you do not need hosting or a public ip address to offer some service via .onion address.
This means .onion services are a gateway to a decentralised, peer-to-peer internet, where you regain control on the content you create and who you are sharing it with.
The .onion is hosted on your computer for the time you desire, allowing the people visiting your site to remain anonymous, and also you.
We believe anonymity to be very important since it can free people, allowing them to decide how to expose themselves or to make themselves visible on their own terms.
Cyberspace.
A consensual hallucination experienced daily by billions of legitimate operators, in every nation, by children being taught mathematical concepts...
A graphic representation of data abstracted from banks of every computer in the human system. Unthinkable complexity. Lines of light ranged in the nonspace of the mind, clusters and constellations of data. Like city lights, receding...
William Gibson, Neuromancer