Snehan Kekre
Published © GPL3+

Set Up a Simple Tor Hidden Service on C.H.I.P

A hands-on guide to configuring a censorship resistant website via a Tor Hidden Service .onion domain on C.H.I.P.

BeginnerFull instructions provided1,684
Set Up a Simple Tor Hidden Service on C.H.I.P

Things used in this project

Hardware components

C.H.I.P.
C.H.I.P.
×1

Story

Read more

Code

Code snippet #3

Plain text
disk2				stderr
disk2s1				stdin
disk2s2				stdout
disk3				systrace
disk3s1				tty
disk3s2				tty.Bluetooth-Incoming-Port
disk4				tty.usbmodem1413 
disk4s1				tty.TomJBL-SPPDev
disk5				tty.UEROLL-LWACP
disk5s1				ttyp0

Code snippet #4

disk2				stderr
disk2s1				stdin
disk2s2				stdout
disk3				systrace
disk3s1				tty
disk3s2				tty.Bluetooth-Incoming-Port
disk4				tty.usbmodem1413 
disk4s1				tty.TomJBL-SPPDev
disk5				tty.UEROLL-LWACP
disk5s1				ttyp0

Code snippet #11

Plain text
chip@chip:~$ passwd
Changing password for chip.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password:
Password changed

chip@chip:~$ w
 02:22:12 up  2:14,  3 users,  load average: 0.03, 0.03, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
chip     :0       :0               23:17   ?xdm?   3:08   0.17s /bin/sh /etc/xd
chip     pts/0    10.112.17.181    02:16    1:40   0.15s  0.12s nano .bash_hist
chip     pts/1    10.112.17.181    02:21    3.00s  0.10s  0.04s w

chip@chip:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
ubi0:rootfs     3.6G  860M  2.8G  24% /
devtmpfs        213M     0  213M   0% /dev
tmpfs           246M     0  246M   0% /dev/shm
tmpfs           246M  6.7M  239M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           246M     0  246M   0% /sys/fs/cgroup
tmpfs            50M  4.0K   50M   1% /run/user/1000

Code snippet #12

chip@chip:~$ passwd
Changing password for chip.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password:
Password changed

chip@chip:~$ w
 02:22:12 up  2:14,  3 users,  load average: 0.03, 0.03, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
chip     :0       :0               23:17   ?xdm?   3:08   0.17s /bin/sh /etc/xd
chip     pts/0    10.112.17.181    02:16    1:40   0.15s  0.12s nano .bash_hist
chip     pts/1    10.112.17.181    02:21    3.00s  0.10s  0.04s w

chip@chip:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
ubi0:rootfs     3.6G  860M  2.8G  24% /
devtmpfs        213M     0  213M   0% /dev
tmpfs           246M     0  246M   0% /dev/shm
tmpfs           246M  6.7M  239M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           246M     0  246M   0% /sys/fs/cgroup
tmpfs            50M  4.0K   50M   1% /run/user/1000

Code snippet #13

Plain text
chip@chip:~$ export TERM=ansi
chip@chip:~$ sudo nmtui
[sudo] password for chip: 

                                                                                
                           ?Ĵ NetworkManager TUI ??Ŀ                          
                           ?                         ?                          
                           ? Please select an option ?                          
                           ?                         ?                          
                           ? Edit a connection       ?                          
                           ? Activate a connection   ?                          
                           ? Set system hostname     ?                          
                           ?                         ?                          
                           ? Quit                    ?                          
                           ?                         ?                          
                           ?                    <OK> ?                          
                           ?                         ?                          
                           ???????????????????????????                          
                                                        

Code snippet #14

chip@chip:~$ export TERM=ansi
chip@chip:~$ sudo nmtui
[sudo] password for chip: 

                                                                                
                           ?Ĵ NetworkManager TUI ??Ŀ                          
                           ?                         ?                          
                           ? Please select an option ?                          
                           ?                         ?                          
                           ? Edit a connection       ?                          
                           ? Activate a connection   ?                          
                           ? Set system hostname     ?                          
                           ?                         ?                          
                           ? Quit                    ?                          
                           ?                         ?                          
                           ?                    <OK> ?                          
                           ?                         ?                          
                           ???????????????????????????                          
                                                        

Code snippet #15

Plain text
               ??????????????????????????????????????????????????Ŀ              
               ?                                                  ?             
               ? ????????????????????????????????????Ŀ           ?              
               ? ? Ethernet                          ? <Add>     ?              
               ? ?   usb0_linklocal                 ? ?           ?             
               ? ? Wi-Fi                            ? ? <Edit...> ?           
               ? ?   Minerva Schools 2.4GHz - SLOW  ? ?           ?             
               ? ?                                  ? ? <Delete>  ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                   ? <Quit>    ?              
               ? ??????????????????????????????????????           ?             
               ?                                                  ?             
               ????????????????????????????????????????????????????
               
    ????????????????????????????? Edit Connection ????????????????Ŀ??????????Ŀ   
   	?                                                                        ?   
   	?         Profile name Minerva Schools 2.4GHz - SLOW___________          ۳   
   	?               Device XX:XX:XX:XX:XX:XX (wlan0)_______________          ??  
   	?                                                                        ??  
   	? + WI-FI                                                       <Hide>   ?? 
   	? |               SSID Minerva Schools 2.4GHz - SLOW___________          ??  
   	? |               Mode <Client>                                          ??  
   	? |                                                                      ??  
   	? |           Security <WPA & WPA2 Personal>                             ??  
   	? |           Password ******************______________________          ??  
   	? |                    [ ] Show password                                 ??  
   	? |                                                                      ??  
   	? |              BSSID ________________________________________          ??  
   	? | Cloned MAC address ________________________________________          ??  
   	? |                MTU __________ (default)                              ??  
   	? \                                                                      ??  
   	?                                                                        ??  
   	? - IPv4 CONFIGURATION <Automatic>                              <Show>   ??  
   	? - IPv6 CONFIGURATION <Automatic>                              <Show>   ??  
   	?                                                                        ?   
   	???????????????????????????????????????????????????????????????????????????

Code snippet #16

               ??????????????????????????????????????????????????Ŀ              
               ?                                                  ?             
               ? ????????????????????????????????????Ŀ           ?              
               ? ? Ethernet                          ? <Add>     ?              
               ? ?   usb0_linklocal                 ? ?           ?             
               ? ? Wi-Fi                            ? ? <Edit...> ?           
               ? ?   Minerva Schools 2.4GHz - SLOW  ? ?           ?             
               ? ?                                  ? ? <Delete>  ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                  ? ?           ?             
               ? ?                                   ? <Quit>    ?              
               ? ??????????????????????????????????????           ?             
               ?                                                  ?             
               ????????????????????????????????????????????????????
               
    ????????????????????????????? Edit Connection ????????????????Ŀ??????????Ŀ   
   	?                                                                        ?   
   	?         Profile name Minerva Schools 2.4GHz - SLOW___________          ۳   
   	?               Device XX:XX:XX:XX:XX:XX (wlan0)_______________          ??  
   	?                                                                        ??  
   	? + WI-FI                                                       <Hide>   ?? 
   	? |               SSID Minerva Schools 2.4GHz - SLOW___________          ??  
   	? |               Mode <Client>                                          ??  
   	? |                                                                      ??  
   	? |           Security <WPA & WPA2 Personal>                             ??  
   	? |           Password ******************______________________          ??  
   	? |                    [ ] Show password                                 ??  
   	? |                                                                      ??  
   	? |              BSSID ________________________________________          ??  
   	? | Cloned MAC address ________________________________________          ??  
   	? |                MTU __________ (default)                              ??  
   	? \                                                                      ??  
   	?                                                                        ??  
   	? - IPv4 CONFIGURATION <Automatic>                              <Show>   ??  
   	? - IPv6 CONFIGURATION <Automatic>                              <Show>   ??  
   	?                                                                        ?   
   	???????????????????????????????????????????????????????????????????????????

Code snippet #17

Plain text
chip@chip:~$ ping google.com
PING google.com (172.217.5.110) 56(84) bytes of data.
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=1 ttl=55 time=19.8 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=2 ttl=55 time=9.96 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=3 ttl=55 time=10.5 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=4 ttl=55 time=50.6 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 9.962/22.765/50.671/16.578 ms
chip@chip:~$ 

Code snippet #18

chip@chip:~$ ping google.com
PING google.com (172.217.5.110) 56(84) bytes of data.
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=1 ttl=55 time=19.8 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=2 ttl=55 time=9.96 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=3 ttl=55 time=10.5 ms
64 bytes from sfo03s07-in-f110.1e100.net (172.217.5.110): icmp_seq=4 ttl=55 time=50.6 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 9.962/22.765/50.671/16.578 ms
chip@chip:~$ 

Code snippet #19

Plain text
chip@chip:~$ sudo ifconfig
[sudo] password for chip: 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)

usb0      Link encap:Ethernet  HWaddr 4e:5b:65:5c:bd:04  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 38:a2:8c:5e:83:13  
          inet addr:10.112.16.13  Bcast:10.112.17.255  Mask:255.255.254.0
          inet6 addr: fe80::3aa2:8cff:fe5e:8313/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13751 errors:0 dropped:493 overruns:0 frame:0
          TX packets:4885 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4239749 (4.0 MiB)  TX bytes:903110 (881.9 KiB)

Code snippet #20

chip@chip:~$ sudo ifconfig
[sudo] password for chip: 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)

usb0      Link encap:Ethernet  HWaddr 4e:5b:65:5c:bd:04  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 38:a2:8c:5e:83:13  
          inet addr:10.112.16.13  Bcast:10.112.17.255  Mask:255.255.254.0
          inet6 addr: fe80::3aa2:8cff:fe5e:8313/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13751 errors:0 dropped:493 overruns:0 frame:0
          TX packets:4885 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4239749 (4.0 MiB)  TX bytes:903110 (881.9 KiB)

Code snippet #21

Plain text
ssh chip@10.112.16.13
chip@10.112.16.13's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jun 25 02:21:33 2017 from XX.XXX.XX.XXXX
chip@chip:~$ 

Code snippet #22

ssh chip@10.112.16.13
chip@10.112.16.13's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jun 25 02:21:33 2017 from XX.XXX.XX.XXXX
chip@chip:~$ 

Code snippet #23

Plain text
chip@chip:~$ nano /etc/apt/sources.list

deb http://ftp.us.debian.org/debian/ jessie main contrib non-free 
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free 
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://http.debian.net/debian jessie-backports main contrib non-free 
deb-src http://http.debian.net/debian jessie-backports main contrib non-free

deb http://opensource.nextthing.co/chip/debian/repo jessie main

deb https://deb.torproject.org/torproject.org jessie main
deb-src https://deb.torproject.org/torproject.org jessie main

Code snippet #24

chip@chip:~$ nano /etc/apt/sources.list

deb http://ftp.us.debian.org/debian/ jessie main contrib non-free 
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free 
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://http.debian.net/debian jessie-backports main contrib non-free 
deb-src http://http.debian.net/debian jessie-backports main contrib non-free

deb http://opensource.nextthing.co/chip/debian/repo jessie main

deb https://deb.torproject.org/torproject.org jessie main
deb-src https://deb.torproject.org/torproject.org jessie main

Code snippet #25

Plain text
chip@chip:~$ gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg: requesting key 886DDD89 from hkp server keys.gnupg.net
gpg: key 886DDD89: "deb.torproject.org archive signing key" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
chip@chip:~$ gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
[sudo] password for chip: 
OK

Code snippet #26

chip@chip:~$ gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg: requesting key 886DDD89 from hkp server keys.gnupg.net
gpg: key 886DDD89: "deb.torproject.org archive signing key" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
chip@chip:~$ gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
[sudo] password for chip: 
OK

Code snippet #29

Plain text
chip@chip:~$ mkdir simple-server
chip@chip:~$ cd simple-server/
chip@chip:~/simple-server$ echo "Hello, This is my Tor hidden service!" > index.html
chip@chip:~/simple-server$ python -m SimpleHTTPServer 8000
Serving HTTP on 0.0.0.0 port 8000 ...

Code snippet #30

chip@chip:~$ mkdir simple-server
chip@chip:~$ cd simple-server/
chip@chip:~/simple-server$ echo "Hello, This is my Tor hidden service!" > index.html
chip@chip:~/simple-server$ python -m SimpleHTTPServer 8000
Serving HTTP on 0.0.0.0 port 8000 ...

Code snippet #33

Plain text
chip@chip:~/simple-server$ sudo killall tor
[sudo] password for chip: 
chip@chip:~/simple-server$ tor
chip@chip:~ cat /usr/local/etc/tor/hidden_http_service/hostname
xxxxxxxxxxxxxx.onion

Code snippet #34

chip@chip:~/simple-server$ sudo killall tor
[sudo] password for chip: 
chip@chip:~/simple-server$ tor
chip@chip:~ cat /usr/local/etc/tor/hidden_http_service/hostname
xxxxxxxxxxxxxx.onion

Credits

Snehan Kekre

Snehan Kekre

0 projects • 2 followers

Comments