Add Host information to JSON output file (#223)
This commit is contained in:
parent
88720dfdc9
commit
08ec6bad2a
@ -11,6 +11,7 @@
|
|||||||
- Changed
|
- Changed
|
||||||
- Added tls renegotiation flag to fix #193 in http.Client
|
- 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).
|
- 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
|
- v1.0.2
|
||||||
- Changed
|
- Changed
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package ffuf
|
|||||||
// Request holds the meaningful data that is passed for runner for making the query
|
// Request holds the meaningful data that is passed for runner for making the query
|
||||||
type Request struct {
|
type Request struct {
|
||||||
Method string
|
Method string
|
||||||
|
Host string
|
||||||
Url string
|
Url string
|
||||||
Headers map[string]string
|
Headers map[string]string
|
||||||
Data []byte
|
Data []byte
|
||||||
|
|||||||
@ -12,6 +12,7 @@ type ejsonFileOutput struct {
|
|||||||
CommandLine string `json:"commandline"`
|
CommandLine string `json:"commandline"`
|
||||||
Time string `json:"time"`
|
Time string `json:"time"`
|
||||||
Results []Result `json:"results"`
|
Results []Result `json:"results"`
|
||||||
|
Config *ffuf.Config `json:"config"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JsonResult struct {
|
type JsonResult struct {
|
||||||
@ -24,6 +25,7 @@ type JsonResult struct {
|
|||||||
RedirectLocation string `json:"redirectlocation"`
|
RedirectLocation string `json:"redirectlocation"`
|
||||||
ResultFile string `json:"resultfile"`
|
ResultFile string `json:"resultfile"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
|
Host string `json:"host"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type jsonFileOutput struct {
|
type jsonFileOutput struct {
|
||||||
@ -70,6 +72,7 @@ func writeJSON(config *ffuf.Config, res []Result) error {
|
|||||||
RedirectLocation: r.RedirectLocation,
|
RedirectLocation: r.RedirectLocation,
|
||||||
ResultFile: r.ResultFile,
|
ResultFile: r.ResultFile,
|
||||||
Url: r.Url,
|
Url: r.Url,
|
||||||
|
Host: r.Host,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
outJSON := jsonFileOutput{
|
outJSON := jsonFileOutput{
|
||||||
|
|||||||
@ -39,6 +39,7 @@ type Result struct {
|
|||||||
RedirectLocation string `json:"redirectlocation"`
|
RedirectLocation string `json:"redirectlocation"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
ResultFile string `json:"resultfile"`
|
ResultFile string `json:"resultfile"`
|
||||||
|
Host string `json:"host"`
|
||||||
HTMLColor string `json:"-"`
|
HTMLColor string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,6 +303,7 @@ func (s *Stdoutput) Result(resp ffuf.Response) {
|
|||||||
RedirectLocation: resp.GetRedirectLocation(false),
|
RedirectLocation: resp.GetRedirectLocation(false),
|
||||||
Url: resp.Request.Url,
|
Url: resp.Request.Url,
|
||||||
ResultFile: resp.ResultFile,
|
ResultFile: resp.ResultFile,
|
||||||
|
Host: resp.Request.Host,
|
||||||
}
|
}
|
||||||
s.Results = append(s.Results, sResult)
|
s.Results = append(s.Results, sResult)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,6 +106,8 @@ func (r *SimpleRunner) Execute(req *ffuf.Request) (ffuf.Response, error) {
|
|||||||
if _, ok := req.Headers["Host"]; ok {
|
if _, ok := req.Headers["Host"]; ok {
|
||||||
httpreq.Host = req.Headers["Host"]
|
httpreq.Host = req.Headers["Host"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.Host = httpreq.Host
|
||||||
httpreq = httpreq.WithContext(r.config.Context)
|
httpreq = httpreq.WithContext(r.config.Context)
|
||||||
for k, v := range req.Headers {
|
for k, v := range req.Headers {
|
||||||
httpreq.Header.Set(k, v)
|
httpreq.Header.Set(k, v)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user