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

get_dns_servers() in winutil.py has a bug when there are multiple DNS nameservers #147

Open
Jeff17Robbins opened this issue Mar 11, 2021 · 0 comments

Comments

@Jeff17Robbins
Copy link

This code is wrong:

https://github.com/fireeye/flare-fakenet-ng/blob/596bb139b59eb15323510ed41e33661a40c8d80c/fakenet/diverters/winutil.py#L1102

Since the .Next field is a pointer, it needs to be dereferenced. Given the structure of the while loop, the correct code is:

ip_addr_string = ip_addr_string.Next.contents if ip_addr_string.Next else None

The bug probably hasn't been noticed if the code was tested on a machine with only one DNS nameserver IP address. If your machine has 2 or more DNS nameserver IP addresses, the code crashes on the 2nd time through the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant