Skip to content

Commit

Permalink
fix #21 2022-07-21
Browse files Browse the repository at this point in the history
  • Loading branch information
x51pwn committed Jul 21, 2022
1 parent a19f598 commit 741ef5d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/HoneypotDetection.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/tls"
"net/http"
"net/url"
"regexp"
"strings"
"sync"
"time"
Expand All @@ -14,10 +15,12 @@ var EnableHoneyportDetection = true
// 内存缓存,避免相同目标多次执行
var hdCache sync.Map

var ipCIDS = regexp.MustCompile("^(\\d+\\.){3}\\d+\\/\\d+$")

// 添加蜜罐检测,并自动跳过目标,默认false跳过蜜罐检测
// 考虑内存缓存结果
func HoneyportDetection(host string) bool {
if 5 > len(host) {
if 5 > len(host) || ipCIDS.MatchString(host) {
return false
}
if "http" != strings.ToLower(host[0:4]) {
Expand Down
4 changes: 2 additions & 2 deletions projectdiscovery/nuclei_Yaml/internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func (r *Runner) executeTemplatesInput(store *loader.Store, engine *core.Engine)

// 0 matches means no templates were found in directory
if templateCount == 0 {
return &atomic.Bool{}, errors.New("no valid templates were found")
return &atomic.Bool{}, nil //errors.New("no valid templates were found")
}

// tracks global progress and captures stdout/stderr until p.Wait finishes
Expand Down Expand Up @@ -483,7 +483,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
messageStr := builder.String()
builder.Reset()

gologger.Info().Msgf("Using Nuclei Engine %s%s", config.Version, messageStr)
//gologger.Info().Msgf("Using Nuclei Engine %s%s", config.Version, messageStr)

if r.templatesConfig != nil && r.templatesConfig.NucleiTemplatesLatestVersion != "" { // TODO extract duplicated logic
builder.WriteString(" (")
Expand Down
2 changes: 1 addition & 1 deletion test/nuclei/testNuclei.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {

buf2 := bytes.Buffer{}
buf2.WriteString("https://kb.bugscan.net\n")
m3 := map[string]interface{}{"Severities": h01, "EnableProgressBar": false, "Protocols": []nucleiType.ProtocolType{nucleiType.NetworkProtocol}, "UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates/51pwn"}, "TemplatesDirectory": pwd + "/config/nuclei-templates", "NoUpdateTemplates": true}
m3 := map[string]interface{}{"Severities": h01, "EnableProgressBar": false, "Protocols": []nucleiType.ProtocolType{nucleiType.HTTPProtocol}, "UpdateTemplates": false, "Templates": []string{pwd + "/config/nuclei-templates/51pwn"}, "TemplatesDirectory": pwd + "/config/nuclei-templates/51pwn", "NoUpdateTemplates": true}
wg.Add(1)
go DoNuclei(&buf2, &wg, &m3)
wg.Wait()
Expand Down

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

0 comments on commit 741ef5d

Please sign in to comment.