Repository: projectdiscovery/nuclei

Issue:
Excessive memory usage with multi request / protocol template
### Is there an existing issue for this?

- [x] I have searched the existing issues.

### Current Behavior

Nuclei template for test:

<details><summary>basic multi request template</summary>
<p>

```yaml
id: basic-raw-example

info:
  name: Test RAW Template
  author: pdteam
  severity: info

http:
  - raw:
      - |
        GET /1 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /2 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /3 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /4 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /5 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /6 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /7 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /8 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /9 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /10 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /11 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /12 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /13 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /14 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /15 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /16 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /17 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /18 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"
```
</p>
</details> 

<details><summary>nuclei -u https://example.com -t test.yaml -v -stats</summary>
<p>

```console
$ nuclei -u https://example.com -t test.yaml -v -stats

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.4.4

		projectdiscovery.io

[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.4.4 (latest)
[INF] Current nuclei-templates version: v10.2.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 65
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[VER] [basic-raw-example] Sent HTTP request to https://example.com/1
[0:00:05] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 1/19 (5%)
[0:00:10] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 1/19 (5%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/2
[VER] [basic-raw-example] Sent HTTP request to https://example.com/3
[0:00:15] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 3/19 (15%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/4
[VER] [basic-raw-example] Sent HTTP request to https://example.com/5
[VER] [basic-raw-example] Sent HTTP request to https://example.com/6
[0:00:20] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 6/19 (31%)
[0:00:25] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 6/19 (31%)
[0:00:30] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 6/19 (31%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/7
[VER] [basic-raw-example] Sent HTTP request to https://example.com/8
[VER] [basic-raw-example] Sent HTTP request to https://example.com/9
[VER] [basic-raw-example] Sent HTTP request to https://example.com/10
[0:00:35] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 10/19 (52%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/11
[VER] [basic-raw-example] Sent HTTP request to https://example.com/12
[VER] [basic-raw-example] Sent HTTP request to https://example.com/13
[VER] [basic-raw-example] Sent HTTP request to https://example.com/14
[0:00:40] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 13/19 (68%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com
[VER] [basic-raw-example] Sent HTTP request to https://example.com/15
[0:00:45] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 15/19 (78%)
[0:00:50] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 16/19 (84%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/16
[0:00:55] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 16/19 (84%)
[0:01:00] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 17/19 (89%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/17
[0:01:05] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 17/19 (89%)
[0:01:10] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 17/19 (89%)
[0:01:15] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 17/19 (89%)
[0:01:20] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 17/19 (89%)
[0:01:25] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[VER] [basic-raw-example] Sent HTTP request to https://example.com/18
[0:01:30] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:01:35] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:01:40] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:01:45] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:01:50] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:01:55] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:00] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:05] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:10] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:15] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:20] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 18/19 (94%)
[0:02:25] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 19/19 (100%)
[INF] Scan completed in 2m. No results found.
[0:02:25] | Templates: 1 | Hosts: 1 | RPS: 0 | Matched: 0 | Errors: 0 | Requests: 19/19 (100%)
```

</p>
</details> 

See the memory usages spikes to 10GB+ and exponentially grows as run time increases.

![Image](https://github.com/user-attachments/assets/2cce40c0-cba3-4974-b159-5200543da380)

### Expected Behavior

run as it is with less memory usages

### Steps To Reproduce

nuclei -u https://example.com -t test.yaml -v -stats

### Relevant log output

```shell

```

### Environment

```markdown
- OS: MAC
- Nuclei: latest (v3.4.4) 
- Go: go1.23.4 darwin/arm64
```

### Anything else?

This issue was introduced in https://github.com/projectdiscovery/nuclei/pull/5967, where it’s expected to track all information from each request. However, the memory usage indicates something is wrong—as even with all data being preserved, such a spike in memory usage at this scale is not expected.

Hints from issue comments:

Solution patch:
diff --git a/pkg/operators/common/dsl/dsl.go b/pkg/operators/common/dsl/dsl.go
index 1b3a02be..56ac0650 100644
--- a/pkg/operators/common/dsl/dsl.go
+++ b/pkg/operators/common/dsl/dsl.go
@@ -114,7 +114,7 @@ func init() {
 	}))
 
 	dsl.PrintDebugCallback = func(args ...interface{}) error {
-		gologger.Info().Msgf("print_debug value: %s", fmt.Sprint(args))
+		gologger.Debug().Msgf("print_debug value: %s", fmt.Sprint(args))
 		return nil
 	}
 
diff --git a/pkg/output/output.go b/pkg/output/output.go
index e85774b8..02b62f6e 100644
--- a/pkg/output/output.go
+++ b/pkg/output/output.go
@@ -560,7 +560,7 @@ func (w *StandardWriter) WriteStoreDebugData(host, templateID, eventType string,
 		filename = filepath.Join(subFolder, fmt.Sprintf("%s.txt", filename))
 		f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644)
 		if err != nil {
-			fmt.Print(err)
+			gologger.Error().Msgf("Could not open debug output file: %s", err)
 			return
 		}
 		_, _ = f.WriteString(fmt.Sprintln(data))
diff --git a/pkg/protocols/headless/engine/page.go b/pkg/protocols/headless/engine/page.go
index fd8687e1..4dca72a6 100644
--- a/pkg/protocols/headless/engine/page.go
+++ b/pkg/protocols/headless/engine/page.go
@@ -24,19 +24,20 @@ import (
 
 // Page is a single page in an isolated browser instance
 type Page struct {
-	ctx            *contextargs.Context
-	inputURL       *urlutil.URL
-	options        *Options
-	page           *rod.Page
-	rules          []rule
-	instance       *Instance
-	hijackRouter   *rod.HijackRouter
-	hijackNative   *Hijack
-	mutex          *sync.RWMutex
-	History        []HistoryData
-	InteractshURLs []string
-	payloads       map[string]interface{}
-	variables      map[string]interface{}
+	ctx                *contextargs.Context
+	inputURL           *urlutil.URL
+	options            *Options
+	page               *rod.Page
+	rules              []rule
+	instance           *Instance
+	hijackRouter       *rod.HijackRouter
+	hijackNative       *Hijack
+	mutex              *sync.RWMutex
+	History            []HistoryData
+	InteractshURLs     []string
+	payloads           map[string]interface{}
+	variables          map[string]interface{}
+	lastActionNavigate *Action
 }
 
 // HistoryData contains the page request/response pairs
@@ -274,6 +275,17 @@ func (p *Page) hasModificationRules() bool {
 	return false
 }
 
+// updateLastNavigatedURL updates the last navigated URL in the instance's
+// request log.
+func (p *Page) updateLastNavigatedURL() {
+	if p.lastActionNavigate == nil {
+		return
+	}
+
+	templateURL := p.lastActionNavigate.GetArg("url")
+	p.instance.requestLog[templateURL] = p.URL()
+}
+
 func containsModificationActions(actions ...*Action) bool {
 	for _, action := range actions {
 		if containsAnyModificationActionType(action.ActionType.ActionType) {
diff --git a/pkg/protocols/headless/engine/page_actions.go b/pkg/protocols/headless/engine/page_actions.go
index a0b001da..204ce8ee 100644
--- a/pkg/protocols/headless/engine/page_actions.go
+++ b/pkg/protocols/headless/engine/page_actions.go
@@ -47,6 +47,7 @@ const (
 // ExecuteActions executes a list of actions on a page.
 func (p *Page) ExecuteActions(input *contextargs.Context, actions []*Action) (outData ActionData, err error) {
 	outData = make(ActionData)
+
 	// waitFuncs are function that needs to be executed after navigation
 	// typically used for waitEvent
 	waitFuncs := make([]func() error, 0)
@@ -76,6 +77,8 @@ func (p *Page) ExecuteActions(input *contextargs.Context, actions []*Action) (ou
 						}
 					}
 				}
+
+				p.lastActionNavigate = act
 			}
 		case ActionScript:
 			err = p.RunScript(act, outData)
@@ -407,12 +410,12 @@ func (p *Page) NavigateURL(action *Action, out ActionData) error {
 	finalparams.Merge(p.inputURL.Params.Encode())
 	parsedURL.Params = finalparams
 
-	// log all navigated requests
-	p.instance.requestLog[action.GetArg("url")] = parsedURL.String()
-
 	if err := p.page.Navigate(parsedURL.String()); err != nil {
 		return errorutil.NewWithErr(err).Msgf("could not navigate to url %s", parsedURL.String())
 	}
+
+	p.updateLastNavigatedURL()
+
 	return nil
 }
 
@@ -667,6 +670,9 @@ func (p *Page) WaitPageLifecycleEvent(act *Action, out ActionData, event proto.P
 
 	fn()
 
+	// log the navigated request (even if it is a redirect)
+	p.updateLastNavigatedURL()
+
 	return nil
 }
 
@@ -687,7 +693,14 @@ func (p *Page) WaitStable(act *Action, out ActionData) error {
 		}
 	}
 
-	return p.page.Timeout(timeout).WaitStable(dur)
+	if err := p.page.Timeout(timeout).WaitStable(dur); err != nil {
+		return err
+	}
+
+	// log the navigated request (even if it is a redirect)
+	p.updateLastNavigatedURL()
+
+	return nil
 }
 
 // GetResource gets a resource from an element from page.
diff --git a/pkg/protocols/headless/request.go b/pkg/protocols/headless/request.go
index 22a33bf7..83280ee6 100644
--- a/pkg/protocols/headless/request.go
+++ b/pkg/protocols/headless/request.go
@@ -2,6 +2,7 @@ package headless
 
 import (
 	"fmt"
+	"maps"
 	"net/url"
 	"strings"
 	"time"
@@ -9,7 +10,6 @@ import (
 	"github.com/projectdiscovery/retryablehttp-go"
 
 	"github.com/pkg/errors"
-	"golang.org/x/exp/maps"
 
 	"github.com/projectdiscovery/gologger"
 	"github.com/projectdiscovery/nuclei/v3/pkg/fuzz"
@@ -189,12 +189,9 @@ func (request *Request) executeRequestWithPayloads(input *contextargs.Context, p
 	if request.options.HasTemplateCtx(input.MetaInput) {
 		outputEvent = generators.MergeMaps(outputEvent, request.options.GetTemplateCtx(input.MetaInput).GetAll())
 	}
-	for k, v := range out {
-		outputEvent[k] = v
-	}
-	for k, v := range payloads {
-		outputEvent[k] = v
-	}
+
+	maps.Copy(outputEvent, out)
+	maps.Copy(outputEvent, payloads)
 
 	var event *output.InternalWrappedEvent
 	if len(page.InteractshURLs) == 0 {
diff --git a/pkg/protocols/http/request.go b/pkg/protocols/http/request.go
index 090de2ed..f401fe4c 100644
--- a/pkg/protocols/http/request.go
+++ b/pkg/protocols/http/request.go
@@ -336,11 +336,8 @@ func (request *Request) executeTurboHTTP(input *contextargs.Context, dynamicValu
 	pipeClient := rawhttp.NewPipelineClient(pipeOptions)
 
 	// defaultMaxWorkers should be a sufficient value to keep queues always full
-	maxWorkers := defaultMaxWorkers
 	// in case the queue is bigger increase the workers
-	if pipeOptions.MaxPendingRequests > maxWorkers {
-		maxWorkers = pipeOptions.MaxPendingRequests
-	}
+	maxWorkers := max(pipeOptions.MaxPendingRequests, defaultMaxWorkers)
 
 	// Stop-at-first-match logic while executing requests
 	// parallely using threads
@@ -1156,7 +1153,7 @@ func dumpResponse(event *output.InternalWrappedEvent, request *Request, redirect
 		response := string(redirectedResponse)
 
 		var highlightedResult string
-		if responseContentType == "application/octet-stream" || ((responseContentType == "" || responseContentType == "application/x-www-form-urlencoded") && responsehighlighter.HasBinaryContent(response)) {
+		if (responseContentType == "application/octet-stream" || responseContentType == "application/x-www-form-urlencoded") && responsehighlighter.HasBinaryContent(response) {
 			highlightedResult = createResponseHexDump(event, response, cliOptions.NoColor)
 		} else {
 			highlightedResult = responsehighlighter.Highlight(event.OperatorsResult, response, cliOptions.NoColor, false)



Test patch:
diff --git a/cmd/integration-test/http.go b/cmd/integration-test/http.go
index be75506c..f0e5d1ae 100644
--- a/cmd/integration-test/http.go
+++ b/cmd/integration-test/http.go
@@ -829,10 +829,7 @@ func (h *httpPaths) Execute(filepath string) error {
 	}
 
 	if len(expected) > len(actual) {
-		actualValuesIndex := len(actual) - 1
-		if actualValuesIndex < 0 {
-			actualValuesIndex = 0
-		}
+		actualValuesIndex := max(len(actual)-1, 0)
 		return fmt.Errorf("missing values : %v", expected[actualValuesIndex:])
 	} else if len(expected) < len(actual) {
 		return fmt.Errorf("unexpected values : %v", actual[len(expected)-1:])
diff --git a/cmd/nuclei/main_test.go b/cmd/nuclei/main_benchmark_test.go
similarity index 63%
rename from cmd/nuclei/main_test.go
rename to cmd/nuclei/main_benchmark_test.go
index 01c75d5c..baf9dbfa 100644
--- a/cmd/nuclei/main_test.go
+++ b/cmd/nuclei/main_benchmark_test.go
@@ -3,28 +3,56 @@ package main_test
 import (
 	"net/http"
 	"net/http/httptest"
+	"os"
 	"testing"
 	"time"
 
-	"github.com/projectdiscovery/goflags"
 	"github.com/projectdiscovery/gologger"
 	"github.com/projectdiscovery/gologger/levels"
 	"github.com/projectdiscovery/nuclei/v3/internal/runner"
 	"github.com/projectdiscovery/nuclei/v3/pkg/types"
 )
 
-func BenchmarkRunEnumeration(b *testing.B) {
+var (
+	projectPath string
+	targetURL   string
+)
+
+func TestMain(m *testing.M) {
+	// Set up
+
+	gologger.DefaultLogger.SetMaxLevel(levels.LevelSilent)
+	os.Setenv("DISABLE_STDOUT", "true")
+
+	var err error
+
+	projectPath, err = os.MkdirTemp("", "nuclei-benchmark-")
+	if err != nil {
+		panic(err)
+	}
+
 	dummyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		w.WriteHeader(http.StatusNoContent)
 	}))
-	defer dummyServer.Close()
-
-	options := &types.Options{
-		RemoteTemplateDomainList: goflags.StringSlice{
-			"cloud.projectdiscovery.io",
-		},
-		ProjectPath:                "/tmp",
-		Targets:                    goflags.StringSlice{dummyServer.URL},
+	targetURL = dummyServer.URL
+
+	// Execute tests
+
+	exitCode := m.Run()
+
+	// Tear down
+
+	dummyServer.Close()
+	_ = os.RemoveAll(projectPath)
+	os.Unsetenv("DISABLE_STDOUT")
+
+	os.Exit(exitCode)
+}
+
+func getDefaultOptions() *types.Options {
+	return &types.Options{
+		RemoteTemplateDomainList:   []string{"cloud.projectdiscovery.io"},
+		ProjectPath:                projectPath,
 		StatsInterval:              5,
 		MetricsPort:                9092,
 		MaxHostError:               30,
@@ -66,22 +94,42 @@ func BenchmarkRunEnumeration(b *testing.B) {
 		// DialerKeepAlive:            time.Duration(0),
 		// DASTServerAddress:          "localhost:9055",
 	}
+}
 
+func runEnumBenchmark(b *testing.B, options *types.Options) {
 	runner.ParseOptions(options)
 
-	// Disable logging to reduce benchmark noise.
-	gologger.DefaultLogger.SetMaxLevel(levels.LevelSilent)
-
 	nucleiRunner, err := runner.New(options)
 	if err != nil {
 		b.Fatalf("failed to create runner: %s", err)
 	}
+	defer nucleiRunner.Close()
 
 	b.ResetTimer()
+	b.ReportAllocs()
 
 	for i := 0; i < b.N; i++ {
 		if err := nucleiRunner.RunEnumeration(); err != nil {
-			b.Fatalf("RunEnumeration failed: %s", err)
+			b.Fatalf("%s failed: %s", b.Name(), err)
 		}
 	}
 }
+
+func BenchmarkRunEnumeration(b *testing.B) {
+	// Default case: run enumeration with default options == all nuclei-templates
+	// b.Run("Default", func(b *testing.B) {
+	// 	options := getDefaultOptions()
+	// 	options.Targets = []string{targetURL}
+
+	// 	runEnumBenchmark(b, options)
+	// })
+
+	// Case: https://github.com/projectdiscovery/nuclei/pull/6258
+	b.Run("Multiproto", func(b *testing.B) {
+		options := getDefaultOptions()
+		options.Targets = []string{targetURL}
+		options.Templates = []string{"./cmd/nuclei/testdata/benchmark/multiproto/"}
+
+		runEnumBenchmark(b, options)
+	})
+}
diff --git a/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-mixed.yaml b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-mixed.yaml
new file mode 100644
index 00000000..d11db6e2
--- /dev/null
+++ b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-mixed.yaml
@@ -0,0 +1,239 @@
+id: basic-template-multiproto-mixed
+
+info:
+  name: Test Template Multiple Protocols (Mixed)
+  author: pdteam
+  severity: info
+
+http:
+  - method: GET
+    id: first_iter_http
+    path:
+      - '{{BaseURL}}/1'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/2'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/3'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/4'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/5'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/6'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/7'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/8'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/9'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /10 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /11 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /12 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /13 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /14 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET / HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /15 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /16 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /17 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /18 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
\ No newline at end of file
diff --git a/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-raw.yaml b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-raw.yaml
new file mode 100644
index 00000000..f868fdc5
--- /dev/null
+++ b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto-raw.yaml
@@ -0,0 +1,292 @@
+id: basic-template-multiproto-raw
+
+info:
+  name: Test Template Multiple Protocols RAW
+  author: pdteam
+  severity: info
+
+http:
+  - raw:
+      - |
+        GET /1 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /2 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /3 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /4 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /5 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /6 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /7 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /8 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /9 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /10 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /11 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /12 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /13 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /14 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET / HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /15 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /16 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /17 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - raw:
+      - |
+        GET /18 HTTP/1.1
+        Host: {{Hostname}}
+        Origin: {{BaseURL}}
+        Connection: close
+        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
+        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+        Accept-Language: en-US,en;q=0.9
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
\ No newline at end of file
diff --git a/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto.yaml b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto.yaml
new file mode 100644
index 00000000..6a7d37c8
--- /dev/null
+++ b/cmd/nuclei/testdata/benchmark/multiproto/basic-template-multiproto.yaml
@@ -0,0 +1,170 @@
+id: basic-template-multiproto
+
+info:
+  name: Test Template Multiple Protocols
+  author: pdteam
+  severity: info
+
+http:
+  - method: GET
+    id: first_iter_http
+    path:
+      - '{{BaseURL}}/1'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/2'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/3'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/4'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/5'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/6'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/7'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/8'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/9'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/10'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/11'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/12'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/13'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/14'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/15'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/16'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/17'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
+
+  - method: GET
+    path:
+      - '{{BaseURL}}/18'
+
+    matchers:
+      - type: word
+        words:
+          - "Test is test matcher text"
\ No newline at end of file