Skip to content
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

Hanging When Retrieving LDAP Objects #15

Open
quantumburnz opened this issue Apr 20, 2023 · 2 comments
Open

Hanging When Retrieving LDAP Objects #15

quantumburnz opened this issue Apr 20, 2023 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@quantumburnz
Copy link

Hi,
When running RustHound against a large domain, RustHound eventually hangs at "LDAP objects received: xxxxx". The TCP/389 connection is still open (observed via tcpdump) but it appears the DC stops sending data (for an unknown reason) and just sends ACKs. In the following code block, it appears RustHound just continues to wait indefinitely. Perhaps a timeout could be set and RustHound can resend the request if it hasn't received a response by the timeout?

// Wait and get next values
let pb = ProgressBar::new(1);
let mut count = 0;	
while let Some(entry) = search.next().await? {
	let entry = SearchEntry::construct(entry);
	//trace!("{:?}", &entry);
	// Manage progress bar
	count += 1;
	progress_bar(pb.to_owned(),"LDAP objects retreived".to_string(),count,"#".to_string());	
	// Push all result in rs vec()
	rs.push(entry);
}
pb.finish_and_clear();
@g0h4n g0h4n self-assigned this Apr 21, 2023
@g0h4n
Copy link
Collaborator

g0h4n commented Apr 21, 2023

Hi quantumburnz,

I think it's possible to add with_timeout() to ldap object. https://docs.rs/ldap3/latest/ldap3/struct.Ldap.html#method.with_timeout

In our case, the use of .await? interrupts the execution of the asynchronous function and waits for a promise to be resolved. When the promise is resolved (held or broken), the value is returned and the execution of the asynchronous function resumes.

I would like to know if in your case "LDAP objects received: xxxxx" remains blocked? Or it continues to be incremented?

@quantumburnz
Copy link
Author

with_timeout() looks very promising @g0h4n !

"LDAP objects received: xxxxx" remains blocked. To elaborate, it makes it to a high number and stops. However, I'm guessing the .await? never interrupts because the TCP session with the DC is still open so RustHound expects the DC will send more data at some point but it never does after waiting more than an hour.

@g0h4n g0h4n added the help wanted Extra attention is needed label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants