mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 05:05:23 +00:00
Reporting added to OOB interaction results
This commit is contained in:
parent
9c3b0b69a5
commit
6a4f3e1336
@ -208,6 +208,7 @@ func New(options *types.Options) (*Runner, error) {
|
||||
ColldownPeriod: time.Duration(options.InteractionsColldownPeriod) * time.Second,
|
||||
PollDuration: time.Duration(options.InteractionsPollDuration) * time.Second,
|
||||
Output: runner.output,
|
||||
IssuesClient: runner.issuesClient,
|
||||
Progress: runner.progress,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@ -7,11 +7,13 @@ import (
|
||||
|
||||
"github.com/karlseguin/ccache"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/projectdiscovery/gologger"
|
||||
"github.com/projectdiscovery/interactsh/pkg/client"
|
||||
"github.com/projectdiscovery/interactsh/pkg/server"
|
||||
"github.com/projectdiscovery/nuclei/v2/pkg/operators"
|
||||
"github.com/projectdiscovery/nuclei/v2/pkg/output"
|
||||
"github.com/projectdiscovery/nuclei/v2/pkg/progress"
|
||||
"github.com/projectdiscovery/nuclei/v2/pkg/reporting"
|
||||
"github.com/valyala/fasttemplate"
|
||||
)
|
||||
|
||||
@ -48,6 +50,8 @@ type Options struct {
|
||||
PollDuration time.Duration
|
||||
// Output is the output writer for nuclei
|
||||
Output output.Writer
|
||||
// IssuesClient is a client for issue exporting
|
||||
IssuesClient *reporting.Client
|
||||
// Progress is the nuclei progress bar implementation.
|
||||
Progress progress.Progress
|
||||
}
|
||||
@ -111,6 +115,12 @@ func New(options *Options) (*Client, error) {
|
||||
interactClient.matched = true
|
||||
}
|
||||
options.Progress.IncrementMatched()
|
||||
|
||||
if options.IssuesClient != nil {
|
||||
if err := options.IssuesClient.CreateIssue(result); err != nil {
|
||||
gologger.Warning().Msgf("Could not create issue on tracker: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return interactClient, nil
|
||||
|
||||
@ -86,6 +86,31 @@ func MarkdownDescription(event *output.ResultEvent) string {
|
||||
builder.WriteString("\n")
|
||||
}
|
||||
}
|
||||
if event.Interaction != nil {
|
||||
builder.WriteString("**Interaction Data**\n---\n")
|
||||
builder.WriteString(event.Interaction.Protocol)
|
||||
if event.Interaction.QType != "" {
|
||||
builder.WriteString(" (")
|
||||
builder.WriteString(event.Interaction.QType)
|
||||
builder.WriteString(")")
|
||||
}
|
||||
builder.WriteString(" Interaction from ")
|
||||
builder.WriteString(event.Interaction.RemoteAddress)
|
||||
builder.WriteString(" at ")
|
||||
builder.WriteString(event.Interaction.UniqueID)
|
||||
|
||||
if event.Interaction.RawRequest != "" {
|
||||
builder.WriteString("\n\n**Interaction Request**\n\n```\n")
|
||||
builder.WriteString(event.Interaction.RawRequest)
|
||||
builder.WriteString("\n```\n")
|
||||
}
|
||||
if event.Interaction.RawResponse != "" {
|
||||
builder.WriteString("\n**Interaction Response**\n\n```\n")
|
||||
builder.WriteString(event.Interaction.RawResponse)
|
||||
builder.WriteString("\n```\n")
|
||||
}
|
||||
}
|
||||
|
||||
builder.WriteString("\n---\nGenerated by [Nuclei](https://github.com/projectdiscovery/nuclei)")
|
||||
data := builder.String()
|
||||
return data
|
||||
|
||||
@ -129,6 +129,30 @@ func jiraFormatDescription(event *output.ResultEvent) string {
|
||||
builder.WriteString("\n")
|
||||
}
|
||||
}
|
||||
if event.Interaction != nil {
|
||||
builder.WriteString("*Interaction Data*\n---\n")
|
||||
builder.WriteString(event.Interaction.Protocol)
|
||||
if event.Interaction.QType != "" {
|
||||
builder.WriteString(" (")
|
||||
builder.WriteString(event.Interaction.QType)
|
||||
builder.WriteString(")")
|
||||
}
|
||||
builder.WriteString(" Interaction from ")
|
||||
builder.WriteString(event.Interaction.RemoteAddress)
|
||||
builder.WriteString(" at ")
|
||||
builder.WriteString(event.Interaction.UniqueID)
|
||||
|
||||
if event.Interaction.RawRequest != "" {
|
||||
builder.WriteString("\n\n*Interaction Request*\n\n{code}\n")
|
||||
builder.WriteString(event.Interaction.RawRequest)
|
||||
builder.WriteString("\n{code}\n")
|
||||
}
|
||||
if event.Interaction.RawResponse != "" {
|
||||
builder.WriteString("\n*Interaction Response*\n\n{code}\n")
|
||||
builder.WriteString(event.Interaction.RawResponse)
|
||||
builder.WriteString("\n{code}\n")
|
||||
}
|
||||
}
|
||||
builder.WriteString("\n---\nGenerated by [Nuclei|https://github.com/projectdiscovery/nuclei]")
|
||||
data := builder.String()
|
||||
return data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user