Skip to content

Commit

Permalink
fix HoneyportDetection 2022-07-21
Browse files Browse the repository at this point in the history
  • Loading branch information
x51pwn committed Jul 21, 2022
1 parent bb20ba9 commit b815bc6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ UrlPrecise=true ./scan4all -l xx.txt
- 指纹半自动化学习,提高精准度

# 变更日志
- 2022-07-20 fix and PR nuclei <a href=https://github.com/projectdiscovery/nuclei/pull/2308>#2301</a> 并发多实例的bug
- 2022-07-20 fix and PR nuclei <a href=https://github.com/projectdiscovery/nuclei/issues/2301>#2301</a> 并发多实例的bug
- 2022-07-20 add web cache vulnerability scanner
- 2022-07-19 PR nuclei <a href=https://github.com/projectdiscovery/nuclei/pull/2308>#2308</a> add dsl function: substr aes_cbc
- 2022-07-19 添加dcom Protocol enumeration network interfaces
Expand Down
2 changes: 1 addition & 1 deletion lib/HoneypotDetection.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func HoneyportDetection(host string) bool {
defer resp.Body.Close()
if resp.StatusCode == 200 {
if a, ok := resp.Header["Server"]; ok {
if 1 < len(a[0]) || 3 < len(strings.Split(a[0], ",")) {
if 50 < len(a[0]) || 3 < len(strings.Split(a[0], ",")) {
hdCache.Store(szK, true)
return true
}
Expand Down
2 changes: 1 addition & 1 deletion projectdiscovery/nuclei_Yaml/nuclei_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}) {
}
}
////////////////////////////////////*/
runner2.ParseOptions(options)
if nil != oOpts {
// 指定覆盖
data, err := json.Marshal(oOpts)
Expand All @@ -68,7 +69,6 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}) {
}
}
}
runner2.ParseOptions(options)
//data, err := json.Marshal(options)
//if nil == err {
// fmt.Printf("%s", string(data))
Expand Down
16 changes: 11 additions & 5 deletions test/nuclei/testNuclei.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bytes"
"github.com/hktalent/scan4all/projectdiscovery/nuclei_Yaml"
"log"
_ "net/http/pprof"
"os"
"sync"
Expand All @@ -25,7 +24,6 @@ func DoNuclei(buf *bytes.Buffer, wg *sync.WaitGroup, oOpts *map[string]interface
defer wg.Done()
xx := make(chan bool)
go nuclei_Yaml.RunNuclei(buf, xx, oOpts)
log.Println("xxx start")
<-xx
}

Expand All @@ -46,12 +44,20 @@ func main() {
wg.Add(1)
buf.WriteString("http://192.168.10.31:8888\n")
pwd, _ := os.Getwd()
m1 := map[string]interface{}{"UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates"}, "TemplatesDirectory": pwd + "/config/nuclei-templates", "NoUpdateTemplates": true}
m1 := map[string]interface{}{"Severities": "critical,high,medium", "EnableProgressBar": false, "UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates"}, "TemplatesDirectory": pwd + "/config/nuclei-templates", "NoUpdateTemplates": true}
go DoNuclei(&buf, &wg, &m1)

buf1 := bytes.Buffer{}
buf1.WriteString("http://pms.yx4.me\n")
wg.Add(1)
go DoNuclei(&buf, &wg, &m1)
m2 := map[string]interface{}{"Severities": "critical,high,medium", "EnableProgressBar": false, "Protocols": "http", "UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates"}, "TemplatesDirectory": pwd + "/config/nuclei-templates", "NoUpdateTemplates": true}
go DoNuclei(&buf1, &wg, &m2)

buf2 := bytes.Buffer{}
buf2.WriteString("http://192.168.10.240\n")
m3 := map[string]interface{}{"Severities": "critical,high,medium", "EnableProgressBar": false, "Protocols": "network", "UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates"}, "TemplatesDirectory": pwd + "/config/nuclei-templates", "NoUpdateTemplates": true}
wg.Add(1)
go DoNuclei(&buf, &wg, &m1)
go DoNuclei(&buf2, &wg, &m3)
wg.Wait()
}
//oUrl, err := url.Parse("173.82.115.38:80")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b815bc6

Please sign in to comment.