Documentation
¶
Overview ¶
Package output implements output writing interfaces for nuclei.
Index ¶
- type InternalEvent
- type InternalWrappedEvent
- type JSONLogRequest
- type ResultEvent
- type StandardWriter
- func (w *StandardWriter) Close()
- func (w *StandardWriter) Colorizer() aurora.Aurora
- func (w *StandardWriter) Request(templatePath, input, requestType string, requestErr error)
- func (w *StandardWriter) Write(event *ResultEvent) error
- func (w *StandardWriter) WriteFailure(wrappedEvent *InternalWrappedEvent) error
- func (w *StandardWriter) WriteStoreDebugData(host, templateID, eventType string, data string)
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InternalEvent ¶
type InternalEvent map[string]interface{}
InternalEvent is an internal output generation structure for nuclei.
type InternalWrappedEvent ¶
type InternalWrappedEvent struct {
// Mutex is internal field which is implicitly used
// to synchronize callback(event) and interactsh polling updates
// Refer protocols/http.Request.ExecuteWithResults for more details
sync.RWMutex
InternalEvent InternalEvent
Results []*ResultEvent
OperatorsResult *operators.Result
UsesInteractsh bool
// Only applicable if interactsh is used
// This is used to avoid duplicate successful interactsh events
InteractshMatched atomic.Bool
}
InternalWrappedEvent is a wrapped event with operators result added to it.
func (*InternalWrappedEvent) HasOperatorResult ¶
func (iwe *InternalWrappedEvent) HasOperatorResult() bool
func (*InternalWrappedEvent) HasResults ¶
func (iwe *InternalWrappedEvent) HasResults() bool
func (*InternalWrappedEvent) SetOperatorResult ¶
func (iwe *InternalWrappedEvent) SetOperatorResult(operatorResult *operators.Result)
type JSONLogRequest ¶
type JSONLogRequest struct {
Template string `json:"template"`
Input string `json:"input"`
Error string `json:"error"`
Type string `json:"type"`
}
JSONLogRequest is a trace/error log request written to file
type ResultEvent ¶
type ResultEvent struct {
// Template is the relative filename for the template
Template string `json:"template,omitempty"`
// TemplateURL is the URL of the template for the result inside the nuclei
// templates repository if it belongs to the repository.
TemplateURL string `json:"template-url,omitempty"`
// TemplateID is the ID of the template for the result.
TemplateID string `json:"template-id"`
// TemplatePath is the path of template
TemplatePath string `json:"template-path,omitempty"`
// Info contains information block of the template for the result.
Info model.Info `json:"info,inline"`
// MatcherName is the name of the matcher matched if any.
MatcherName string `json:"matcher-name,omitempty"`
// ExtractorName is the name of the extractor matched if any.
ExtractorName string `json:"extractor-name,omitempty"`
// Type is the type of the result event.
Type string `json:"type"`
// Host is the host input on which match was found.
Host string `json:"host,omitempty"`
// Path is the path input on which match was found.
Path string `json:"path,omitempty"`
// Matched contains the matched input in its transformed form.
Matched string `json:"matched-at,omitempty"`
// ExtractedResults contains the extraction result from the inputs.
ExtractedResults []string `json:"extracted-results,omitempty"`
// Request is the optional, dumped request for the match.
Request string `json:"request,omitempty"`
// Response is the optional, dumped response for the match.
Response string `json:"response,omitempty"`
// Metadata contains any optional metadata for the event
Metadata map[string]interface{} `json:"meta,omitempty"`
// IP is the IP address for the found result event.
IP string `json:"ip,omitempty"`
// Timestamp is the time the result was found at.
Timestamp time.Time `json:"timestamp"`
// Interaction is the full details of interactsh interaction.
Interaction *server.Interaction `json:"interaction,omitempty"`
// CURLCommand is an optional curl command to reproduce the request
// Only applicable if the report is for HTTP.
CURLCommand string `json:"curl-command,omitempty"`
// MatcherStatus is the status of the match
MatcherStatus bool `json:"matcher-status"`
// Lines is the line count for the specified match
Lines []int `json:"matched-line,omitempty"`
FileToIndexPosition map[string]int `json:"-"`
}
ResultEvent is a wrapped result event for a single nuclei output.
type StandardWriter ¶
type StandardWriter struct {
// contains filtered or unexported fields
}
StandardWriter is a writer writing output to file and screen for results.
func NewStandardWriter ¶
func NewStandardWriter(options *types.Options) (*StandardWriter, error)
NewStandardWriter creates a new output writer based on user configurations
func (*StandardWriter) Close ¶
func (w *StandardWriter) Close()
Close closes the output writing interface
func (*StandardWriter) Colorizer ¶
func (w *StandardWriter) Colorizer() aurora.Aurora
Colorizer returns the colorizer instance for writer
func (*StandardWriter) Request ¶
func (w *StandardWriter) Request(templatePath, input, requestType string, requestErr error)
Request writes a log the requests trace log
func (*StandardWriter) Write ¶
func (w *StandardWriter) Write(event *ResultEvent) error
Write writes the event to file and/or screen.
func (*StandardWriter) WriteFailure ¶
func (w *StandardWriter) WriteFailure(wrappedEvent *InternalWrappedEvent) error
WriteFailure writes the failure event for template to file and/or screen.
func (*StandardWriter) WriteStoreDebugData ¶
func (w *StandardWriter) WriteStoreDebugData(host, templateID, eventType string, data string)
type Writer ¶
type Writer interface {
// Close closes the output writer interface
Close()
// Colorizer returns the colorizer instance for writer
Colorizer() aurora.Aurora
// Write writes the event to file and/or screen.
Write(*ResultEvent) error
// WriteFailure writes the optional failure event for template to file and/or screen.
WriteFailure(*InternalWrappedEvent) error
// Request logs a request in the trace log
Request(templateID, url, requestType string, err error)
// WriteStoreDebugData writes the request/response debug data to file
WriteStoreDebugData(host, templateID, eventType string, data string)
}
Writer is an interface which writes output to somewhere for nuclei events.