mirror of https://github.com/daffainfo/nuclei.git
dev
parent
91ad446212
commit
6af462c215
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue