New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTLM cache does not work if authentication source uses comma separated DCs IP #3776

Closed
cmammoli opened this Issue Nov 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@cmammoli
Copy link
Contributor

cmammoli commented Nov 12, 2018

I was trying out ntlm cache and couldn't get it to work. Enabled debug and noticed secretsdump gets called this way:

/usr/local/pf/addons/AD/secretsdump.py 'packetfence':'password'@192.168.0.7,192.168.0.76 -just-dc-ntlm -output /tmp/J54dtYqiAA -usersfile /usr/local/pf/var/cache/ntlm_cache_users/APRA.valid-users.txt

which running manually returns:

Impacket v0.9.15 - Copyright 2002-2016 Core Security Technologies

[-] RemoteOperations failed: [Errno Connection error (192.168.0.7,192.168.0.76:445)] [Errno -2] Name or service not known
[*] Cleaning up...

I'm using 2 DCs in the authentication source:

[apra-user-auth-dc01]
cache_match=0
realms=apra,apra.it,default,null
basedn=dc=apra,dc=it
password=password
set_access_level_action=
scope=sub
email_attribute=mail
usernameattribute=sAMAccountName
connection_timeout=5
binddn=cn=packetfence,cn=Users,dc=apra,dc=it
encryption=starttls
port=389
description=Apra User authentication
host=192.168.0.7,192.168.0.76
type=AD
read_timeout=10
write_timeout=5
monitor=1
dynamic_routing_module=AuthModule
shuffle=0

@julsemaan

This comment has been minimized.

Copy link
Contributor

julsemaan commented Nov 12, 2018

The NTLM cache code was written without considering multiple IP addresses would be used in the host value of LDAP.

If you want a quick fix, use a DNS record for your LDAP host, I'll create a fix that picks the first LDAP server and put it in the maintenance when I have a moment.

Thanks for the really detailed troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment