MCPcopy Index your code
hub / github.com/devploit/nomore403 / printResponse

Function printResponse

cmd/requester.go:858–973  ·  view source on GitHub ↗

printResponse prints the results of HTTP requests in a tabular format with colored output based on the status codes.

(result Result, technique string)

Source from the content-addressed store, hash-verified

856
857// printResponse prints the results of HTTP requests in a tabular format with colored output based on the status codes.
858func printResponse(result Result, technique string) {
859 printMutex.Lock()
860 defer printMutex.Unlock()
861 result.technique = technique
862 result.score = scoreResult(result)
863 result.likelihood = classifyLikelihood(result.score)
864 result.scoreReason = scoreReason(result)
865 result.familyKey = resultFamilyKey(result)
866
867 // If verbose mode is enabled, directly print the result
868 if getVerbose() || technique == "http-versions" || technique == "http-parser" {
869 printResult(result)
870 writeResultToOutput(result, technique)
871 markTechniqueProduced(technique)
872 recordFinding(result)
873 return
874 }
875
876 // In non-verbose (smart) mode: only show results that differ from the default response.
877 // Default request itself is always shown.
878 if !result.defaultReq && !isInteresting(result) {
879 return
880 }
881 if !result.defaultReq && result.score == 0 {
882 return
883 }
884
885 // Filter by specific status codes if filtering is enabled
886 if len(statusCodes) > 0 {
887 statusMatch := false
888 for _, code := range statusCodes {
889 if strconv.Itoa(result.statusCode) == code {
890 statusMatch = true
891 break
892 }
893 }
894 if !statusMatch {
895 return
896 }
897 }
898
899 // Check for unique global output if uniqueOutput is enabled
900 if uniqueOutput {
901 globalKey := fmt.Sprintf("%d-%d", result.statusCode, result.contentLength)
902
903 uniqueResultsMutex.Lock()
904 if uniqueResults[globalKey] {
905 uniqueResultsMutex.Unlock()
906 return
907 }
908 uniqueResults[globalKey] = true
909 uniqueResultsMutex.Unlock()
910 }
911
912 // Additional deduplication by technique
913 uniqueResultsByTechMutex.Lock()
914 if _, exists := uniqueResultsByTechnique[technique]; !exists {
915 uniqueResultsByTechnique[technique] = make(map[string]bool)

Callers 15

requestDefaultFunction · 0.85
requestMethodsFunction · 0.85
requestHeadersFunction · 0.85
requestEndPathsFunction · 0.85
requestMidPathsFunction · 0.85
requestDoubleEncodingFunction · 0.85
requestUnicodeEncodingFunction · 0.85
requestPayloadPositionsFunction · 0.85
requestHttpVersionsFunction · 0.85

Calls 10

scoreResultFunction · 0.85
classifyLikelihoodFunction · 0.85
scoreReasonFunction · 0.85
resultFamilyKeyFunction · 0.85
getVerboseFunction · 0.85
printResultFunction · 0.85
writeResultToOutputFunction · 0.85
markTechniqueProducedFunction · 0.85
recordFindingFunction · 0.85
isInterestingFunction · 0.85