diff --git a/internal/option.go b/internal/option.go index 3da4515..e96dc32 100644 --- a/internal/option.go +++ b/internal/option.go @@ -8,6 +8,7 @@ import ( "github.com/chainreactors/gogo/v2/pkg/fingers" "github.com/chainreactors/logs" "github.com/chainreactors/spray/pkg" + "github.com/chainreactors/spray/pkg/ihttp" "github.com/chainreactors/words/mask" "github.com/chainreactors/words/rule" "github.com/gosuri/uiprogress" @@ -71,6 +72,7 @@ type RequestOptions struct { //RandomUserAgent bool `long:"random-agent" description:"Bool, use random with default user-agent"` //Method string `long:"method" default:"GET" description:"String, custom method"` //Cookie string `long:"cookie" description:"String, custom cookie"` + MaxBodyLength int `long:"max-length" default:"100" description:"Int, max response body length, default 100k, e.g. -max-length 1000"` } type ModeOptions struct { @@ -168,9 +170,8 @@ func (opt *Option) PrepareRunner() (*Runner, error) { r.Progress.Start() logs.Log.Writer = r.Progress.Bypass() } - if opt.SimhashDistance != 0 { - pkg.Distance = uint8(opt.SimhashDistance) - } + pkg.Distance = uint8(opt.SimhashDistance) + ihttp.DefaultMaxBodySize = opt.MaxBodyLength * 1024 if opt.Force { // 如果开启了force模式, 将关闭check机制, err积累到一定数量自动退出机制 diff --git a/pkg/baseline.go b/pkg/baseline.go index fc51ce4..4882f12 100644 --- a/pkg/baseline.go +++ b/pkg/baseline.go @@ -323,8 +323,8 @@ func (bl *Baseline) ColorString() string { line.WriteString(" - ") line.WriteString(logs.YellowBold(strconv.Itoa(int(bl.Spended)) + "ms")) line.WriteString(logs.GreenLine(bl.Additional("title"))) - line.WriteString(logs.Blue(bl.Frameworks.String())) - line.WriteString(logs.Blue(bl.Extracteds.String())) + line.WriteString(logs.Cyan(bl.Frameworks.String())) + line.WriteString(logs.Cyan(bl.Extracteds.String())) if bl.RedirectURL != "" { line.WriteString(" --> ") line.WriteString(logs.CyanLine(bl.RedirectURL)) diff --git a/pkg/ihttp/client.go b/pkg/ihttp/client.go index 10f29cb..11c6078 100644 --- a/pkg/ihttp/client.go +++ b/pkg/ihttp/client.go @@ -31,7 +31,7 @@ func NewClient(thread int, timeout int, clientType int) *Client { MaxConnWaitTimeout: time.Duration(timeout) * time.Second, ReadTimeout: time.Duration(timeout) * time.Second, WriteTimeout: time.Duration(timeout) * time.Second, - ReadBufferSize: 8192, + ReadBufferSize: 16384, MaxResponseBodySize: DefaultMaxBodySize, NoDefaultUserAgentHeader: true, DisablePathNormalizing: true,