Skip to content

Commit

Permalink
Merge pull request #9 from assetnote/fix-gh-issue-8
Browse files Browse the repository at this point in the history
GH-8 Wordlist panic fix
  • Loading branch information
minight authored Apr 11, 2021
2 parents 0a0184b + 0fe7cbf commit e7a7fa6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/scan/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,23 @@ func LoadTextWordlist(fns []string, extensions []string, dirsearchCompatabilityM
return nil
}

if strings.HasSuffix(filename, ".kite") {
return fmt.Errorf("attempted to load kitefile as plain text wordlist: %s. Please provide a plain wordlist", filename)
}

if strings.HasSuffix(filename, ".json") {
return fmt.Errorf("attempted to load json as plain text wordlist: %s. Please provide a plain wordlist", filename)
}

lines, err := readLines(filename)
if err != nil {
return fmt.Errorf("failed to load file %s: %w", filename, err)
}

for _, v := range lines {
if len(v) == 0 {
continue
}
// ensure we prepend the / for a path
if v[0] != '/' {
v = append([]byte("/"), v...)
Expand Down

0 comments on commit e7a7fa6

Please sign in to comment.