Skip to content

vhosts support#295

Open
godfuzz3r wants to merge 2 commits intosensepost:masterfrom
godfuzz3r:master
Open

vhosts support#295
godfuzz3r wants to merge 2 commits intosensepost:masterfrom
godfuzz3r:master

Conversation

@godfuzz3r
Copy link
Copy Markdown

Hi, it seems I'm not alone who wants this feature:

Basically it checks whether input urls for scan file mode ends with ##<ipaddr> and utilizes host-resolver-rules and host-rules chrome flags (chromedp/chromedp#985 (comment))

##<ipaddr> is cutted from the end before passed into chromedp.Navigate

example usage:

echo -ne 'http://example.com/\nhttp://example.com:80/##127.0.0.1\nhttps://example.com/##94.142.255.18\n' | ./build/gowitness-3.0.5-linux-amd64 scan file -f - -D --screenshot-skip-save --write-screenshots --write-db --write-stdout --write-db-uri sqlite://gowitness.sqlite3

example output:
image

@leonjza
Copy link
Copy Markdown
Member

leonjza commented Nov 14, 2025

I've been wondering about the implementation here and I think we should instead of asking users to prepare files by adding a suffix for resolver information for each entry, rather have a command line option for this. I'm thinking something along the lines of resolver-override=example.com:127.0.0.1 (allowed to be specified multiple times ofc) or similar.

This obviously removes the ability to have per input file entry overrides like this PR gives, (I'm not sure about a use case where the same domain will need to have different resolution's), but makes parsing simpler while also making it compatible with any reader.

Anyone have thoughts?

@timkent
Copy link
Copy Markdown

timkent commented Jan 29, 2026

Anyone have thoughts?

I like the curl --resolve approach where one can selectively apply the override if the target port matches, however I realise in our case this is implemented by passing flags to chromedp so it will apply the override for that host to the whole request.

TL;DR your command line approach and format is best given the constraints.

@timkent
Copy link
Copy Markdown

timkent commented Jan 29, 2026

I like the curl --resolve approach where one can selectively apply the override if the target port matches, however I realise in our case this is implemented by passing flags to chromedp so it will apply the override for that host to the whole request.

Turns out I was wrong. The MAP rule format allows for an optional replacement port, and the source hostname pattern also allows for one.

@timkent
Copy link
Copy Markdown

timkent commented Jan 30, 2026

I raised a simple PR that passes through the host resolver rules as an option here: #309

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

Successfully merging this pull request may close these issues.

3 participants