Obfsproxy Installation and Configuration

From Fyzix
Jump to: navigation, search

Reference: https://www.void.gr/kargig/blog/2012/10/05/bypassing-censorship-devices-by-obfuscating-your-traffic-using-obfsproxy/

Reference: https://www.torproject.org/projects/obfsproxy-instructions.html.en#instructions

Installation

Install obfsproxy on Debian/Ubuntu

Prerequisites

Reference: https://www.torproject.org/docs/debian.html.en#ubuntu

Reference: https://www.torproject.org/projects/obfsproxy-debian-instructions.html.en#instructions

In this case I'm using Debian Jessie or Ubuntu Trusty.

Add the following:

Debian

/etc/apt/sources.list

# Obfsproxy
deb http://deb.torproject.org/torproject.org jessie main
deb-src http://deb.torproject.org/torproject.org jessie main
deb http://deb.torproject.org/torproject.org obfs4proxy main

Ubuntu Trusty

/etc/apt/sources.list

# Obfsproxy
deb http://deb.torproject.org/torproject.org trusty main
deb-src http://deb.torproject.org/torproject.org trusty main
deb http://deb.torproject.org/torproject.org obfs4proxy main

Add the GPG key for the repo

gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -

Preform apt-get update.

apt-get update
apt-get install tor deb.torproject.org-keyring

Upgrade is optional.

apt-get upgrade

Apt Installation

apt-get install obfsproxy obfs4proxy

Install obfsproxy on Arch

pacman -Sy obfsproxy

Install obfsproxy on Windows

Reference: https://nordvpn.com/tutorials/obfsproxy/windows/

Install Python 2.7

  • Filename: python-2.7.*.msi When installing please leave the default installation location which is C:\Python27\

Obtain Latest here: https://www.python.org/downloads/windows/

Obfsproxy python.jpg

Install Microsft Visual C++ Compiler for Python 2.7

Obtain Latest here: https://www.microsoft.com/en-us/download/details.aspx?id=44266

Obfsproxy msftvc.jpg

Install Win64 OpenSSL Light

  • Filename: Win64OpenSSL_Light-1_0_2g.exe

Obtain Latest here: https://slproweb.com/products/Win32OpenSSL.html

Obfsproxy openssl light.jpg

Fix Permissions for Python directory

  • Change your Python installation folder's security permissions by:
  1. Open Explorer
  2. Browse to c:\
  3. Right click Python27 directory -> Properties -> Security Tab
  4. Insure that Users, Administrators, and Authenticated Users have Full Control
  5. Click Ok - Save your changes

This will allow the next commands for pip upgrade to work without an Access Denied error.

Upgrade Python2.7 and install obsproxy

Run Command as Administrator

Obfsproxy cmd.jpg

Enter the following commands in the command prompt window:

cd C:\Python27\Scripts
pip install –upgrade pip
pip install obfsproxy

Tunnel SSH traffic through obfsproxy on Windows to remote Linux SSH server

Reference: http://www.vpnanswers.com/bypass-great-firewall-hide-openvpn-in-china-2015/

Linux Server side side configuration

On the Linux Server side, assuming the ssh server runs on port 22.

screen obfsproxy --log-min-severity=info obfs3 --dest=LOCAL_IP_ADDRESS:22 server 0.0.0.0:80

This will setup a local listener on port 80 that will forward SSH traffic to port 22.

Windows Client side configuration

On the Windows Client side, run command line as Administrator with the following command:

obfsproxy --log-min-severity=info obfs3 --dest=REMOTE_IP_OBFS_LISTENER:80 client 127.0.0.1:9999

This will define the remote destination where obfsproxy is listening on port 80, in addition to setting up a local listener for SSH connections on port 9999.

Configure Putty Client to use Obfsproxy

For the Hostname/IP point it to localhost 127.0.0.1 and port 9999 where the obsproxy local listener is waiting for connections to forward.

Obfsproxy putty.jpg

Tunnel Web browser via Obfsproxy and SSH tunnel

Taking this one step further, we can tunnel our web browser via Obfsproxy and the newly created SSH tunnel.

Configure Firefox to use SOCKS Proxy

Open Options -> Advanced -> Network -> Settings

Obfsproxy firefox1.jpg

For SOCKS Host: Enter 127.0.0.1 with port 1080

Obfsproxy firefox2.jpg

Configure Putty Client to create SOCKS proxy

Inside your new connection profile, browse to Tunnels

Obfsproxy putty socks tunnel1.jpg

Configure Source port 1080 and Destination blank, with Dynamic Radio button checked. Click Add.

Save the profile.

Obfsproxy putty socks tunnel2.jpg