Showing posts with label tor. Show all posts
Showing posts with label tor. Show all posts

# Pivoting with SSH port forwarding


# cat traceraser 
#!/bin/bash

localhost="127.0.0.1"

declare -A pivotA
pivotA[ip]="1.1.1.1"
pivotA[user]="userA"

declare -A pivotB
pivotB[ip]="2.2.2.2"
pivotB[user]="userB"

declare -A pivotC
pivotC[ip]="3.3.3.3"
pivotC[user]="userC"

declare -A pivotD
pivotD[ip]="4.4.4.4"
pivotD[user]="userD"

declare -A Destination
Destination[ip]="5.5.5.5"
Destination[user]="UserDest"

#echo "||||||||||||"
#echo "TOR Cloud"
echo " ||||||||||"
echo "Pivot ${pivotA[ip]}"
#usewithtor ssh ...  Only in the first hop
ssh -L $localhost:6661:${pivotB[ip]}:22 -f -N -p 22   ${pivotA[user]}@${pivotA[ip]}
echo "  ||||||||"
echo "Pivot ${pivotB[ip]}"
ssh -L $localhost:6662:${pivotC[ip]}:22 -f -N -p 6661 ${pivotB[user]}@$localhost
echo "   ||||||"
echo "Pivot ${pivotC[ip]}"
ssh -L $localhost:6663:${pivotD[ip]}:22 -f -N -p 6662 ${pivotC[user]}@$localhost
echo "    ||||"
echo "Pivot ${pivotD[ip]}"
ssh -D 1080                             -f -N -p 6663 ${pivotD[user]}@$localhost
echo "     ||"
echo "Destination ${Destination[ip]}"
tsocks ssh -p 22 ${Destination[user]}@${Destination[ip]}
killall ssh
# ./traceraser.sh
 ||||||||||
Pivot 1.1.1.1
  ||||||||
Pivot 2.2.2.2
   ||||||
Pivot 3.3.3.3
    ||||
Pivot 4.4.4.4
     ||
Destination 5.5.5.5
UserDest@5.5.5.5's password:

# Privoxy server together with Tor

Introduction

Privoxy user manual
Tor on Ubuntu

Execution
server# apt-get install privoxy tor
server# netstat -tan | grep -e 8118 -e 9050
server# cat /etc/privoxy/config | grep -v -e ^# -e ^$
server# sed -i 's/listen-address  localhost:8118/listen-address  192.168.0.100:8118/' /etc/privoxy/config
server# sed -i 's/#        forward-socks5   \/               127.0.0.1:9050 ./forward-socks5 \/ 127.0.0.1:9050 ./' /etc/privoxy/config
server# /etc/init.d/privoxy restart

client# export http_proxy='192.168.0.100:8118'
client# env | grep -i proxy
client# wget -q -O - http://ip-addr.es
137.56.163.64 (tory.uvt.nl)

# Tor from command-line

Introduction

Tor on Ubuntu

Execution
# echo "deb http://deb.torproject.org/torproject.org `lsb_release -cs` main" >> /etc/apt/sources.list
# gpg --keyserver keys.gnupg.net --recv 886DDD89
# gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
# apt-get update
# apt-get install tor tor-geoipdb
# apt-get install torsocks
# wget -q -O - http://ip-addr.es
x.x.62.13
# usewithtor wget -q -O - http://ip-addr.es
192.251.226.206 ( anonymizer2.blutmagie.de )
# usewithtor ssh foo@bar.net