Skip to content

Commit

Permalink
default socket buf use 16k
Browse files Browse the repository at this point in the history
default http MaxIdleConns use 2000
update parsers
  • Loading branch information
M09Ic committed Jul 2, 2024
1 parent 816d08e commit 4c04ac3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/chainreactors/fingers v0.0.0-20240701112353-ecc7954b4673
github.com/chainreactors/logs v0.0.0-20240207121836-c946f072f81f
github.com/chainreactors/neutron v0.0.0-20240628163951-679753df51f6
github.com/chainreactors/parsers v0.0.0-20240701110332-2f9057256d29
github.com/chainreactors/parsers v0.0.0-20240702070344-29de1801cc02
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/jessevdk/go-flags v1.5.0
Expand Down
2 changes: 2 additions & 0 deletions v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ github.com/chainreactors/parsers v0.0.0-20240701105750-c2a861a16b82 h1:XMqF4VxXh
github.com/chainreactors/parsers v0.0.0-20240701105750-c2a861a16b82/go.mod h1:91mj0+pHkKsXd1SGD6+jVW1tl6W25TuXgoESwK5dJh8=
github.com/chainreactors/parsers v0.0.0-20240701110332-2f9057256d29 h1:0RJnI9nDGao3LUSnqWhcg0ELex4RUlVvGY+SfAMuDSQ=
github.com/chainreactors/parsers v0.0.0-20240701110332-2f9057256d29/go.mod h1:91mj0+pHkKsXd1SGD6+jVW1tl6W25TuXgoESwK5dJh8=
github.com/chainreactors/parsers v0.0.0-20240702070344-29de1801cc02 h1:IIV25etvLEs5S2mv3MMNScNgP+ZrTaiWVG/v/vZn+Q8=
github.com/chainreactors/parsers v0.0.0-20240702070344-29de1801cc02/go.mod h1:91mj0+pHkKsXd1SGD6+jVW1tl6W25TuXgoESwK5dJh8=
github.com/chainreactors/utils v0.0.0-20240302165634-2b8494c9cfc3/go.mod h1:JA4eiQZm+7AsfjXBcIzIdVKBEhDCb16eNtWFCGTxlvs=
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1 h1:+awuysRKLmdLQbVK+HPSOGvO3dFGdNSbM2jyLh+VYOA=
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1/go.mod h1:JA4eiQZm+7AsfjXBcIzIdVKBEhDCb16eNtWFCGTxlvs=
Expand Down
5 changes: 4 additions & 1 deletion v2/internal/plugin/Dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ type RunnerOpts struct {
Opsec bool // enable opsec
}

var RunOpt RunnerOpts
var (
RunOpt RunnerOpts
DefaultMaxSize = 1024 * 16 // 16k
)

func Dispatch(result *pkg.Result) {
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/plugin/httpScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func initScan(result *pkg.Result) {
bs, err = conn.Read(RunOpt.Delay)
if err != nil {
senddataStr := fmt.Sprintf("GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", result.Uri, target)
bs, err = conn.Request([]byte(senddataStr), 4096)
bs, err = conn.Request([]byte(senddataStr), DefaultMaxSize)
if err != nil {
result.Err = err
}
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func HttpConnWithNoRedirect(delay int) *http.Client {
//DualStack: true,
}).DialContext,
MaxIdleConnsPerHost: 1,
MaxIdleConns: 4000,
MaxIdleConns: 2000,
IdleConnTimeout: time.Duration(delay) * time.Second,
DisableKeepAlives: false,
}
Expand Down

0 comments on commit 4c04ac3

Please sign in to comment.