# 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