nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

starts_with & ends_with helper function

Open ehsandeep opened this issue 3 years ago • 0 comments

Please describe your feature request:

Two new helper function as shared below:

# match if the string starts with any of the provided strings
{{starts_with(body, "ports:", ...)}}
# match if the string split on \n starts with any of the provided strings
{{split_starts_with(body, "ports:", ...)}}

# match if the string ends with any of the provided strings
{{ends_with(body, ":latest", ...)}}
# match if the string split on \n ends with any of the provided strings
{{split_ends_with(body, "ports:", ...)}}

Describe the use case of this feature:

In multiple instances, it was required to match a keyword to start or ends with a specific word, using world matcher is not an option for those cases as matching keyword will be available in other parts of the body mixed in unrelated words.

For example, I'm looking to match ports: which will also be matched with exports: if using word matcher.

ehsandeep avatar Jul 13 '22 18:07 ehsandeep