sensepost / gowitness

🔍 gowitness - a golang, web screenshot utility using Chrome Headless
GNU General Public License v3.0
2.87k stars 329 forks source link

User Agent flag does not change user agent #36

Closed thelikes closed 4 years ago

thelikes commented 4 years ago

Problem: User-Agent is always "Go-http-client/1.1"

Expected behavior: According to the binary's help documentation, the default UA is supposed to be "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36", though, testing shows it is "Go-http-client/1.1" without using the --user-agent flag. Setting the --user-agent flag to something different , also results the same - "Go-http-client/1.1"

I noticed this due to many of the screenshots saying something along the lines of "prove you're not a bot".

Please let me know how to fix this, or if it is my mistake. Also, thank you for the excellent tool!

leonjza commented 4 years ago

Interesting. So requests within gowitness ultimately happen in two places. The first just probes the site using the gorequest http library, and the second is from Chrome. The Chrome User-Agent gets passed on here and the gorequest User-Agent here, so I would not expect to see the golang default User-Agent anywhere.

Will definitely have to test this and see whats going on.