diff --git a/CHANGELOG.md b/CHANGELOG.md index 035ae36..a2f5454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Changed - Added tls renegotiation flag to fix #193 in http.Client - Fixed HTML report to display select/combo-box for rows per page (and increased default from 10 to 250 rows). + - Added Host information to JSON output file - v1.0.2 - Changed diff --git a/pkg/ffuf/request.go b/pkg/ffuf/request.go index 98d07b8..ed3d3c4 100644 --- a/pkg/ffuf/request.go +++ b/pkg/ffuf/request.go @@ -3,6 +3,7 @@ package ffuf // Request holds the meaningful data that is passed for runner for making the query type Request struct { Method string + Host string Url string Headers map[string]string Data []byte diff --git a/pkg/output/file_json.go b/pkg/output/file_json.go index 508aa0c..43c7d44 100644 --- a/pkg/output/file_json.go +++ b/pkg/output/file_json.go @@ -9,9 +9,10 @@ import ( ) type ejsonFileOutput struct { - CommandLine string `json:"commandline"` - Time string `json:"time"` - Results []Result `json:"results"` + CommandLine string `json:"commandline"` + Time string `json:"time"` + Results []Result `json:"results"` + Config *ffuf.Config `json:"config"` } type JsonResult struct { @@ -24,6 +25,7 @@ type JsonResult struct { RedirectLocation string `json:"redirectlocation"` ResultFile string `json:"resultfile"` Url string `json:"url"` + Host string `json:"host"` } type jsonFileOutput struct { @@ -70,6 +72,7 @@ func writeJSON(config *ffuf.Config, res []Result) error { RedirectLocation: r.RedirectLocation, ResultFile: r.ResultFile, Url: r.Url, + Host: r.Host, }) } outJSON := jsonFileOutput{ diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index 87c3af6..d70524b 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -39,6 +39,7 @@ type Result struct { RedirectLocation string `json:"redirectlocation"` Url string `json:"url"` ResultFile string `json:"resultfile"` + Host string `json:"host"` HTMLColor string `json:"-"` } @@ -57,7 +58,7 @@ func (s *Stdoutput) Banner() error { // Print wordlists for _, provider := range s.config.InputProviders { if provider.Name == "wordlist" { - printOption([]byte("Wordlist"), []byte(provider.Keyword + ": " + provider.Value)) + printOption([]byte("Wordlist"), []byte(provider.Keyword+": "+provider.Value)) } } @@ -302,6 +303,7 @@ func (s *Stdoutput) Result(resp ffuf.Response) { RedirectLocation: resp.GetRedirectLocation(false), Url: resp.Request.Url, ResultFile: resp.ResultFile, + Host: resp.Request.Host, } s.Results = append(s.Results, sResult) } diff --git a/pkg/runner/simple.go b/pkg/runner/simple.go index 68eedcc..fccf601 100644 --- a/pkg/runner/simple.go +++ b/pkg/runner/simple.go @@ -106,6 +106,8 @@ func (r *SimpleRunner) Execute(req *ffuf.Request) (ffuf.Response, error) { if _, ok := req.Headers["Host"]; ok { httpreq.Host = req.Headers["Host"] } + + req.Host = httpreq.Host httpreq = httpreq.WithContext(r.config.Context) for k, v := range req.Headers { httpreq.Header.Set(k, v)