Skip to content

Commit f9dc71f

Browse files
committed
优化模糊匹配,提高正确率、鲁棒性;集成ksubdomain进度10%
1 parent 28efef9 commit f9dc71f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+592
-112
lines changed

brute/admin_brute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func getinput(inputurl string) (usernamekey string, passwordkey string, loginurl
1515
usernamekey = "username"
1616
passwordkey = "password"
1717
if req, err := pkg.HttpRequset(inputurl, "GET", "", true, nil); err == nil {
18-
if strings.Contains(req.Body, "md5.js") {
18+
if pkg.StrContains(req.Body, "md5.js") {
1919
ismd5 = true
2020
}
2121
u, err := url.Parse(req.RequestUrl)

brute/check_loginpage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func CheckLoginPage(inputurl string) bool {
2525
}
2626
hrefurl := u.ResolveReference(href)
2727
if reqcss, err := pkg.HttpRequset(hrefurl.String(), "GET", "", true, nil); err == nil {
28-
if strings.Contains(reqcss.Body, "login") || strings.Contains(reqcss.Body, "Login") {
28+
if pkg.StrContains(reqcss.Body, "login") {
2929
return true
3030
}
3131
}

brute/fuzzfingerprints.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import (
88

99
func addfingerprints404(technologies []string, req *pkg.Response) []string {
1010
// StatusCode 404
11-
if strings.Contains(req.Body, "thinkphp") {
11+
if pkg.StrContains(req.Body, "thinkphp") {
1212
technologies = append(technologies, "ThinkPHP")
1313
}
14-
if strings.Contains(req.Body, "Hypertext Transfer Protocol") {
14+
if pkg.StrContains(req.Body, "Hypertext Transfer Protocol") {
1515
technologies = append(technologies, "Weblogic")
1616
}
17-
if strings.Contains(req.Body, "font-family:Tahoma,Arial,sans-serif") {
17+
if pkg.StrContains(req.Body, "font-family:Tahoma,Arial,sans-serif") {
1818
technologies = append(technologies, "Apache Tomcat")
1919
}
20-
if strings.Contains(req.Body, "Whitelabel Error Page") {
20+
if pkg.StrContains(req.Body, "Whitelabel Error Page") {
2121
technologies = append(technologies, "Spring")
2222
}
2323
return technologies
@@ -40,24 +40,24 @@ func addfingerprintsnormal(payload string, technologies []string, req *pkg.Respo
4040
technologies = append(technologies, "Apache Tomcat")
4141
}
4242
case "/console/login/LoginForm.jsp":
43-
if req.StatusCode == 200 && strings.Contains(req.Body, "Oracle") {
43+
if req.StatusCode == 200 && pkg.StrContains(req.Body, "Oracle") {
4444
technologies = append(technologies, "Weblogic")
4545
}
4646
case "/wls-wsat", "/wls-wsat/CoordinatorPortType", "/wls-wsat/CoordinatorPortType11", "/_async/AsyncResponseService", "/_async/AsyncResponseServiceSoap12", "/uddiexplorer/SearchPublicRegistries.jsp", "/ws_utc/config.do":
47-
if req.StatusCode == 200 && (strings.Contains(req.Body, "weblogic") || strings.Contains(req.Body, "www.bea.com")) {
47+
if req.StatusCode == 200 && (pkg.StrContains(req.Body, "weblogic") || strings.Contains(req.Body, "www.bea.com")) {
4848
technologies = append(technologies, "Weblogic")
4949
}
5050
case "/jmx-console/":
51-
if req.StatusCode == 200 && strings.Contains(req.Body, "jboss.css") {
51+
if req.StatusCode == 200 && pkg.StrContains(req.Body, "jboss.css") {
5252
technologies = append(technologies, "Jboss")
5353
}
5454
case "/seeyon/":
55-
if strings.Contains(req.Body, "/seeyon/common/") {
55+
if pkg.StrContains(req.Body, "/seeyon/common/") {
5656
technologies = append(technologies, "seeyon")
5757
}
5858
case "/admin", "/admin-console", "/admin.asp", "/admin.aspx", "/admin.do", "/admin.html", "/admin.jsp", "/admin.php", "/admin/", "/admin/admin", "/admin/adminLogin.do", "/admin/checkLogin.do", "/admin/index.do", "/Admin/Login", "/admin/Login.aspx", "/admin/login.do", "/admin/menu", "/Adminer", "/adminer.php", "/administrator", "/adminLogin.do", "/checkLogin.do", "/doc/page/login.asp", "/login", "/Login.aspx", "/login/login", "/login/Login.jsp", "/manage", "/manage/login.htm", "/management", "/manager", "/manager.aspx", "/manager.do", "/manager.jsp", "/manager.jspx", "/manager.php", "/memadmin/index.php", "/myadmin/login.php", "/Systems/", "/user-login.html", "/wp-login.php":
5959
if reqlogin, err := pkg.HttpRequset(req.RequestUrl, "GET", "", true, nil); err == nil {
60-
if strings.Contains(reqlogin.Body, "<input") && (strings.Contains(reqlogin.Body, "pass") || strings.Contains(reqlogin.Body, "Pass") || strings.Contains(reqlogin.Body, "PASS")) {
60+
if pkg.StrContains(reqlogin.Body, "<input") && (pkg.StrContains(reqlogin.Body, "pass") || strings.Contains(reqlogin.Body, "Pass") || strings.Contains(reqlogin.Body, "PASS")) {
6161
technologies = append(technologies, "AdminLoginPage")
6262
username, password, loginurl := Admin_brute(req.RequestUrl)
6363
if loginurl != "" {
@@ -66,15 +66,15 @@ func addfingerprintsnormal(payload string, technologies []string, req *pkg.Respo
6666
}
6767
}
6868
case "/zabbix/":
69-
if strings.Contains(req.Body, "www.zabbix.com") {
69+
if pkg.StrContains(req.Body, "www.zabbix.com") {
7070
technologies = append(technologies, "zabbix")
7171
}
7272
case "/grafana/":
73-
if strings.Contains(req.Body, "grafana-app") {
73+
if pkg.StrContains(req.Body, "grafana-app") {
7474
technologies = append(technologies, "Grafana")
7575
}
7676
case "/zentao/":
77-
if strings.Contains(req.Body, "zentao/theme") {
77+
if pkg.StrContains(req.Body, "zentao/theme") {
7878
technologies = append(technologies, "zentao")
7979
}
8080
case "/actuator", "/actuator/archaius", "/actuator/auditevents", "/actuator/autoconfig", "/actuator/bindings", "/actuator/caches", "/actuator/channels", "/actuator/conditions", "/actuator/configprops", "/actuator/env", "/actuator/env.json", "/actuator/health", "/actuator/health.json", "/actuator/heapdump", "/actuator/hystrix.stream", "/actuator/integrationgraph", "/actuator/mappings", "/actuator/metrics", "/actuator/routes", "/actuator/scheduledtasks", "/actuator/service-registry":

brute/weblogic_brute.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package brute
33
import (
44
"fmt"
55
"github.com/hktalent/scan4all/pkg"
6-
"strings"
76
)
87

98
// weblogic默认的登陆尝试次数为5次,5次失败则weblogic用户锁定,即使你已经找到正确的密码,也不能登陆到console;默认的锁定时间为30分钟
@@ -13,7 +12,7 @@ func Weblogic_brute(url string) (username string, password string) {
1312
if req.StatusCode == 200 {
1413
for uspa := range weblogicuserpass {
1514
if req2, err2 := pkg.HttpRequset(url+"/console/j_security_check", "POST", fmt.Sprintf("j_username=%s&j_password=%s", weblogicuserpass[uspa].username, weblogicuserpass[uspa].password), true, nil); err2 == nil {
16-
if strings.Contains(req2.RequestUrl, "console.portal") {
15+
if pkg.StrContains(req2.RequestUrl, "console.portal") {
1716
pkg.BurteLog(fmt.Sprintf("Found vuln Weblogic password|%s:%s|%s\n", weblogicuserpass[uspa].username, weblogicuserpass[uspa].password, url+"/console/"))
1817
return weblogicuserpass[uspa].username, weblogicuserpass[uspa].password
1918
}

config/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"HydraPass": "",
5151
"UrlPrecise": true,
5252
"ParseSSl": false,
53+
""
5354
"EnableSubfinder": false,
5455
"naabu_dns": {},
5556
"naabu": {"TopPorts": "1000","ScanAllIPS": true},

go.mod

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
//naabu
66
require (
77
github.com/google/gopacket v1.1.19
8-
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
8+
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
99
github.com/projectdiscovery/blackrock v0.0.0-20210415162320-b38689ae3a2e
1010
github.com/projectdiscovery/cdncheck v0.0.4-0.20220322144854-b2d8ce308abb
1111
github.com/projectdiscovery/clistats v0.0.8
@@ -133,9 +133,11 @@ require (
133133
github.com/aymerick/douceur v0.2.0 // indirect
134134
github.com/bits-and-blooms/bitset v1.2.0 // indirect
135135
github.com/bits-and-blooms/bloom/v3 v3.0.1 // indirect
136+
github.com/boy-hack/ksubdomain v1.9.5 // indirect
136137
github.com/c4milo/unpackit v0.1.0 // indirect
137138
github.com/caddyserver/certmagic v0.16.1 // indirect
138139
github.com/cespare/xxhash v1.1.0 // indirect
140+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
139141
github.com/dgraph-io/ristretto v0.0.3 // indirect
140142
github.com/dimchansky/utfbom v1.1.1 // indirect
141143
github.com/docker/go-units v0.4.0 // indirect
@@ -181,6 +183,7 @@ require (
181183
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect
182184
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
183185
github.com/magiconair/properties v1.8.6 // indirect
186+
github.com/mattn/go-colorable v0.1.12 // indirect
184187
github.com/mattn/go-isatty v0.0.14 // indirect
185188
github.com/mattn/go-runewidth v0.0.13 // indirect
186189
github.com/mholt/acmez v1.0.2 // indirect
@@ -200,6 +203,7 @@ require (
200203
github.com/projectdiscovery/reflectutil v0.0.0-20210804085554-4d90952bf92f // indirect
201204
github.com/projectdiscovery/yamldoc-go v1.0.3-0.20211126104922-00d2c6bb43b6 // indirect
202205
github.com/rivo/uniseg v0.2.0 // indirect
206+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
203207
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
204208
github.com/segmentio/ksuid v1.0.4 // indirect
205209
github.com/shirou/gopsutil/v3 v3.22.5 // indirect
@@ -215,6 +219,7 @@ require (
215219
github.com/trivago/tgo v1.0.7 // indirect
216220
github.com/ulikunitz/xz v0.5.10 // indirect
217221
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect
222+
github.com/urfave/cli/v2 v2.10.3 // indirect
218223
github.com/valyala/bytebufferpool v1.0.0 // indirect
219224
github.com/valyala/fasttemplate v1.2.1 // indirect
220225
github.com/weppos/publicsuffix-go v0.15.1-0.20210928183822-5ee35905bd95 // indirect
@@ -223,6 +228,7 @@ require (
223228
github.com/xdg-go/scram v1.0.2 // indirect
224229
github.com/xdg-go/stringprep v1.0.2 // indirect
225230
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
231+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
226232
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
227233
github.com/ysmood/goob v0.4.0 // indirect
228234
github.com/ysmood/gson v0.7.1 // indirect
@@ -235,6 +241,7 @@ require (
235241
goftp.io/server/v2 v2.0.0 // indirect
236242
golang.org/x/mod v0.4.2 // indirect
237243
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
244+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
238245
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
239246
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 // indirect
240247
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect

go.sum

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
127127
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
128128
github.com/bluele/gcache v0.0.2 h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw=
129129
github.com/bluele/gcache v0.0.2/go.mod h1:m15KV+ECjptwSPxKhOhQoAFQVtUFjTVkc3H8o0t/fp0=
130+
github.com/boy-hack/ksubdomain v1.9.5 h1:wx9Klabaqh7o6BcDuMNKASBtC1oZiMcefkwTbVc7GX8=
131+
github.com/boy-hack/ksubdomain v1.9.5/go.mod h1:dyctXGqSvDRbQc5mNQk6WrYC0nR7+bMK3wT+h0TngOk=
130132
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8=
131133
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67NmW1aVLEgtA8Yy1elc+X8y5SRW1sFW4Og=
132134
github.com/c4milo/unpackit v0.1.0 h1:91pWJ6B3svZ4LOE+p3rnyucRK5fZwBdF/yQ/pcZO31I=
@@ -157,7 +159,10 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
157159
github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
158160
github.com/corpix/uarand v0.2.0 h1:U98xXwud/AVuCpkpgfPF7J5TQgr7R5tqT8VZP5KWbzE=
159161
github.com/corpix/uarand v0.2.0/go.mod h1:/3Z1QIqWkDIhf6XWn/08/uMHoQ8JUoTIKc2iPchBOmM=
162+
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
160163
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
164+
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
165+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
161166
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
162167
github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU=
163168
github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ=
@@ -457,6 +462,7 @@ github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPK
457462
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
458463
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
459464
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
465+
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
460466
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
461467
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
462468
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
@@ -536,6 +542,8 @@ github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV
536542
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
537543
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
538544
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
545+
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI=
546+
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
539547
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
540548
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
541549
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
@@ -674,7 +682,10 @@ github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6po
674682
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
675683
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
676684
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
685+
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
677686
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
687+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
688+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
678689
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
679690
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
680691
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
@@ -767,6 +778,8 @@ github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
767778
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
768779
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 h1:TtyC78WMafNW8QFfv3TeP3yWNDG+uxNkk9vOrnDu6JA=
769780
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6/go.mod h1:h8272+G2omSmi30fBXiZDMkmHuOgonplfKIKjQWzlfs=
781+
github.com/urfave/cli/v2 v2.10.3 h1:oi571Fxz5aHugfBAJd5nkwSk3fzATXtMlpxdLylSCMo=
782+
github.com/urfave/cli/v2 v2.10.3/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
770783
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
771784
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
772785
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
@@ -789,6 +802,8 @@ github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6
789802
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
790803
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
791804
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
805+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
806+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
792807
github.com/yl2chen/cidranger v1.0.2 h1:lbOWZVCG1tCRX4u24kuM1Tb4nHqWkDxwLdoS+SevawU=
793808
github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g=
794809
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
@@ -1060,6 +1075,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
10601075
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10611076
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10621077
golang.org/x/sys v0.0.0-20210915083310-ed5796bab164/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1078+
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10631079
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10641080
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10651081
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

nuclei_Yaml/internal/runner/runner.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bufio"
55
"context"
66
"encoding/json"
7+
"github.com/hktalent/scan4all/pkg"
78
"net/http"
89
_ "net/http/pprof"
910
"os"
@@ -16,6 +17,7 @@ import (
1617
"go.uber.org/atomic"
1718
"go.uber.org/ratelimit"
1819

20+
"github.com/hktalent/scan4all/nuclei_Yaml/internal/colorizer"
1921
"github.com/projectdiscovery/gologger"
2022
"github.com/projectdiscovery/nuclei/v2/pkg/catalog"
2123
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/config"
@@ -43,7 +45,6 @@ import (
4345
yamlwrapper "github.com/projectdiscovery/nuclei/v2/pkg/utils/yaml"
4446
"github.com/projectdiscovery/retryablehttp-go"
4547
"github.com/projectdiscovery/stringsutil"
46-
"github.com/hktalent/scan4all/nuclei_Yaml/internal/colorizer"
4748
)
4849

4950
// Runner is a client for running the enumeration process.
@@ -470,7 +471,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
470471
if r.templatesConfig != nil && r.templatesConfig.NucleiLatestVersion != "" {
471472
builder.WriteString(" (")
472473

473-
if strings.Contains(config.Version, "-dev") {
474+
if pkg.StrContains(config.Version, "-dev") {
474475
builder.WriteString(r.colorizer.Blue("development").String())
475476
} else if config.Version == r.templatesConfig.NucleiLatestVersion {
476477
builder.WriteString(r.colorizer.Green("latest").String())

pkg/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ import (
66
"io/ioutil"
77
"log"
88
"os"
9+
"strings"
910
)
1011

12+
func StrContains(s1, s2 string) bool {
13+
return strings.Contains(strings.ToLower(s1), strings.ToLower(s2))
14+
}
15+
1116
type Config4scanAllModel struct {
1217
EsUlr string `json:"EsUlr"`
1318
EnableSubfinder string `json:"EnableSubfinder"`

pkg/fingerprint/matchfinger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func iskeyword(str string, keyword []string) bool {
99
var x bool
1010
x = true
1111
for _, k := range keyword {
12-
if strings.Contains(str, k) {
12+
if strings.Contains(strings.ToLower(str), strings.ToLower(k)) {
1313
x = x && true
1414
} else {
1515
x = x && false

pkg/httpx/common/httpx/httpx.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package httpx
33
import (
44
"crypto/tls"
55
"fmt"
6+
"github.com/hktalent/scan4all/pkg"
67
"io"
78
"io/ioutil"
89
"net/http"
@@ -175,7 +176,7 @@ get_response:
175176
if err != nil {
176177
// Edge case - some servers respond with gzip encoding header but uncompressed body, in this case the standard library configures the reader as gzip, triggering an error when read.
177178
// The bytes slice is not accessible because of abstraction, therefore we need to perform the request again tampering the Accept-Encoding header
178-
if !gzipRetry && strings.Contains(err.Error(), "gzip: invalid header") {
179+
if !gzipRetry && pkg.StrContains(err.Error(), "gzip: invalid header") {
179180
gzipRetry = true
180181
req.Header.Set("Accept-Encoding", "identity")
181182
goto get_response

0 commit comments

Comments
 (0)