Jan 22, 2025

Dante

Install Dante

$ sudo apt update
$ sudo apt install dante-server
$  danted -v
$  sudo mv /etc/danted.conf /etc/danted.conf.bak
$  sudo vim /etc/danted.conf

logoutput: /var/log/socks.log
internal: eth0 port = 3128
external: eth0
clientmethod: none
socksmethod: username
user.privileged: root
user.notprivileged: nobody
client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
}
client block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}
socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        command: bind connect udpassociate
        log: error connect disconnect
        socksmethod: username
}
socks block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error
}

$ sudo vim /lib/systemd/system/danted.service

[Unit]
Description=SOCKS (v4 and v5) proxy daemon (danted)
Documentation=man:danted(8) man:danted.conf(5)
After=network.target
[Service]
Type=simple
PIDFile=/run/danted.pid
ExecStart=/usr/sbin/danted
ExecStartPre=/bin/sh -c ' \
        uid=`sed -n -e "s/[[:space:]]//g" -e "s/#.*//" -e "/^user\\.privileged/{s/[^:]*://p;q;}" /etc/danted.conf`; \
        if [ -n "$uid" ]; then \
                touch /var/run/danted.pid; \
                chown $uid /var/run/danted.pid; \
        fi \
        '
PrivateTmp=yes
InaccessibleDirectories=/boot /home /media /mnt /opt /root
ReadOnlyDirectories=/bin /etc /lib -/lib64 /sbin /usr /var
DeviceAllow=/dev/null rw
ReadWriteDirectories=/var/log
[Install]
WantedBy=multi-user.target

$ systemctl daemon-reload
$ sudo systemctl status danted
$ sudo systemctl restart danted

Check Port

$ apt install net-tools
$ netstat -an | grep 3128

Log

$ less /var/log/socks.log
$ cat  /etc/danted.conf

Create User

$ sudo useradd -r -s /bin/false dante
$ passwd dante

Check public IP address

$ curl ipinfo.io/ip
$ curl icanhazip.com
$ curl -4 icanhazip.com
$ curl ifconfig.me
$ curl api.ipify.org
$ curl bot.whatismyipaddress.com
$ curl ipecho.net/plain

Check public IP address via Proxy

$ curl -v -x socks5://dante:password@server_ip:3128 ipinfo.io/ip

No comments:

Post a Comment

Kubernetes

kubectl installation $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl...