LDAP
Pentesting LDAP - TCP Ports 389,3268,636,3269
Theory
Practice
UNIX-Like
#Simple bind authentification (-x) as anonymous.
ldapsearch -H ldap://$IP -x -s base namingcontextsldapsearch -H ldap://$IP -x -b "DC=contoso,DC=local"#With (objectClass=User) as the query and sAMAccountName the filter.
ldapsearch -H ldap://$IP -x -b "DC=contoso,DC=local" '(objectClass=User)' sAMAccountName#With (objectClass=User) as the query and sAMAccountName the filter.
ldapsearch -H ldap://$IP -x -D "CN=MyUser,CN=Users,DC=contoso,DC=local" -w Password1 -b "DC=contoso,DC=local" '(objectClass=User)' sAMAccountName
ldapsearch -H ldap://$IP -x -D "[email protected]" -w Password1 -b "DC=contoso,DC=local" '(objectClass=User)' sAMAccountName#Get TGT
kinit [email protected]
#List tickets
klist
#LdapSearch
ldapsearch -H ldap://$IP -Y GSSAPI -b "DC=contoso,DC=local" '(objectClass=User)' sAMAccountNameWindows
Last updated