nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

Add `substr` DSL function

Open hktalent opened this issue 1 year ago • 6 comments

@ehsandeep python3 code

>>> import datetime
>>> datetime.datetime.now().strftime("%Y_%m_%d")[2:]
'22_07_18'

If you encounter such a situation when processing some specific payloads, please also support substr(2,-1) == python3 xxx[2:]

thanks

hktalent avatar Jul 18 '22 08:07 hktalent

@hktalent please dm me on discord (pd-team)? as we might need some more information for this.

ehsandeep avatar Jul 18 '22 10:07 ehsandeep

Method signature: substr(content string, startIndex int, optionalEndIndex int) When the optionalEndIndex is not provided, it means until the end of the string.

Examples: substr("xxtest", 2) == "test" substr("testxx", 0, -2) == "test" substr("xxtestxx", 2, -2) == substr("xxtestxx", 2, 6) == "test" substr("testxx", -2) == substr("testxx", 4) == "xx"

forgedhallpass avatar Jul 18 '22 12:07 forgedhallpass

@forgedhallpass thanks

hktalent avatar Jul 18 '22 12:07 hktalent

Re-opening it, because it's not yet implemented. I was just detailing the requirements.

forgedhallpass avatar Jul 18 '22 12:07 forgedhallpass

@forgedhallpass Need me to contribute? I'm just worried that my code can't meet your quality requirements

hktalent avatar Jul 18 '22 13:07 hktalent

We always accept and appreciate contributions. With regards to the quality, we can help you/give feedback on the PR, that's not a problem, so don't be worried :)

forgedhallpass avatar Jul 18 '22 13:07 forgedhallpass