nuclei
nuclei copied to clipboard
Add `substr` DSL function
@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 please dm me on discord (pd-team)? as we might need some more information for this.
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 thanks
Re-opening it, because it's not yet implemented. I was just detailing the requirements.
@forgedhallpass Need me to contribute? I'm just worried that my code can't meet your quality requirements
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 :)