From c454bc445f72d479772f36f854a268ab10e609de Mon Sep 17 00:00:00 2001 From: M09Ic Date: Mon, 12 Dec 2022 18:01:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=88=A0=E6=8E=89=E6=A0=B9?= =?UTF-8?q?=E6=8D=AEwaf=E6=8C=87=E7=BA=B9=E5=88=A4=E6=96=ADwaf,=20?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=8F=AF=E8=83=BD=E4=BC=9A=E6=9C=89=E5=A4=A7?= =?UTF-8?q?=E9=87=8F=E8=AF=AF=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/pool.go | 17 ++++++++++------- internal/runner.go | 4 +++- pkg/config.go | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/internal/pool.go b/internal/pool.go index 19bfb20..a7fbba8 100644 --- a/internal/pool.go +++ b/internal/pool.go @@ -391,13 +391,16 @@ func (pool *Pool) BaseCompare(bl *pkg.Baseline) bool { } bl.Collect() - for _, f := range bl.Frameworks { - if f.HasTag("waf") || f.HasTag("cdn") { - pool.Statistor.WafedNumber++ - bl.Reason = ErrWaf.Error() - return false - } - } + //if !pool.IgnoreWaf { + // // 部分情况下waf的特征可能是全局, 指定了--ignore-waf则不会进行waf的指纹检测 + // for _, f := range bl.Frameworks { + // if f.HasTag("waf") { + // pool.Statistor.WafedNumber++ + // bl.Reason = ErrWaf.Error() + // return false + // } + // } + //} if ok && status == 0 && base.FuzzyCompare(bl) { pool.Statistor.FuzzyNumber++ diff --git a/internal/runner.go b/internal/runner.go index 28ad82c..25e4ea4 100644 --- a/internal/runner.go +++ b/internal/runner.go @@ -60,7 +60,6 @@ type Runner struct { FuzzyFile *files.File DumpFile *files.File StatFile *files.File - Force bool Progress *uiprogress.Progress Offset int Limit int @@ -70,6 +69,8 @@ type Runner struct { ErrPeriod int BreakThreshold int CheckOnly bool + Force bool + IgnoreWaf bool } func (r *Runner) PrepareConfig() *pkg.Config { @@ -87,6 +88,7 @@ func (r *Runner) PrepareConfig() *pkg.Config { MatchExpr: r.MatchExpr, FilterExpr: r.FilterExpr, RecuExpr: r.RecursiveExpr, + IgnoreWaf: r.IgnoreWaf, } if config.Mod == pkg.PathSpray { config.ClientType = ihttp.FAST diff --git a/pkg/config.go b/pkg/config.go index 0596e89..33048f9 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -37,4 +37,5 @@ type Config struct { OutputCh chan *Baseline FuzzyCh chan *Baseline Fuzzy bool + IgnoreWaf bool }