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

Proper handling of hostname lookups #2

Open
freb opened this issue Mar 21, 2023 · 0 comments
Open

Proper handling of hostname lookups #2

freb opened this issue Mar 21, 2023 · 0 comments

Comments

@freb
Copy link
Contributor

freb commented Mar 21, 2023

Currently Chrome will use the systems DNS resolver to resolve hostnames before taking screenshots. Additionally, our code (when you use --all-hostnames) will attempt to resolve each hostname before including it in the list of targets.

There are a few shortcomings with this approach:

  1. It discards all of the resolution information already included in the nmap scans.
  2. It takes time re-resolving all hostnames (except user-defined ones)
  3. It does not allow manually specified hostname->ip mappings
  4. It does not allow screenshotting of targets by their hostnames if the mapping is not in /etc/hosts or publicly resolvable

The last one is the biggest issue. It is not uncommon for webservers to respond only to configured hostnames. If we know the hostname but cannot resolve it (even though we already know this information and have it documented in an nmap scan) then we will miss potentially interesting results.

AFAIK, the DevTools Protocol does not allow you to MiTM DNS requests. It does, however, allow you to issue the http requests on behalf of the browser. So for hostnames we want to resolve locally, we will need to hijack the requests and have go/rod issue the request with a custom resolver/transport.

We will likely need to update our Target object to include a resolved IP field. We'll also need to be able to get at this info from within the hijack handler.

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