-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3193 from projectdiscovery/dev
nuclei v2.8.7
- Loading branch information
Showing
31 changed files
with
737 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
id: cl-body-with-header | ||
|
||
info: | ||
name: CL Get Request - Body with header | ||
author: pdteam | ||
severity: info | ||
|
||
requests: | ||
- method: GET | ||
path: | ||
- "{{BaseURL}}" | ||
matchers: | ||
- type: dsl | ||
dsl: | ||
- "content_length==50000 && len(body)==14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
id: cl-body-without-header | ||
|
||
info: | ||
name: CL Get Request - Body without header | ||
author: pdteam | ||
severity: info | ||
|
||
requests: | ||
- method: GET | ||
path: | ||
- "{{BaseURL}}" | ||
matchers: | ||
- type: dsl | ||
dsl: | ||
- "content_length==14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"log" | ||
"os" | ||
"path" | ||
"time" | ||
|
||
"github.com/logrusorgru/aurora" | ||
|
||
"github.com/projectdiscovery/goflags" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/config" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/disk" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/loader" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/core" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/core/inputs" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/output" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/parsers" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/contextargs" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/hosterrorscache" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/interactsh" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolinit" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/protocolstate" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/reporting" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/testutils" | ||
"github.com/projectdiscovery/nuclei/v2/pkg/types" | ||
"github.com/projectdiscovery/ratelimit" | ||
) | ||
|
||
func main() { | ||
cache := hosterrorscache.New(30, hosterrorscache.DefaultMaxHostsCount) | ||
defer cache.Close() | ||
|
||
mockProgress := &testutils.MockProgressClient{} | ||
reportingClient, _ := reporting.New(&reporting.Options{}, "") | ||
defer reportingClient.Close() | ||
|
||
outputWriter := testutils.NewMockOutputWriter() | ||
outputWriter.WriteCallback = func(event *output.ResultEvent) { | ||
fmt.Printf("Got Result: %v\n", event) | ||
} | ||
|
||
defaultOpts := types.DefaultOptions() | ||
protocolstate.Init(defaultOpts) | ||
protocolinit.Init(defaultOpts) | ||
|
||
defaultOpts.IncludeIds = goflags.StringSlice{"cname-service"} | ||
defaultOpts.ExcludeTags = config.ReadIgnoreFile().Tags | ||
|
||
interactOpts := interactsh.NewDefaultOptions(outputWriter, reportingClient, mockProgress) | ||
interactClient, err := interactsh.New(interactOpts) | ||
if err != nil { | ||
log.Fatalf("Could not create interact client: %s\n", err) | ||
} | ||
defer interactClient.Close() | ||
|
||
home, _ := os.UserHomeDir() | ||
catalog := disk.NewCatalog(path.Join(home, "nuclei-templates")) | ||
executerOpts := protocols.ExecuterOptions{ | ||
Output: outputWriter, | ||
Options: defaultOpts, | ||
Progress: mockProgress, | ||
Catalog: catalog, | ||
IssuesClient: reportingClient, | ||
RateLimiter: ratelimit.New(context.Background(), 150, time.Second), | ||
Interactsh: interactClient, | ||
HostErrorsCache: cache, | ||
Colorizer: aurora.NewAurora(true), | ||
ResumeCfg: types.NewResumeCfg(), | ||
} | ||
engine := core.New(defaultOpts) | ||
engine.SetExecuterOptions(executerOpts) | ||
|
||
workflowLoader, err := parsers.NewLoader(&executerOpts) | ||
if err != nil { | ||
log.Fatalf("Could not create workflow loader: %s\n", err) | ||
} | ||
executerOpts.WorkflowLoader = workflowLoader | ||
|
||
configObject, err := config.ReadConfiguration() | ||
if err != nil { | ||
log.Fatalf("Could not read config: %s\n", err) | ||
} | ||
store, err := loader.New(loader.NewConfig(defaultOpts, configObject, catalog, executerOpts)) | ||
if err != nil { | ||
log.Fatalf("Could not create loader client: %s\n", err) | ||
} | ||
store.Load() | ||
|
||
inputArgs := []*contextargs.MetaInput{{Input: "docs.hackerone.com"}} | ||
|
||
input := &inputs.SimpleInputProvider{Inputs: inputArgs} | ||
_ = engine.Execute(store.Templates(), input) | ||
engine.WorkPool().Wait() // Wait for the scan to finish | ||
} |
Oops, something went wrong.