Danted Socks Proxy with Authentication

authenticationdantePROXYsocks

I've been trying to set up a SOCKS proxy on linux with danted. I have the proxy working perfectly without authentication, but when I try adding in authentication with both method: username and method: pam I can't log in with any of the usernames or passwords that I set.

When using method: pam this is the configuration I use

logoutput: stderr /var/log/danted.log

/#Interfaces for listening on
internal: eth0 port=1080 #AP external interface
internal: eth0 port=53
external: eth0 #interface on AODV network

/#Auth Method
method: pam

user.privileged: root
user.notprivileged: nobody
user.libwrap: nobody

client pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    log: error
}

/#Allow any connection
pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    command: connect udpassociate
    protocol: udp tcp
    log: error
    method: pam
    pamservicename: sockd
 }

But when I run danted -d I an authentication error about a bad username and password. My Pam configuration is

auth required pam_pwdfile.so pwdfile /etc/danted/sockd.passwd
account required pam_permit.so

and usernames and passwords are created with htpasswd -d to force crypt().

I also tried it with method: username and i get the same issue with a system password userauthentication failed. I am testing these with the proxifier proxy checker and they always return bad username or password.

I am currently running it without any authentication so getting this issue fixed is quite important.

I created a new user called 'test' with password 'password' and this is the error I got

Jul 12 14:45:07 ip-172-31-26-147 danted: pam_pwdfile(sockd:auth): setting fail delay 
Jul 12 14:45:07 ip-172-31-26-147 danted: pam_pwdfile(sockd:auth): username is estt 
Jul 12 14:45:07 ip-172-31-26-147 danted: pam_pwdfile(sockd:auth): user not found in password database

Best Answer

I fixed the issue eventually by removing the version of dante I had installed via apt and replacing it with one I downloaded from the dante website and compiled from source. There must be a bug in the version in ubuntu's repositories.