mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 11:40:13 +00:00
--fuzzy-status添加特殊情况 "all", 所有类型的状态码都会启用对应的模糊匹配
This commit is contained in:
parent
c263c11926
commit
6287a8e468
@ -219,7 +219,11 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
||||
|
||||
BlackStatus = parseStatus(BlackStatus, opt.BlackStatus)
|
||||
WhiteStatus = parseStatus(WhiteStatus, opt.WhiteStatus)
|
||||
if opt.FuzzyStatus == "all" {
|
||||
enableAllFuzzy = true
|
||||
} else {
|
||||
FuzzyStatus = parseStatus(FuzzyStatus, opt.FuzzyStatus)
|
||||
}
|
||||
|
||||
// prepare word
|
||||
dicts := make([][]string, len(opt.Dictionaries))
|
||||
|
@ -18,7 +18,6 @@ import (
|
||||
"golang.org/x/time/rate"
|
||||
"net/url"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -30,6 +29,7 @@ var (
|
||||
MaxRedirect = 3
|
||||
MaxCrawl = 3
|
||||
MaxRecursion = 0
|
||||
enableAllFuzzy = false
|
||||
nilBaseline = &pkg.Baseline{}
|
||||
)
|
||||
|
||||
@ -369,13 +369,13 @@ func (pool *Pool) Handler() {
|
||||
"random": pool.random,
|
||||
"current": bl,
|
||||
}
|
||||
for _, status := range FuzzyStatus {
|
||||
if bl, ok := pool.baselines[status]; ok {
|
||||
params["bl"+strconv.Itoa(status)] = bl
|
||||
} else {
|
||||
params["bl"+strconv.Itoa(status)] = nilBaseline
|
||||
}
|
||||
}
|
||||
//for _, status := range FuzzyStatus {
|
||||
// if bl, ok := pool.baselines[status]; ok {
|
||||
// params["bl"+strconv.Itoa(status)] = bl
|
||||
// } else {
|
||||
// params["bl"+strconv.Itoa(status)] = nilBaseline
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
var status bool
|
||||
@ -700,7 +700,7 @@ func (pool *Pool) addAddition(u *Unit) {
|
||||
}
|
||||
|
||||
func (pool *Pool) addFuzzyBaseline(bl *pkg.Baseline) {
|
||||
if _, ok := pool.baselines[bl.Status]; !ok && iutils.IntsContains(FuzzyStatus, bl.Status) {
|
||||
if _, ok := pool.baselines[bl.Status]; !ok && (enableAllFuzzy || iutils.IntsContains(FuzzyStatus, bl.Status)) {
|
||||
bl.Collect()
|
||||
pool.waiter.Add(1)
|
||||
pool.doCrawl(bl)
|
||||
|
Loading…
x
Reference in New Issue
Block a user