Skip to content

Commit 6c9716f

Browse files
committed
性能优化 2.5.3
1 parent 67534d9 commit 6c9716f

File tree

7 files changed

+40
-14
lines changed

7 files changed

+40
-14
lines changed

config/config.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,26 @@
5656
"naabu_dns": {},
5757
"naabu": {"TopPorts": "1000","ScanAllIPS": true,"Threads": 25},
5858
"priorityNmap": true,
59-
"nuclei": {},
59+
"nuclei": {
60+
"RateLimit": 150,
61+
"BulkSize":64,
62+
"TemplateThreads": 64,
63+
"HeadlessBulkSize": 10,
64+
"DisableRedirects": true,
65+
"HeadlessTemplateThreads": 10
66+
},
6067
"enablEmbedYaml": true,
6168
"enablFileFuzz": true,
6269
"enablNmapStdIO": false,
6370
"httpx": {
64-
"Pipeline": true,
65-
"HTTP2Probe": true,
66-
"VHost": true,
71+
"Pipeline": false,
72+
"HTTP2Probe": false,
73+
"VHost": false,
6774
"CSPProbe": true,
6875
"TLSProbe": true,
69-
"TechDetect": true
76+
"TechDetect": true,
77+
"FollowRedirects": false,
78+
"MaxRedirects": 3
7079
},
7180
"enableEsSv": false,
7281
"esthread": 8,

config/config_me.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,27 @@
5555
"KsubdomainRegxp": "([0-9a-zA-Z\\-]+\\.[0-9a-zA-Z\\-]+)$",
5656
"naabu_dns": {},
5757
"naabu": {"TopPorts": "1000","ScanAllIPS": true,"Threads": 64},
58-
"nuclei": {},
58+
"nuclei": {
59+
"RateLimit": 150,
60+
"BulkSize":64,
61+
"TemplateThreads": 64,
62+
"HeadlessBulkSize": 10,
63+
"DisableRedirects": true,
64+
"HeadlessTemplateThreads": 10
65+
},
5966
"priorityNmap": true,
6067
"enablEmbedYaml": true,
6168
"enablFileFuzz": true,
6269
"enablNmapStdIO": false,
6370
"httpx": {
64-
"Pipeline": true,
71+
"Pipeline": false,
6572
"HTTP2Probe": true,
6673
"VHost": true,
6774
"CSPProbe": true,
6875
"TLSProbe": true,
69-
"TechDetect": true
76+
"TechDetect": true,
77+
"FollowRedirects": false,
78+
"MaxRedirects": 3
7079
},
7180
"enableEsSv": true,
7281
"esthread": 8,

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"embed"
55
"fmt"
66
"github.com/hktalent/scan4all/pkg"
7+
"github.com/hktalent/scan4all/pkg/fingerprint"
78
naaburunner "github.com/hktalent/scan4all/pkg/naabu/v2/pkg/runner"
89
"github.com/projectdiscovery/gologger"
910
"io"
@@ -27,6 +28,8 @@ func main() {
2728
//if "true" == pkg.GetVal("autoRmCache") {
2829
// os.RemoveAll(pkg.GetVal(pkg.CacheName))
2930
//}
31+
// clear
32+
fingerprint.ClearData()
3033
}()
3134
options := naaburunner.ParseOptions()
3235
if options.Debug {

nuclei_Yaml/nuclei_yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func readConfig() {
113113
cfgFile = ""
114114
options.FollowRedirects = false
115115
options.MaxRedirects = 10
116-
options.DisableRedirects = false
116+
options.DisableRedirects = true
117117

118118
options.ReportingConfig = ""
119119
// 启动es记录

pkg/httpx/runner/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ func ParseOptions() *Options {
308308
options.HTTPProxy = ""
309309
options.Unsafe = false
310310
options.Resume = false
311-
options.FollowRedirects = true
312-
options.MaxRedirects = 10
311+
options.FollowRedirects = false
312+
options.MaxRedirects = 3
313313
options.FollowHostRedirects = false
314314
options.VHostInput = false
315315
options.Methods = ""

pkg/httpx/runner/runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,7 @@ retry:
12411241
technologies = append(technologies, match)
12421242
}
12431243
matchlocals := fingerprint.FingerScan(resp.Headers, resp.Data, title, ul, strconv.Itoa(resp.StatusCode))
1244-
// clear
1245-
fingerprint.ClearData()
1244+
12461245
for _, matchlocal := range matchlocals {
12471246
technologies = append(technologies, matchlocal)
12481247
}

pkg/util.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,22 @@ var (
3434

3535
func HttpRequsetBasic(username string, password string, urlstring string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error) {
3636
var tr *http.Transport
37+
var err error
3738
if HttpProxy != "" {
3839
uri, _ := url.Parse(HttpProxy)
3940
tr = &http.Transport{
4041
MaxIdleConnsPerHost: -1,
4142
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
4243
DisableKeepAlives: true,
4344
Proxy: http.ProxyURL(uri),
45+
IdleConnTimeout: 15 * time.Second,
4446
}
4547
} else {
4648
tr = &http.Transport{
4749
MaxIdleConnsPerHost: -1,
4850
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
4951
DisableKeepAlives: true,
52+
IdleConnTimeout: 15 * time.Second,
5053
}
5154
}
5255

@@ -74,7 +77,10 @@ func HttpRequsetBasic(username string, password string, urlstring string, method
7477
for v, k := range headers {
7578
req.Header[v] = []string{k}
7679
}
77-
resp, err := client.Do(req)
80+
var resp *http.Response
81+
82+
// resp, err = tr.RoundTrip(req)
83+
resp, err = client.Do(req)
7884
if err != nil {
7985
//防止空指针
8086
return &Response{"999", 999, "", nil, 0, "", ""}, err

0 commit comments

Comments
 (0)