Skip to content

Commit

Permalink
为分布式pro版本提供扩展接口 2022-07-26
Browse files Browse the repository at this point in the history
  • Loading branch information
x51pwn committed Jul 26, 2022
1 parent e99355f commit 41dd865
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion pkg/naabu/v2/pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hktalent/scan4all/lib/util"
"github.com/hktalent/scan4all/pkg/fingerprint"
"github.com/hktalent/scan4all/projectdiscovery/nuclei_Yaml"
runner2 "github.com/hktalent/scan4all/projectdiscovery/nuclei_Yaml/nclruner/runner"
"github.com/projectdiscovery/fileutil"
"github.com/projectdiscovery/retryablehttp-go"
"log"
Expand Down Expand Up @@ -59,7 +60,16 @@ func (r *Runner) Httpxrun() error {
//log.Println("httpxrunner.Naabubuffer = ", httpxrunner.Naabubuffer.String())
//Naabubuffer1 := bytes.Buffer{}
//Naabubuffer1.Write(httpxrunner.Naabubuffer.Bytes())
go nuclei_Yaml.RunNuclei(&httpxrunner.Naabubuffer, nucleiDone, nil)
var xx1 = make(chan *runner2.Runner, 3)
go nuclei_Yaml.RunNuclei(&httpxrunner.Naabubuffer, nucleiDone, nil, xx1)
select {
case <-xx1:
close(xx1)
case <-nucleiDone:
close(xx1)
default:
}

httpxoptions := httpxrunner.ParseOptions()
// 指纹去重复 请求路径
if "" != fingerprint.FgDictFile {
Expand Down
4 changes: 2 additions & 2 deletions projectdiscovery/nuclei_Yaml/nuclei_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
cfgFile string
)

func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}) {
func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}, outNuclei chan<- *runner2.Runner) {
options := &types.Options{}
defer func() {
xx <- true
Expand Down Expand Up @@ -83,7 +83,7 @@ func RunNuclei(buf *bytes.Buffer, xx chan bool, oOpts *map[string]interface{}) {
}
//data, _ := json.Marshal(options)
//log.Printf("%+v", string(data))

outNuclei <- nucleiRunner
if err := nucleiRunner.RunEnumeration(); err != nil {
if options.Validate {
gologger.Fatal().Msgf("Could not validate templates: %s\n", err)
Expand Down

0 comments on commit 41dd865

Please sign in to comment.