You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here i'm trying to gather information from the internal domain which is accessed through ligolo tunnel. Net exec and other tools work fine in this setup but bloodhound python fails to do so.
Here is the sample ldap connection that i have written to test if is is a library issue but here it works fine
Here is the connection with bloodhound python to the same server in similar env
Here the connection remains close but on the sample script that i've used has a connection open
from ldap3 import Server, Connection, NTLM, ALL
ldap_server = 'ldap://{IP}:389'
domain = ''
username = ''
password = ''
user_ntlm = f"{domain}\\{username}"
print("[DEBUG] LDAP server URL:", ldap_server)
print("[DEBUG] NTLM User:", user_ntlm)
try:
print("[DEBUG] Creating server object...")
server = Server(ldap_server, get_info=ALL) # Use get_info=ALL for full server info
print("[DEBUG] Server object created:", server)
print("[DEBUG] Establishing connection with NTLM authentication...")
conn = Connection(
server,
user=user_ntlm,
password=password,
authentication=NTLM,
auto_bind=True
)
print(conn)
print("[INFO] Successfully connected and bound to the LDAP server!")
search_base = 'DC=,DC='
search_filter = '(objectClass=user)'
attributes = ['cn']
print(f"[DEBUG] Performing LDAP search in base '{search_base}' with filter '{search_filter}'...")
conn.search(search_base, search_filter, attributes=attributes)
except Exception as e:
print("[ERROR] An error occurred during LDAP operation:")
print(e)
finally:
if 'conn' in locals() and conn.bound:
print("[DEBUG] Unbinding connection...")
conn.unbind()
print("[INFO] Connection unbound.")
print("Connection unbound.")
The text was updated successfully, but these errors were encountered:
EDIT: Post Further debugging it is noticed that when querying the dc it is resolving to another internal ip as it is part of 2 subnets, rather than the specified dc hostname - ip mentioned on the resolv.conf.
This is causing bloodhound to resolve to the second ip which isn't reachable from the tunnel 1
It would be useful if we can have a -dc-ip feature which would be used for building up the ldap connection string
shyam0904a
changed the title
Bloodhound connection issues when used with ligolo-ng
Bloodhound connection issues when multiple dns ip's are resolved
Jan 15, 2025
Here i'm trying to gather information from the internal domain which is accessed through ligolo tunnel. Net exec and other tools work fine in this setup but bloodhound python fails to do so.
Here is the sample ldap connection that i have written to test if is is a library issue but here it works fine
Here is the connection with bloodhound python to the same server in similar env
Here the connection remains close but on the sample script that i've used has a connection open
The text was updated successfully, but these errors were encountered: