Documentation ¶
Index ¶
- Variables
- func Init(options *types.Options)
- func NewMockExecuterOptions(options *types.Options, info *TemplateInfo) *protocols.ExecutorOptions
- func NewWebsocketServer(path string, handler func(conn net.Conn), ...) *httptest.Server
- func RunNucleiAndGetResults(isTemplate bool, template, url string, debug bool, extra ...string) ([]string, error)
- func RunNucleiArgsAndGetErrors(debug bool, env []string, extra ...string) ([]string, error)
- func RunNucleiArgsWithEnvAndGetResults(debug bool, env []string, extra ...string) ([]string, error)
- func RunNucleiBareArgsAndGetResults(debug bool, env []string, extra ...string) ([]string, error)
- func RunNucleiBinaryAndGetCombinedOutput(debug bool, args []string) (string, error)
- func RunNucleiBinaryAndGetLoadedTemplates(nucleiBinary string, debug bool, args []string) (string, error)
- func RunNucleiTemplateAndGetResults(template, url string, debug bool, extra ...string) ([]string, error)
- func RunNucleiWithArgsAndGetResults(debug bool, args ...string) ([]string, error)
- func RunNucleiWorkflowAndGetResults(template, url string, debug bool, extra ...string) ([]string, error)
- type MockOutputWriter
- func (m *MockOutputWriter) Close()
- func (m *MockOutputWriter) Colorizer() aurora.Aurora
- func (m *MockOutputWriter) Request(templateID, url, requestType string, err error)
- func (m *MockOutputWriter) Write(result *output.ResultEvent) error
- func (m *MockOutputWriter) WriteFailure(wrappedEvent *output.InternalWrappedEvent) error
- func (m *MockOutputWriter) WriteStoreDebugData(host, templateID, eventType string, data string)
- type MockProgressClient
- func (m *MockProgressClient) AddToTotal(delta int64)
- func (m *MockProgressClient) IncrementErrorsBy(count int64)
- func (m *MockProgressClient) IncrementFailedRequestsBy(count int64)
- func (m *MockProgressClient) IncrementMatched()
- func (m *MockProgressClient) IncrementRequests()
- func (m *MockProgressClient) Init(hostCount int64, rulesCount int, requestCount int64)
- func (m *MockProgressClient) SetRequests(count uint64)
- func (m *MockProgressClient) Stop()
- type NoopWriter
- type TCPServer
- type TemplateInfo
- type TestCase
Constants ¶
This section is empty.
Variables ¶
var ( ExtraDebugArgs = []string{} ExtraEnvVars = []string{ "DISABLE_CLOUD_UPLOAD_WRN=true", "DISABLE_CLOUD_UPLOAD=true", } )
ExtraArgs
var DefaultOptions = &types.Options{ Metrics: false, Debug: false, DebugRequests: false, DebugResponse: false, Silent: false, Verbose: false, NoColor: true, UpdateTemplates: false, JSONL: false, OmitRawRequests: false, EnableProgressBar: false, TemplateList: false, Stdin: false, StopAtFirstMatch: false, NoMeta: false, Project: false, MetricsPort: 0, BulkSize: 25, TemplateThreads: 10, Timeout: 5, Retries: 1, RateLimit: 150, RateLimitDuration: time.Second, ProbeConcurrency: 50, ProjectPath: "", Severities: severity.Severities{}, Targets: []string{}, TargetsFilePath: "", Output: "", Proxy: []string{}, TraceLogFile: "", Templates: []string{}, ExcludedTemplates: []string{}, CustomHeaders: []string{}, InteractshURL: "https://oast.fun", InteractionsCacheSize: 5000, InteractionsEviction: 60, InteractionsCoolDownPeriod: 5, InteractionsPollDuration: 5, GitHubTemplateRepo: []string{}, GitHubToken: "", ResponseReadTimeout: time.Second * 5, }
DefaultOptions is the default options structure for nuclei during mocking.
Functions ¶
func NewMockExecuterOptions ¶
func NewMockExecuterOptions(options *types.Options, info *TemplateInfo) *protocols.ExecutorOptions
NewMockExecuterOptions creates a new mock executeroptions struct
func NewWebsocketServer ¶
func NewWebsocketServer(path string, handler func(conn net.Conn), originValidate func(origin string) bool, port ...int) *httptest.Server
NewWebsocketServer creates a new websocket server from a handler
func RunNucleiAndGetResults ¶
func RunNucleiArgsAndGetErrors ¶
RunNucleiArgsAndGetErrors returns a list of errors in nuclei output (ERR,WRN,FTL)
func RunNucleiArgsWithEnvAndGetResults ¶
RunNucleiArgsWithEnvAndGetErrors returns a list of errors in nuclei output (ERR,WRN,FTL)
func RunNucleiBinaryAndGetLoadedTemplates ¶
func RunNucleiBinaryAndGetLoadedTemplates(nucleiBinary string, debug bool, args []string) (string, error)
RunNucleiBinaryAndGetLoadedTemplates returns a list of results for a template
func RunNucleiTemplateAndGetResults ¶
func RunNucleiTemplateAndGetResults(template, url string, debug bool, extra ...string) ([]string, error)
RunNucleiTemplateAndGetResults returns a list of results for a template
func RunNucleiWithArgsAndGetResults ¶
RunNucleiArgsAndGetResults returns result,and runtime errors
Types ¶
type MockOutputWriter ¶
type MockOutputWriter struct { RequestCallback func(templateID, url, requestType string, err error) FailureCallback func(result *output.InternalEvent) WriteCallback func(o *output.ResultEvent) // contains filtered or unexported fields }
MockOutputWriter is a mocked output writer.
func NewMockOutputWriter ¶
func NewMockOutputWriter(omomitTemplate bool) *MockOutputWriter
NewMockOutputWriter creates a new mock output writer
func (*MockOutputWriter) Close ¶
func (m *MockOutputWriter) Close()
Close closes the output writer interface
func (*MockOutputWriter) Colorizer ¶
func (m *MockOutputWriter) Colorizer() aurora.Aurora
Colorizer returns the colorizer instance for writer
func (*MockOutputWriter) Request ¶
func (m *MockOutputWriter) Request(templateID, url, requestType string, err error)
Request writes a log the requests trace log
func (*MockOutputWriter) Write ¶
func (m *MockOutputWriter) Write(result *output.ResultEvent) error
Write writes the event to file and/or screen.
func (*MockOutputWriter) WriteFailure ¶
func (m *MockOutputWriter) WriteFailure(wrappedEvent *output.InternalWrappedEvent) error
WriteFailure writes the event to file and/or screen.
func (*MockOutputWriter) WriteStoreDebugData ¶
func (m *MockOutputWriter) WriteStoreDebugData(host, templateID, eventType string, data string)
type MockProgressClient ¶
type MockProgressClient struct{}
func (*MockProgressClient) AddToTotal ¶
func (m *MockProgressClient) AddToTotal(delta int64)
AddToTotal adds a value to the total request count
func (*MockProgressClient) IncrementErrorsBy ¶
func (m *MockProgressClient) IncrementErrorsBy(count int64)
IncrementErrorsBy increments the error counter by count.
func (*MockProgressClient) IncrementFailedRequestsBy ¶
func (m *MockProgressClient) IncrementFailedRequestsBy(count int64)
IncrementFailedRequestsBy increments the number of requests counter by count along with errors.
func (*MockProgressClient) IncrementMatched ¶
func (m *MockProgressClient) IncrementMatched()
IncrementMatched increments the matched counter by 1.
func (*MockProgressClient) IncrementRequests ¶
func (m *MockProgressClient) IncrementRequests()
IncrementRequests increments the requests counter by 1.
func (*MockProgressClient) Init ¶
func (m *MockProgressClient) Init(hostCount int64, rulesCount int, requestCount int64)
Init inits the progress bar with initial details for scan
func (*MockProgressClient) SetRequests ¶
func (m *MockProgressClient) SetRequests(count uint64)
SetRequests sets the counter by incrementing it with a delta
func (*MockProgressClient) Stop ¶
func (m *MockProgressClient) Stop()
Stop stops the progress recorder.
type TCPServer ¶
type TCPServer struct { URL string // contains filtered or unexported fields }
TCPServer creates a new tcp server that returns a response
func NewTCPServer ¶
NewTCPServer creates a new TCP server from a handler
type TemplateInfo ¶
TemplateInfo contains info for a mock executed template.
Directories ¶
Path | Synopsis |
---|---|
This package provides a mock server for testing fuzzing templates
|
This package provides a mock server for testing fuzzing templates |