diff --git a/pkg/core/executors.go b/pkg/core/executors.go index e83aed57e..8abcc9d78 100644 --- a/pkg/core/executors.go +++ b/pkg/core/executors.go @@ -4,8 +4,10 @@ import ( "context" "sync" "sync/atomic" + "time" "github.com/projectdiscovery/nuclei/v3/pkg/input/provider" + "github.com/projectdiscovery/nuclei/v3/pkg/output" "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs" "github.com/projectdiscovery/nuclei/v3/pkg/scan" "github.com/projectdiscovery/nuclei/v3/pkg/templates" @@ -107,6 +109,22 @@ func (e *Engine) executeTemplateWithTargets(ctx context.Context, template *templ // Skip if the host has had errors if e.executerOpts.HostErrorsCache != nil && e.executerOpts.HostErrorsCache.Check(e.executerOpts.ProtocolType.String(), contextargs.NewWithMetaInput(ctx, scannedValue)) { + skipEvent := &output.ResultEvent{ + TemplateID: template.ID, + TemplatePath: template.Path, + Info: template.Info, + Type: e.executerOpts.ProtocolType.String(), + Host: scannedValue.Input, + MatcherStatus: false, + Error: "host was skipped as it was found unresponsive", + Timestamp: time.Now(), + } + + if e.Callback != nil { + e.Callback(skipEvent) + } else if e.executerOpts.Output != nil { + _ = e.executerOpts.Output.Write(skipEvent) + } return true } diff --git a/pkg/reporting/trackers/linear/linear.go b/pkg/reporting/trackers/linear/linear.go index 243baefe5..be8723368 100644 --- a/pkg/reporting/trackers/linear/linear.go +++ b/pkg/reporting/trackers/linear/linear.go @@ -54,15 +54,17 @@ type Options struct { // New creates a new issue tracker integration client based on options. func New(options *Options) (*Integration, error) { + var transport http.RoundTripper = http.DefaultTransport + if options.HttpClient != nil && options.HttpClient.HTTPClient.Transport != nil { + transport = options.HttpClient.HTTPClient.Transport + } + httpClient := &http.Client{ Transport: &addHeaderTransport{ - T: http.DefaultTransport, + T: transport, Key: options.APIKey, }, } - if options.HttpClient != nil { - httpClient.Transport = options.HttpClient.HTTPClient.Transport - } integration := &Integration{ url: "https://api.linear.app/graphql",