Skip to content

Instantly share code, notes, and snippets.

@duketwo
Created November 22, 2017 03:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save duketwo/19ea6a01bf8059da219ed0962367a4be to your computer and use it in GitHub Desktop.
Save duketwo/19ea6a01bf8059da219ed0962367a4be to your computer and use it in GitHub Desktop.
Dante-Server (danted) install script (Debian 8 - Jessie)
# Dante-Server install script (Debian 8 - Jessie)
# Start with 'chmod +x danted_install_script.sh && danted_install_script.sh'
# duketwo - 12.11.2017
random_pw=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
network_adapter=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
username="SallySample"
port="31337"
public_ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo "Random password: $random_pw"
echo "deb-src http://ftp.de.debian.org/debian/ sid main non-free contrib" >> /etc/apt/sources.list
echo "deb http://ftp.de.debian.org/debian/ sid main non-free contrib" >> /etc/apt/sources.list
apt-get update && apt-get install dante-server curl
useradd -s /sbin/nologin $username
echo "$username:$random_pw"|chpasswd
rm /etc/danted.conf
echo "socksmethod: username" >> /etc/danted.conf
echo "internal: $network_adapter port = 31337" >> /etc/danted.conf
echo "external: $network_adapter" >> /etc/danted.conf
echo "external.rotation: same-same" >> /etc/danted.conf
echo "client pass {" >> /etc/danted.conf
echo "from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0" >> /etc/danted.conf
echo "}" >> /etc/danted.conf
echo "socks pass {" >> /etc/danted.conf
echo "from: 0.0.0.0/0 to: 0.0.0.0/0" >> /etc/danted.conf
echo "socksmethod: username" >> /etc/danted.conf
echo "user: $username" >> /etc/danted.conf
echo "protocol: tcp udp" >> /etc/danted.conf
echo "}" >> /etc/danted.conf
/etc/init.d/danted start
echo "Username: $username Password: $random_pw IP: $public_ip"
echo "If the following line contains the public ip [$public_ip], the proxy is working."
curl --socks5 $username:$random_pw@$public_ip:31337 http://whoer.net/ip
@ofit
Copy link

ofit commented Jun 10, 2019

need install "dnsutils" because of dig command not installed by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment