hiro@torproject.org
What is Tor and what it can do for you.
How Tor provides privacy and anonymity.
Using Tor at the application layer: The Tor Browser.
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.
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!
Tor browser is designed to:
Bob is an onion service and Alice a Tor Browser user.
Bob picks 3 introduction points and builds a circuit.
Bob builds a descriptor and uploads it to the directory
Alice fetches the descriptor from the directory and learns how to reach Bob.
Alice tells Bob to meet her at the rendezvous point.
Both Alice and Bob connect with a 3 hops circuit to the RP.
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
$ docker-compose up --build ssh
$ docker exec -it onion_ssh /bin/bash
$ torsocks ssh -o IdentitiesOnly=yes -i /home/hiro/.ssh/key -v root@wklfdwgq5txfvq5v.onion
$ 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
Start a container from any device and share any kind of service and make this as easy as opening an app!
$ ./dev_scripts/onionpeer.py
api_client = docker.APIClient(base_url='unix://var/run/docker.sock')
client = docker.from_env()
build = [line for line in api_client.build(path='./containers/website',
tag='website',
dockerfile='./Dockerfile')]
container = client.containers.run('website:latest', detach=True)
nginx = container.exec_run('nginx', user='root').output
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