Skip to content

Commit d2cecef

Browse files
authored
feat: update global matchers usage (#112)
Signed-off-by: Dwi Siswanto <[email protected]>
1 parent 956b933 commit d2cecef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/reference/matchers.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,13 @@ In this example, we're using a template that has `global-matchers` set to **true
269269
To run it, use a command like this:
270270

271271
```console
272-
> nuclei -u http://example.com -t http-template-with-global-matchers.yaml -t http-template-1.yaml -t http-template-2.yaml -silent
272+
> nuclei -egm -u http://example.com -t http-template-with-global-matchers.yaml -t http-template-1.yaml -t http-template-2.yaml -silent
273273
[http-template-with-global-matchers:asymmetric_private_key] http://example.com/request-from-http-template-1
274274
[http-template-with-global-matchers:slack_webhook] http://example.com/request-from-http-template-2
275275
```
276276

277+
<Warning>
278+
Global matchers are NOT applied by default. You need to explicitly enable them using the `-enable-global-matchers`/`-egm` flag or programmatically via [`nuclei.EnableGlobalMatchersTemplates`](https://pkg.go.dev/github.com/projectdiscovery/nuclei/v3/lib#EnableGlobalMatchersTemplates) if you're working with the Nuclei SDK.
279+
</Warning>
280+
277281
In this case, the global matchers are looking for an asymmetric private key and a Slack webhook. As you can see in the output, it found a match in requests from the other templates, even though the matching logic was only defined once in the global matchers template. This makes it really efficient for detecting patterns across multiple requests without duplicating code in every single template.

0 commit comments

Comments
 (0)