diff --git a/v2/pkg/protocols/file/operators.go b/v2/pkg/protocols/file/operators.go index 0dcbb22f..9f71ccde 100644 --- a/v2/pkg/protocols/file/operators.go +++ b/v2/pkg/protocols/file/operators.go @@ -1,7 +1,6 @@ package file import ( - "log" "time" "github.com/projectdiscovery/nuclei/v2/pkg/model" @@ -125,7 +124,6 @@ func (request *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) [] result.FileToIndexPosition = make(map[string]int) } result.FileToIndexPosition[result.Matched] = calculateFileIndexFunc(allMatches, extraction) - log.Fatalf("%s %#v\n", extraction, result.FileToIndexPosition) } } return results diff --git a/v2/pkg/protocols/file/request.go b/v2/pkg/protocols/file/request.go index adf6e31d..c35b0645 100644 --- a/v2/pkg/protocols/file/request.go +++ b/v2/pkg/protocols/file/request.go @@ -4,6 +4,7 @@ import ( "bufio" "encoding/hex" "io" + "log" "os" "sort" "strings" @@ -112,6 +113,7 @@ func (request *Request) ExecuteWithResults(input string, metadata, previous outp } outputEvent["all_matches"] = allMatches + log.Printf("%#v\n", result) callback(eventcreator.CreateEventWithResults(request, outputEvent, isResponseDebug, result)) request.options.Progress.IncrementRequests() }(data) @@ -171,12 +173,10 @@ func calculateFileIndexFunc(allMatches []*output.InternalEvent, extraction strin for _, match := range allMatches { matchPt := *match opResult := matchPt["results"].(operators.Result) - if opResult.Matched { - for _, extracts := range opResult.Extracts { - for _, extract := range extracts { - if extraction == extract { - return matchPt["results"].(int) - } + for _, extracts := range opResult.Extracts { + for _, extract := range extracts { + if extraction == extract { + return matchPt["bytes"].(int) } } }