mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 11:40:13 +00:00
保留类似http的指定任意字段输出的能力
This commit is contained in:
parent
5c48bce5d4
commit
0cf6bf3a19
@ -93,6 +93,55 @@ func (bl *baseline) FuzzyEqual(other *baseline) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (bl *baseline) Get(key string) string {
|
||||||
|
switch key {
|
||||||
|
case "url":
|
||||||
|
return bl.Url
|
||||||
|
case "host":
|
||||||
|
return bl.Host
|
||||||
|
case "title":
|
||||||
|
return bl.Title
|
||||||
|
case "redirect":
|
||||||
|
return bl.RedirectURL
|
||||||
|
case "md5":
|
||||||
|
if bl.Hashes != nil {
|
||||||
|
return bl.Hashes.BodyMd5
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
case "simhash":
|
||||||
|
if bl.Hashes != nil {
|
||||||
|
return bl.Hashes.BodySimhash
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
case "mmh3":
|
||||||
|
if bl.Hashes != nil {
|
||||||
|
return bl.Hashes.BodySimhash
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
case "stat", "status":
|
||||||
|
return strconv.Itoa(bl.Status)
|
||||||
|
case "spend":
|
||||||
|
return strconv.Itoa(bl.Spended)
|
||||||
|
//case "extract":
|
||||||
|
// return bl.Extracteds
|
||||||
|
case "frame", "framework":
|
||||||
|
return bl.Frameworks.ToString()
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bl *baseline) Additional(key string) string {
|
||||||
|
if v := bl.Get(key); v != "" {
|
||||||
|
return "[" + v + "]"
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
func (bl *baseline) String() string {
|
func (bl *baseline) String() string {
|
||||||
var line strings.Builder
|
var line strings.Builder
|
||||||
//line.WriteString("[+] ")
|
//line.WriteString("[+] ")
|
||||||
@ -107,11 +156,8 @@ func (bl *baseline) String() string {
|
|||||||
line.WriteString(bl.RedirectURL)
|
line.WriteString(bl.RedirectURL)
|
||||||
line.WriteString(" ")
|
line.WriteString(" ")
|
||||||
}
|
}
|
||||||
line.WriteString(" [" + bl.Title + "]")
|
line.WriteString(bl.Additional("title"))
|
||||||
if bl.Hashes != nil {
|
line.WriteString(bl.Additional("mmh3"))
|
||||||
line.WriteString(" [" + bl.Hashes.BodyMd5 + "]")
|
|
||||||
}
|
|
||||||
|
|
||||||
line.WriteString(bl.Frameworks.ToString())
|
line.WriteString(bl.Frameworks.ToString())
|
||||||
//line.WriteString(bl.Extracteds)
|
//line.WriteString(bl.Extracteds)
|
||||||
//line.WriteString("\n")
|
//line.WriteString("\n")
|
||||||
|
@ -12,7 +12,8 @@ import (
|
|||||||
type Option struct {
|
type Option struct {
|
||||||
URL string `short:"u" long:"url"`
|
URL string `short:"u" long:"url"`
|
||||||
URLFile string `short:"l" long:"list"`
|
URLFile string `short:"l" long:"list"`
|
||||||
WordLists []string `short:"w" long:"word"`
|
Dictionaries []string `short:"d" long:"dict"`
|
||||||
|
Word string `short:"w" long:"word"`
|
||||||
Extension string `short:"e" long:"extensions"`
|
Extension string `short:"e" long:"extensions"`
|
||||||
ExcludeExtensions bool `long:"exclude-extensions"`
|
ExcludeExtensions bool `long:"exclude-extensions"`
|
||||||
RemoveExtensions bool `long:"remove-extensions"`
|
RemoveExtensions bool `long:"remove-extensions"`
|
||||||
@ -82,18 +83,23 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
|||||||
logs.Log.Importantf("load %d urls from %s", len(r.URLList), urlfrom)
|
logs.Log.Importantf("load %d urls from %s", len(r.URLList), urlfrom)
|
||||||
|
|
||||||
// prepare word
|
// prepare word
|
||||||
words := make([][]string, len(opt.WordLists))
|
dicts := make([][]string, len(opt.Dictionaries))
|
||||||
for i, f := range opt.WordLists {
|
for i, f := range opt.Dictionaries {
|
||||||
words[i], err = loadFileToSlice(f)
|
dicts[i], err = loadFileToSlice(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
logs.Log.Importantf("load %d word from %s", len(r.Wordlist), f)
|
logs.Log.Importantf("load %d word from %s", len(r.Wordlist), f)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, w := range words {
|
if opt.Word == "" {
|
||||||
r.Wordlist = append(r.Wordlist, w...)
|
for _, w := range dicts {
|
||||||
|
r.Wordlist = append(r.Wordlist, w...)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo mask
|
// todo mask
|
||||||
|
|
||||||
// prepare header
|
// prepare header
|
||||||
|
Loading…
x
Reference in New Issue
Block a user