Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add substr DSL function #2304

Closed
hktalent opened this issue Jul 18, 2022 · 6 comments · Fixed by #2361
Closed

Add substr DSL function #2304

hktalent opened this issue Jul 18, 2022 · 6 comments · Fixed by #2361
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Milestone

Comments

@hktalent
Copy link
Contributor

@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 hktalent added the Type: Enhancement Most issues will probably ask for additions or changes. label Jul 18, 2022
@ehsandeep
Copy link
Member

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

@forgedhallpass
Copy link
Contributor

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"

@hktalent
Copy link
Contributor Author

@forgedhallpass thanks

@forgedhallpass
Copy link
Contributor

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

@forgedhallpass forgedhallpass changed the title support substr,like slice Add substr DSL function Jul 18, 2022
@hktalent
Copy link
Contributor Author

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

@forgedhallpass
Copy link
Contributor

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 forgedhallpass linked a pull request Jul 18, 2022 that will close this issue
@ehsandeep ehsandeep linked a pull request Aug 22, 2022 that will close this issue
4 tasks
ehsandeep pushed a commit that referenced this issue Aug 25, 2022
* 1、add DSL substr for #2304 By @hktalent
substr('xxtestxxx',2)。   testxxx
substr('xxtestxxx',2,-2)  testx
substr('xxtestxxx',2,6)   test

2、add DSL aes_cbc for #2243 By @hktalent
aes_cbc("key111key111key111key111", "dataxxxxxxdataxxxxxxdataxxxxxxdataxxxxxxdataxxxxxx")

3、fixed An error occurs when running nuclei with multiple instances #2301 By @hktalent

* refactoring helpers

* removing unwanted mutex

* commenting out test

* removing aes_cbc test due to random iv

Co-authored-by: 51pwn <51pwn@51pwn.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Aug 25, 2022
@ehsandeep ehsandeep added this to the v2.7.7 milestone Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants