SOCKS5 Installation & Configuration
ev3restDue to high demand in proxy and VPNs, I wanted to create my own SOCKS5 Proxy, but the lack of material online and the amount of problems I encountered during the whole procedure made me write these instructions. Good luck and enjoy the freedom!
We will be using dante-server 1.4.1
My server
- OS: Debian 9
- Host: DigitalOcean
Installation
We will be installing danted-server
from the source
- Download the installation file with
wget
http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
- Install gdebi with
apt-get install gdebi-core
sudo gdebi dante-server_1.4.1-1.amd64.deb
to installdante-server
withgdebi
Configuration
nano /etc/danted.conf
Your configuration should look like this:
# /etc/danted.conf logoutput: syslog user.privileged: root user.unprivileged: nobody # The listening network interface or address. internal: eth0 port=1080 # The proxying network interface or address. external: eth0 # socks-rules determine what is proxied through the external interface. # The default of "none" permits anonymous access. socksmethod: username # client-rules determine who can connect to the internal interface. # The default of "none" permits anonymous access. clientmethod: none client pass { from: 0.0.0.0/0 to: 0.0.0.0/0 log: connect disconnect error socksmethod: username } socks pass { from: 0.0.0.0/0 to: 0.0.0.0/0 command: bind connect udpassociate log: error # connect disconnect iooperation socksmethod: username } socks pass{ from: 0.0.0.0/0 to: 0.0.0.0/0 command: bindreply udpreply log: error # connect disconnect iooperation }
The only values you might want to change are internal
, external
and the port
, where:
internal
&external
must be changed to whatever interface your server is using. You can find it by callingifconfig
.port
is your desired port to use. 1080 is a default socks5 port, but I wouldn't recommend using it, as various people might be interested in scanning those.
Open the Port
- We will have to open the port in the iptables list in order to allow connections. Simply type:
sudo iptables -A INPUT -p tcp --dport 1080 --jump ACCEPT
Where 1080
should be your port number.
Add user
adduser --disabled-login --no-create-home <name>
Where <name>
stands for username
passwd <name>
to set a password for the user
Launch
service danted stop
service danted start
@ev3me 2018