diff --git a/v2/pkg/protocols/common/interactsh/interactsh.go b/v2/pkg/protocols/common/interactsh/interactsh.go index 5b95578ea..a207ef45a 100644 --- a/v2/pkg/protocols/common/interactsh/interactsh.go +++ b/v2/pkg/protocols/common/interactsh/interactsh.go @@ -82,9 +82,9 @@ func New(options *Options) (*Client, error) { configure = configure.MaxSize(options.CacheSize) cache := ccache.New(configure) - interactionsConfig := ccache.Configure() - interactionsConfig = configure.MaxSize(defaultMaxInteractionsCount) - interactionsCache := ccache.New(interactionsConfig) + interactionsCfg := ccache.Configure() + interactionsCfg = interactionsCfg.MaxSize(defaultMaxInteractionsCount) + interactionsCache := ccache.New(interactionsCfg) interactClient := &Client{ interactsh: interactsh, @@ -105,11 +105,9 @@ func New(options *Options) (*Client, error) { gotItem := interactClient.interactions.Get(interaction.UniqueID) if gotItem == nil { interactClient.interactions.Set(interaction.UniqueID, []*server.Interaction{interaction}, defaultInteractionDuration) - } else { - if items, ok := gotItem.Value().([]*server.Interaction); ok { - items = append(items, interaction) - interactClient.interactions.Set(interaction.UniqueID, items, defaultInteractionDuration) - } + } else if items, ok := gotItem.Value().([]*server.Interaction); ok { + items = append(items, interaction) + interactClient.interactions.Set(interaction.UniqueID, items, defaultInteractionDuration) } return } diff --git a/v2/pkg/protocols/network/request.go b/v2/pkg/protocols/network/request.go index 4ac8e93c4..ceebf160d 100644 --- a/v2/pkg/protocols/network/request.go +++ b/v2/pkg/protocols/network/request.go @@ -169,16 +169,14 @@ func (r *Request) executeAddress(actualAddress, address, input string, shouldUse } } callback(event) - } else { - if r.options.Interactsh != nil { - r.options.Interactsh.RequestEvent(interactURL, &interactsh.RequestData{ - MakeResultFunc: r.MakeResultEvent, - Event: event, - Operators: r.CompiledOperators, - MatchFunc: r.Match, - ExtractFunc: r.Extract, - }) - } + } else if r.options.Interactsh != nil { + r.options.Interactsh.RequestEvent(interactURL, &interactsh.RequestData{ + MakeResultFunc: r.MakeResultEvent, + Event: event, + Operators: r.CompiledOperators, + MatchFunc: r.Match, + ExtractFunc: r.Extract, + }) } return nil }