mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-23 16:35:25 +00:00
Adding truncation info on debug
This commit is contained in:
parent
c83072b0d7
commit
b55dac6ae2
@ -564,7 +564,8 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate
|
|||||||
}
|
}
|
||||||
|
|
||||||
responseContentType := resp.Header.Get("Content-Type")
|
responseContentType := resp.Header.Get("Content-Type")
|
||||||
dumpResponse(event, request.options, response.fullResponse, formedURL, responseContentType)
|
isResponseTruncated := len(gotData) >= request.MaxSize
|
||||||
|
dumpResponse(event, request.options, response.fullResponse, formedURL, responseContentType, isResponseTruncated)
|
||||||
|
|
||||||
callback(event)
|
callback(event)
|
||||||
}
|
}
|
||||||
@ -622,7 +623,7 @@ func (request *Request) setCustomHeaders(req *generatedRequest) {
|
|||||||
|
|
||||||
const CRLF = "\r\n"
|
const CRLF = "\r\n"
|
||||||
|
|
||||||
func dumpResponse(event *output.InternalWrappedEvent, requestOptions *protocols.ExecuterOptions, redirectedResponse []byte, formedURL string, responseContentType string) {
|
func dumpResponse(event *output.InternalWrappedEvent, requestOptions *protocols.ExecuterOptions, redirectedResponse []byte, formedURL string, responseContentType string, isResponseTruncated bool) {
|
||||||
cliOptions := requestOptions.Options
|
cliOptions := requestOptions.Options
|
||||||
if cliOptions.Debug || cliOptions.DebugResponse {
|
if cliOptions.Debug || cliOptions.DebugResponse {
|
||||||
response := string(redirectedResponse)
|
response := string(redirectedResponse)
|
||||||
@ -634,7 +635,12 @@ func dumpResponse(event *output.InternalWrappedEvent, requestOptions *protocols.
|
|||||||
highlightedResult = responsehighlighter.Highlight(event.OperatorsResult, response, cliOptions.NoColor, false)
|
highlightedResult = responsehighlighter.Highlight(event.OperatorsResult, response, cliOptions.NoColor, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
gologger.Debug().Msgf("[%s] Dumped HTTP response for %s\n\n%s", requestOptions.TemplateID, formedURL, highlightedResult)
|
msg := "[%s] Dumped HTTP response %s\n\n%s"
|
||||||
|
if isResponseTruncated {
|
||||||
|
msg = "[%s] Dumped HTTP response (Truncated) %s\n\n%s"
|
||||||
|
}
|
||||||
|
|
||||||
|
gologger.Debug().Msgf(msg, requestOptions.TemplateID, formedURL, highlightedResult)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user