From 5115c8b58c21673839c6856c9a960fb5d555af78 Mon Sep 17 00:00:00 2001 From: Sajad Parra Date: Wed, 29 Dec 2021 12:33:54 +0530 Subject: [PATCH] remove redundant contains function --- .../protocols/common/interactsh/interactsh.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/v2/pkg/protocols/common/interactsh/interactsh.go b/v2/pkg/protocols/common/interactsh/interactsh.go index ca644608..91f61d97 100644 --- a/v2/pkg/protocols/common/interactsh/interactsh.go +++ b/v2/pkg/protocols/common/interactsh/interactsh.go @@ -180,12 +180,6 @@ func (c *Client) firstTimeInitializeClient() error { return nil } -func hash(s string) string { - h := sha1.New() - h.Write([]byte(s)) - return hex.EncodeToString(h.Sum(nil)) -} - // processInteractionForRequest processes an interaction for a request func (c *Client) processInteractionForRequest(interaction *server.Interaction, data *RequestData) bool { data.Event.InternalEvent["interactsh_protocol"] = interaction.Protocol @@ -348,12 +342,8 @@ func debugPrintInteraction(interaction *server.Interaction) { fmt.Fprint(os.Stderr, builder.String()) } -// contains returns true if the given string is in the given array -func contains(array []string, str string) bool { - for _, s := range array { - if s == str { - return true - } - } - return false +func hash(s string) string { + h := sha1.New() + h.Write([]byte(s)) + return hex.EncodeToString(h.Sum(nil)) }