Skip to content

Commit

Permalink
vul
Browse files Browse the repository at this point in the history
  • Loading branch information
Autumn-27 committed Dec 8, 2024
1 parent ba05480 commit a5003ec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
26 changes: 26 additions & 0 deletions modules/urlsecurity/pagemonitoring/pagemonitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,33 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {
if !ok {
return nil, errors.New("input is not types.UrlResult")
}

parameter := p.GetParameter()
tp := "js"
if parameter != "" {
args, err := utils.Tools.ParseArgs(parameter, "type")
if err != nil {
} else {
for key, value := range args {
if value != "" {
switch key {
case "type":
tp = value
default:
continue
}
}

}
}
}

flag := utils.Tools.IsSuffixURL(data.Output, ".js")
if tp == "js" {
if !flag {
return nil, nil
}
}
if flag {
if strings.Contains(data.Body, "<!DOCTYPE html>") {
data.Body = ""
Expand Down
9 changes: 6 additions & 3 deletions modules/vulnerabilityscan/nuclei/nuclei.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {
concurrency.TemplatePayloadConcurrency = 15
concurrency.ProbeConcurrency = 5
if parameter != "" {
args, err := utils.Tools.ParseArgs(parameter, "t", "s", "es", "tags", "etags", "rl", "rld", "bs", "c", "hbs", "headc", "jsc", "pc", "prc", "as")
args, err := utils.Tools.ParseArgs(parameter, "t", "s", "es", "tags", "etags", "rl", "rld", "bs", "c", "hbs", "headc", "jsc", "pc", "prc", "as", "InteractshURL")
if err != nil {
} else {
for key, value := range args {
Expand Down Expand Up @@ -210,6 +210,10 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {
concurrency.ProbeConcurrency = prcValue
case "as":
tmplateFilters.Tags = append(tmplateFilters.Tags, tmpTags...)
//case "InteractshURL":
// options = append(options, nuclei.WithInteractshOptions(nuclei.InteractshOpts(interactsh.Options{
// ServerURL: value,
// })))
default:
continue
}
Expand All @@ -218,7 +222,6 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {
}
}
// 全局速率限制

options = append(options, nuclei.WithGlobalRateLimitCtx(context.Background(), maxTokens, duration))

// 速率限制
Expand All @@ -231,7 +234,6 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {

// TmplateFilters 模板过滤
options = append(options, nuclei.WithTemplateFilters(tmplateFilters))

ctx := contextmanager.GlobalContextManagers.GetContext(p.GetTaskId())
callBackFunc := func(event *output.ResultEvent) {
vulName := event.Info.Name
Expand Down Expand Up @@ -261,6 +263,7 @@ func (p *Plugin) Execute(input interface{}) (interface{}, error) {
config.DefaultConfig.TemplatesDirectory = filepath.Join(global.PocDir)
ne := handler.NewNucleiEngine()
handler.NucleiEngineWg.Add(1)

ne.GlobalResultCallback(callBackFunc)
err := ne.ExecuteNucleiWithOptsCtx(ctx, targets, options...)
if err != nil {
Expand Down

0 comments on commit a5003ec

Please sign in to comment.