windows10gegner
Goto Top

Danted Authentifizierung

Hallo,
ich will für E-Mail einen SOCKS5-Proxy aufsetzen (Google nervt zu oft mit den Hinweisen zu neuem Standort).
Das Ganze läuft auf einem Debian i386.

Ich habe dafür dante-server installiert, der läuft auch, ich will aber selbstverständlich eine Authentifizierung haben, was aber noch nicht funktioniert (username klappte nicht, danted wurde zum Test mit root-Rechten gestartet).
Ich habe mir dann PAM überlegt, bin mir da aber nicht sicher, wie man das umsetzen muss mit der User/PW-Datei, die ich erstellt habe.
Es ist mir recht egal wie das läuft, es muss nur einen User geben.
Das ist die aktuelle Konfiguration ohne Auth, ich habe natürlich den Server wieder gestoppt, er funktioniert aber.
root@server:/# cat /etc/danted.conf
#logging
#errorlog: /var/log/sockd.errlog
logoutput: /var/log/sockd.log
#debug: 2

#server address specification
internal: enp0s18 port = 1080
external: enp0s18

#server identities (not needed on solaris)
user.privileged: root
user.notprivileged: socks
#user.libwrap: libwrap

#reverse dns lookup
#srchost: nodnsmismatch

#authentication methods
clientmethod: none
socksmethod: none

##
## SOCKS client access rules
##
#rule processing stops at the first match, no match results in blocking

#block access to socks server from 192.0.2.22 (exception for pass rule below)
# client block {
#       #block connections from 192.0.2.22/32
#       from: 192.0.2.22/24 to: 0.0.0.0/0
#       log: error # connect disconnect
# }
#method: username
#allow connections from local network (192.0.2.0/24)
client pass {
        from: 0/0 to: 0/0
	log: error # connect disconnect
#	socksmethod: username
}
#client pass {
#	from: ::0/0 to: ::0/0
#}

##
## SOCKS command rules
##
#rule processing stops at the first match, no match results in blocking

#block communication with www.example.org
# socks block {
#        from: 0.0.0.0/0 to: www.example.org
#        command: bind connect udpassociate
#        log: error # connect disconnect iooperation
# }

#generic pass statement - bind/outgoing traffic
socks pass {  
        from: 0/0 to: 0/0
        command: bind connect udpassociate
        log: error # connect disconnect iooperation
}

#block incoming connections/packets from ftp.example.org 
# socks block {
#        from: ftp.example.org to: 0.0.0.0/0
#        command: bindreply udpreply
#        log: error # connect disconnect iooperation
# }

#generic pass statement for incoming connections/packets
socks pass {
        from: 0/0 to: 0/0
        command: bindreply udpreply
        log: error # connect disconnect iooperation
}

root@server:/# 

LG Win10Gegner

Content-Key: 604635

Url: https://administrator.de/contentid/604635

Printed on: April 24, 2024 at 23:04 o'clock

Mitglied: 145916
Solution 145916 Sep 16, 2020 updated at 10:25:31 (UTC)
Goto Top
username klappte nicht
Kann ja bei deiner Config auch nicht weil du die "authmethod" überhaupt nicht erlaubst und auch nirgendwo in den Rule-Blocks angibst

Ändere oben das socksmethod so ab
socksmethod: username
und unten in den socks rules einen Block mit
socks pass {  
        from: 0/0 to: 0/0
        command: bind connect udpassociate
        log: error connect
        socksmethod: username
}
Klappt hier problemlos, einfach mal mit curl den proxy gestestet mit
curl --socks5 X.X.X.X:1080 -U USERNAME:PASSWORD https://administrator.de
Ergo klappt hier einwandfrei.

User wird hier aus der lokalen Linux-Userdatenbank entnommen.

Das Manual ist wie immer dein Freund
https://linux.die.net/man/5/sockd.conf

hier ne bsp. config mit der ich intern getestet habe

internal: eth0 port = 1080
external: eth0

socksmethod: username

client pass {
	from: 192.168.1.0/24 to: 0.0.0.0/0
}

socks pass {
    from: 192.168.1.0/24 to: 0.0.0.0/0
    command: bind connect udpassociate
    log: connect error
    socksmethod: username
}
Member: Windows10Gegner
Windows10Gegner Sep 16, 2020 updated at 16:41:20 (UTC)
Goto Top
Vielen Dank, mit curl klappt es, aber nicht im Browser (Pale Moon, Firefox, Thunderbird).
Ich muss also eine Lösung suchen, wie ich dem SOCKS-Auth beibringe.

EDIT:claws-mail kann es, wird eben darauf umgestellt auf den Laptops.
Mitglied: 145916
145916 Sep 16, 2020 updated at 19:00:10 (UTC)
Goto Top
Zitat von @Windows10Gegner:

Vielen Dank, mit curl klappt es, aber nicht im Browser (Pale Moon, Firefox, Thunderbird).
Das liegt aber daran das Firefox selbst kein Socks 5 Auth unterstützt! Alle anderen Produkte die Socks5 Auth unterstützen funktionieren damit problemlos. Das ist also kein Dante Problem sondern der Fuchs kanns eben nicht.
Btw. bringt die Plaintext Auth sowieso kein Gewinn nur mal so nebenbei ...
Member: Windows10Gegner
Windows10Gegner Sep 16, 2020 at 19:53:13 (UTC)
Goto Top
Doch, denn der Angreifer muss schon meinen Datenverkehr mitschneiden, um an die Zugangsdaten ranzukommen. Sofern der das nicht kann hat er keinen Zugriff, ohne Auth aber schon, jeder Hansel aus aller Welt kann dann meinen Proxy nutzen und darüber Bockmist machen.
Mitglied: 145916
145916 Sep 16, 2020 updated at 20:56:19 (UTC)
Goto Top
der Angreifer muss schon meinen Datenverkehr mitschneiden, um an die Zugangsdaten ranzukommen.
Leichter als man als man vermuten mag.

So nen Proxy hängt man ja nicht freiwillig offen ins Netz. VPN und gut is, dann braucht es diesen Schmuh auch nicht wirklich .