mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-09 03:56:42 +00:00
新增--distance参数, 控制simhash阈值
This commit is contained in:
parent
5fdbd5e05d
commit
9b99c2a0b2
@ -47,10 +47,11 @@ type OutputOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RequestOptions struct {
|
type RequestOptions struct {
|
||||||
Headers []string `long:"header"`
|
Headers []string `long:"header"`
|
||||||
Method string `long:"method"`
|
Method string `long:"method"`
|
||||||
Cookie string `long:"cookie"`
|
Cookie string `long:"cookie"`
|
||||||
Force bool `long:"force"`
|
Force bool `long:"force"`
|
||||||
|
SimhashDistance int `long:"distance"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MiscOptions struct {
|
type MiscOptions struct {
|
||||||
@ -99,6 +100,10 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
|||||||
logs.Log.Writer = r.Progress.Bypass()
|
logs.Log.Writer = r.Progress.Bypass()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if opt.SimhashDistance != 0 {
|
||||||
|
pkg.Distance = uint8(opt.SimhashDistance)
|
||||||
|
}
|
||||||
|
|
||||||
if opt.Force {
|
if opt.Force {
|
||||||
breakThreshold = 999999
|
breakThreshold = 999999
|
||||||
}
|
}
|
||||||
|
@ -116,9 +116,11 @@ func (bl *Baseline) Compare(other *Baseline) int {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var Distance uint8
|
||||||
|
|
||||||
func (bl *Baseline) FuzzyCompare(other *Baseline) bool {
|
func (bl *Baseline) FuzzyCompare(other *Baseline) bool {
|
||||||
// todo 模糊匹配
|
// todo 模糊匹配
|
||||||
if parsers.SimhashCompare(other.BodySimhash, bl.BodySimhash) < 3 {
|
if parsers.SimhashCompare(other.BodySimhash, bl.BodySimhash) < Distance {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user