Skip to content

Instantly share code, notes, and snippets.

@rampageX
Forked from duketwo/danted_install_script.sh
Created April 12, 2020 09:41
Show Gist options
  • Save rampageX/e17e617ce74317dc53b7a7262177d80b to your computer and use it in GitHub Desktop.
Save rampageX/e17e617ce74317dc53b7a7262177d80b 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment