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

Make -H 'Host: my-server' set Host Header on Requests #272

Closed
wants to merge 1 commit into from

Conversation

ryohare
Copy link

@ryohare ryohare commented Dec 31, 2020

Found myself needing to dirbust with a custom host header to hit the right vhost. Couldnt find it in the tool, so I figured I'd add it.

It the libgobuster http client is initialized with a host header, req.Host will be set from the header value stored in the struct.

Opened and issue for this: #271.

@firefart
Copy link
Collaborator

firefart commented Jan 4, 2021

Hi @ryohare ,
thanks but this is wrongly implemented and will break VHOST mode. Currently there is the Host field on libgobuster.RequestOptions which should be passed from the single modes instead.

@firefart
Copy link
Collaborator

firefart commented Jan 4, 2021

Ah sorry missed the exception, this should work. Will add a few modifications and comments to it, thanks!

@ryohare
Copy link
Author

ryohare commented Jan 4, 2021

I saw the Host parameter being passed in for the VHost mode, so yeah, I added it as the else in the if. Parsed out the host in the constructor for minor perf increases.

One thing I considered but would defer to the team here was adding the host parameter as an argument, like user-agent is. Just went with it as a header to make it a less significant user facing change....

@firefart firefart closed this in 44d4693 Jan 4, 2021
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.

None yet

2 participants