32 Commits

Author SHA1 Message Date
vrenzolaverace
2aaf2a2158
Use utils helpers libraries (#2809) (#2810)
* Use utils helpers libraries (#2809)

* Use utils helpers libraries (#2809)
2022-11-07 01:54:23 +05:30
Ice3man
b9472cf7e1
Added fuzzing support for query params + var dump feature (#2679)
* Added fuzzing support for query params + var dump feature

* Added query-fuzz integration test

* Fixed payloads + added keys-regex fuzz parameter

* Fixed interactsh not working + misc

* Fixed evaluation + added global variables/dsl support to payloads

* Misc fixes related to variables evaluations

* Added http variables support to fuzz

* misc

* Misc

* Added testing playground + misc renaming

* Added support for path and raw request to fuzzing

* Fixed fuzz integration test

* Fixed variable unresolved issue

* Add multiple parameter support with same name

* Added parameter value as 'value' dsl variable for parts

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-11-01 20:28:50 +05:30
Ice3man
8f313629b8
Memory usage optimizations (#2350)
* Replaced strings.Replaced with fasttemplate reducing allocations

Custom template parsing logic was replaced with fasttemplate package for reducing
allocations in the replacer.Replace hotpath leading to allocation reduction which
accounted for 30% of total nuclei allocations.

$ go test -bench=. -benchmem
goos: darwin
goarch: arm64
pkg: github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/replacer
BenchmarkReplacer-8               837232              1422 ns/op            2112 B/op         31 allocs/op
BenchmarkReplacerNew-8           3672765               320.3 ns/op            48 B/op          4 allocs/op

* Fixed tests failing

* Use pre-compiled map of DSL expressions

* Reworked expression parsing logic to reduce memory allocations

$ go test -bench=. -benchmem
goos: darwin
goarch: arm64
pkg: github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/expressions
BenchmarkEvaluate-8        31560             37769 ns/op           31731 B/op        265 allocs/op
BenchmarkEvaluateNew-8       109144              9621 ns/op            6253 B/op        116 allocs/op
2022-08-23 13:16:41 +05:30
Ice3man
9e531727a7
Fixed a bug with numerical regex in unresolved var detection (#2431) 2022-08-17 03:59:51 +04:00
Mzack9999
a4cdba0691
Improving literals detection in expression engine (#2148)
* Improving literals detection in expression engine

* fixing lint errors

* re-add accidentally deleted test
2022-06-13 13:55:06 +05:30
Ice3man
409d0fce31 Skip unresolved expressions using a regex 2022-02-28 22:19:51 +05:30
mzack
766a3eefb6 Implementing incremental expression replacement 2022-02-01 14:12:16 +01:00
mzack
8559cfabca removing unused code 2022-01-19 15:16:47 +01:00
mzack
adf4721833 making markers parametric + simple match/replace for basic variables 2022-01-19 14:57:25 +01:00
mzack
369255a4fe Implementing lexer with runtime expression validation 2022-01-19 14:10:11 +01:00
forgedhallpass
8019fb8f08 test: additional use-cases for the expression test 2022-01-17 14:05:36 +02:00
forgedhallpass
bff1952268 test: introduce 'concat' DSL function
* removed irrelevant test case (covered elsewhere)
2022-01-17 13:41:34 +02:00
forgedhallpass
ae07dce014 refactor: removed redundant escape characters from the unresolvedVariablesRegex variable 2022-01-17 13:32:47 +02:00
forgedhallpass
7f6c72853f feat: introduce 'concat' DSL function #1502 2022-01-17 13:32:15 +02:00
Mzack9999
c26a1ac21c
Improving payloads support in AWS self-contained requests (#1443)
* Improving payloads support in AWS self-contained requests

* removing internal only values from output

* handling dynamic values in url
2022-01-09 18:09:50 +05:30
Mzack9999
0e8270c7b5
Replacing expression regex with lexical analyzer (#1440)
* Replacing regex with lexical analyzer taken from 610beb8534/v2/pkg/protocols/common/expressions/expressions.go (L66)
2022-01-09 17:22:04 +05:30
mzack
e59da29371 improving error/args handling 2021-12-18 20:06:51 +01:00
forgedhallpass
bebe5cbcfd refactor: Remove redundant character escapes from regexes 2021-11-25 16:24:37 +02:00
Mzack9999
7f5f791e23
Adding dns trace support in dns templates (#1236)
* Adding dns trace support in dns templates + minor refactoring
2021-11-18 19:22:11 +05:30
Ice3man
e79c6262b9
Merge branch 'dev' into cli-variables-as-payload 2021-10-09 19:57:48 +05:30
Ice3man
7de4cc902e
Merge pull request #1089 from projectdiscovery/variables-check
Added check for unresolved variables
2021-10-09 19:57:02 +05:30
Ice3man543
aacbb28052 Removed sniper + made batteringram default + misc 2021-10-09 19:46:23 +05:30
mzack
12b6b2ca89 Add support for CLI payload variables 2021-10-07 12:36:27 +02:00
Ice3man543
514d6f94ec Added support for urlencoded variable variation 2021-10-07 05:35:32 +05:30
Ice3man543
92857497f3 Fixed variable check regex 2021-10-07 01:48:10 +05:30
Ice3man543
ce13bf34d0 Added check for unresolved variables 2021-10-07 01:40:49 +05:30
Ice3man543
93ab540b54 Added payload support for network requests 2021-07-06 18:27:30 +05:30
Ice3man543
908889ccb5 Fixed expression parser + misc 2021-03-05 19:25:09 +05:30
Ice3man543
616ed342ed Misc 2021-02-26 14:45:48 +05:30
Ice3man543
72b626d20b Fixed erroring out on non-evaluable expressions 2021-02-26 13:31:10 +05:30
Ice3man543
d16102f955 Misc 2021-02-24 20:11:21 +05:30
Ice3man543
17d0b34e61 Added expressions package + expressions support to network protocols 2021-02-24 12:07:16 +05:30