Skip to content

Instantly share code, notes, and snippets.

@bwindsor
Created September 30, 2018 00:08
Show Gist options
  • Save bwindsor/e3e63e8c4c53d4e153c3f14dfcf0bb71 to your computer and use it in GitHub Desktop.
Save bwindsor/e3e63e8c4c53d4e153c3f14dfcf0bb71 to your computer and use it in GitHub Desktop.
Obfuscated VPN setup on EC2
  • Create an EC2 instance with Ubuntu 18.04 (I used t3.nano), and ssh into it
  • sudo apt-get update
  • sudo apt-get upgrade
  • Install PiVPN with curl -L https://install.pivpn.io | bash
  • Follow the on screen instructions. Mostly use defaults but the protocol must be TCP, and I chose 1443 as my port
  • Install obfsproxy with pip install obfsproxy
  • Create a service file /etc/systemd/system/obfsproxy.service with contents
[Unit]
Description=Obfsproxy server
After=network.target
After=syslog.target

[Service]
ExecStart=/usr/bin/obfsproxy --log-min-severity=info obfs3 --dest=127.0.0.1:1443 server 0.0.0.0:2443
Restart=always

[Install]
WantedBy=multi-user.target
  • sudo systemctl enable obfsproxy and sudo systemctl start obfsproxy
  • Check that 1443 and 2443 are listening with netstat -plnt
  • On the EC2 security group add a rule to allow all TCP traffic on port 2443
  • Create a user and private key for the VPN with pivpn add then enter the desired username and password
  • SCP the .opvn file off and get it onto your phone somehow
  • I used this OpenVPN Client and paid the few pounds for it, because it supports obfs3 obfuscation.
  • Import the .opvn file into the app, and change the setting under remote servers >> edit remote server >> use proxy. Change the value to obfsproxy (obfs3)
  • It should connect!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment