15 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
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
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
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
forgedhallpass
bebe5cbcfd refactor: Remove redundant character escapes from regexes 2021-11-25 16:24:37 +02:00
Ice3man543
aacbb28052 Removed sniper + made batteringram default + misc 2021-10-09 19:46:23 +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
72b626d20b Fixed erroring out on non-evaluable expressions 2021-02-26 13:31:10 +05:30
Ice3man543
17d0b34e61 Added expressions package + expressions support to network protocols 2021-02-24 12:07:16 +05:30