Commit Graph

2038 Commits (ef8ef8edb3210156ea13cb9508b4b7c89a4c7515)

Author SHA1 Message Date
Mzack9999 62af038617
Add template sign/verify functionality (#3029)
* add template sign/verify functionality

* fixing syntax
2023-02-26 03:54:46 +05:30
Notealot aeb5dbd293
feat: add RawStringSlice / fix: reference url case insensitive (#3346)
* feat: add RawStringSlice and refactor

* restored old logic + refactor

* restored files

---------

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2023-02-26 01:17:47 +05:30
Mzack9999 84abef3f70 Merge branch 'dev' into issue-2188-reporting-client 2023-02-24 15:58:43 +01:00
王一之 994988357a adds missing json tags 2023-02-22 11:15:55 +08:00
Tarun Koyalwar 8cdc1338fc adds missing json tags and unit test 2023-02-22 02:24:45 +05:30
Alexandre ZANNI e3e60d0ba8
uncover: add criminalip support (#3162)
* update uncover engine options

* add criminalip support

* update criminalIP variable

---------

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: shubhamrasal <shubhamdharmarasal@gmail.com>
2023-02-21 00:23:11 +05:30
Tarun Koyalwar 21b03a2e8a
bug fix in url path and adds integration tests (#3331)
* fix unsafe edgecases+ adds integration test

* bug fixes and more url testcases

* upgrade cfssl

* fix template id in integration test
2023-02-20 22:26:04 +05:30
Sandeep Singh ba7fcd08ff
Merge branch 'dev' into issue-2188-reporting-client 2023-02-20 15:26:16 +05:30
王一之 85090b7531 fix some json deserialization issues 2023-02-17 14:21:25 +08:00
xm1k3 cc2f796d2f
Helper function for IP Formats (#3286)
* implemented ip_format helper function

* added tests on ip_format() helper

* fixes on logic

* fixes related to mapcidr docs

* better error value

* fixes + unit test to check index 11

* added call for integration tests

* fixes on dsl-functions number

---------

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2023-02-17 01:47:40 +05:30
Ice3man ecc1964ad9 Added optional doNotCache to protocols.ExecuterOptions 2023-02-13 18:00:25 +05:30
Mzack9999 d608ffaeb2
clear after stop (#3312)
* clear after stop

* fixing data races

* adding atomic cache

* fixing lint errors

* fixing imports
2023-02-13 16:46:41 +05:30
Sandeep Singh 687a481a85
Nuclei v2.8.9 release preparation (#3281)
* nuclei v2.8.9 release

* dep update

* fix go mod error

---------

Co-authored-by: Tarun Koyalwar <tarun@projectdiscovery.io>
2023-02-10 19:25:31 +05:30
Tarun Koyalwar e622b989fe
fix url re-encoding issues (#3294)
* fix double url encoding in urls

* remove extra slash

* url encode matchedURL
2023-02-10 18:28:28 +05:30
Ice3man 7e7bb1ed0a
AES CBC PKCS5Padding helper function update (#3287)
* Added DSL helper functions for CVE + misc

* Added aes_cbc with pkcspadding

* Misc

* Misc

* Misc

* Removed debug statement

* Misc

* Misc

* Fixed tests
2023-02-09 20:22:42 +05:30
Mzack9999 518944f6e8
Adding proxy use in headless binary download (#3290)
* Adding proxy use in headless binary download

* bumping utils
2023-02-09 20:01:49 +05:30
Mzack9999 454a883241
Using retryablehttp for templates loading (#3291)
* Using retryablehttp for templates loading

* Update compile_test.go
2023-02-09 19:15:44 +05:30
Tarun Koyalwar a62e57f6c0
fix publish docs (#3296)
* add branch ref while checkout

* Auto Generate Syntax Docs + JSONSchema [Thu Feb  9 13:36:50 UTC 2023] 🤖

---------

Co-authored-by: GitHub Action <action@github.com>
2023-02-09 19:14:43 +05:30
Mzack9999 0618ccb923 fixing lint errors 2023-02-07 10:18:28 +01:00
Mzack9999 02df1f2879 removing go 1.20 helpers 2023-02-07 10:16:37 +01:00
Mzack9999 cc343c6eda restoring 1.19 as 1.20 is marked unstable 2023-02-07 10:08:50 +01:00
Mzack9999 d57aec5ec7 converting reporting client to interface 2023-02-07 09:45:49 +01:00
Mzack9999 7556416e5b
adding interactsh support to sni (#3276) 2023-02-07 14:02:10 +05:30
Mzack9999 1fbd2c069a
adding json schema for extractor (#3240)
* adding json schema for extractor

* adding argument validation
2023-02-07 14:01:34 +05:30
xm1k3 1e5358b1fa
Improve passive templates error handling (#3098)
* fixes on passive templates

* Auto Generate Syntax Docs + JSONSchema [Thu Dec 29 08:47:22 UTC 2022] 🤖

* removed empty line

* warning management

When passive flag is provided we ignore all templates which are not compatible, without posting misleading errors

* removing redundant code

* skip offline errors with err var

* remove check on debug flag + used errors.Is() to check errors

important note for future refactoring: use errorsutil.Is() instead of errors.Is()

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2023-02-07 05:10:38 +05:30
GitHub Action afe2114d58 Auto Generate Syntax Docs + JSONSchema [Mon Feb 6 23:25:05 UTC 2023] 🤖 2023-02-06 23:25:05 +00:00
Tarun Koyalwar d18fa6f6b2 fix data race in race requests 2023-02-06 16:18:30 +05:30
Tarun Koyalwar 32a6adb82e
fix data race in payload (#3265) 2023-02-05 00:00:01 +05:30
Tarun Koyalwar 628628893c
fix make http request inconsistencies (#3243)
* fix make http request inconsistencies

* remove parameters from http vars

* fix trailingslash unit test

* naming conventions: best practices

* fix publish docs action

* remove branch ref from push
2023-02-01 17:23:28 +05:30
Sandeep Singh 2a24025397
go mod + version update (#3238) 2023-01-24 22:58:34 +05:30
Tarun Koyalwar 0b2a3e296a
fix url encoding issues and inconsistencies (#3211)
* fix url encoding issues

* complete requested changes and improvements

* fix missing issue-tracker-config.yaml

* fuzz: deepcopy and use urlutil.Params
2023-01-24 22:04:52 +05:30
Tarun Koyalwar edcab07fec
fix aws signer missing template variables (#3206)
* aws sign: fix missing variables

* signer: add aws defaults

* aws signer default values
2023-01-24 20:50:20 +05:30
Mzack9999 6c56a20544
Adding support for nmhe (#3219)
* adding support for nmhe

* updating docs
2023-01-22 15:08:50 +05:30
Tarun Koyalwar 6ebf5a789e
fix host spray race condition (#3213)
* core: bug fixes

* best practices: uniform comments
2023-01-20 23:49:04 +05:30
Ice3man 78c4b9b7d2
Added clustering support for TLS templates (#3209)
* Added clustering support for DNS protocol templates

* Added clustering support for TLS templates

* Fixed randomly populated info block in ssl templates

* Moved to a switch-case + added tests for clustering
2023-01-17 18:20:05 +05:30
Ice3man dbb4de028e
Added clustering support for DNS protocol templates (#3204) 2023-01-17 13:01:20 +05:30
sandeep 08e89cc541 release workflow update 2023-01-15 23:06:22 +05:30
Jaideep Khandelwal a1642be911
Enable/Disable a reporting source (#3183)
* Enable/Disable a reporting source

* misc options update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2023-01-15 22:21:16 +05:30
xm1k3 84b0581306
Markdown Reporting Index File (#3129)
* implemented index.md creation on markdown export

* fixes on markdown generation

added also hyperlink to markdown created

* code optimization and refactoring

* index header refactor
2023-01-15 22:00:34 +05:30
Dwi Siswanto 94ec553234
Add generate_jwt & json_{minify,prettify} helper functions (#3160)
* feat(dsl): add generate_jwt helper func

* feat(dsl): add json_{minify,prettify} & quote_escape

* update(dsl): change type of data var to map[string]interface{}

* docs(dsl): list valid algos for generate_jwt

* test(dsl): add test case for json_{minify,prettify} & quote_escape

* update(dsl): refactor generate_jwt

* fix(lint): use time.Until instead of t.Sub(time.Now()) (gosimple)

* revert(dsl): remove quote_escape func

* ability to fuzz jwt noNe algorithm

* fix lint error

* jwt dsl minor improvement

Co-authored-by: Tarun Koyalwar <tarun@projectdiscovery.io>
2023-01-15 21:58:51 +05:30
Ice3man 67c094444e
Added cloud scan progress tracking using stats (#3180)
* Added cloud scan progress tracking using stats

* Changed log messsage

* Fixed linting error

* Fixed bug in progress calculation logic

* Changed requests to input with cloud flag

* Changed progress name + removed redundant fields
2023-01-13 13:41:05 +05:30
Mzack9999 e4402e7449
lowering hmap storage requirement via omitempty (#3111) 2023-01-12 20:01:45 +05:30
Tarun Koyalwar e899afafdf
skip scanallip if input is ip (#3186)
* skip scanallips for ip input

* uncover,url parsing bug fix

* minor changes:best practices
2023-01-11 22:50:57 +05:30
Shubham Rasal 25fcae1493
add reporting source in nuclei-cloud (#3151)
* add reporting source in nuclei-cloud

- `nuclei -cloud -rc reporting-config.yaml`

* update error message

* add severity options for jira,(used for cloud only)
2023-01-10 22:49:01 +05:30
sandeep 1c046c387b version update 2023-01-05 22:07:02 +05:30
Mzack9999 8beb6b06f9
Extending advanced filtering (#3146)
* adding more metadata to advanced filtering

* adding functional test cases

* converting metadata to lowercase

* misc update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2023-01-05 21:59:58 +05:30
Tarun Koyalwar f646e00c3d
fix unsafe raw request matchedUrl (#3155)
* fix unsafe raw request matchedurl

* quote metadata in CLI output
2023-01-05 21:02:36 +05:30
Mzack9999 a96f764959
extending request/response hijacking with native calls (#3091)
* extending request/response hijacking with native calls

* fixing tests
2023-01-05 17:26:18 +05:30
Tarun Koyalwar 4aa2002e72
urlencode key characters only (#3150)
* only encode key characters

* improve test cases
2023-01-05 16:41:59 +05:30
Sandeep Singh 2d7948af55
Fixing host skipping error (#3143)
* removed error resulting into excessive error count

* banner update
2023-01-04 00:43:18 +05:30
Tarun Koyalwar e66ed30cec
fix missing trailing slash (#3127)
* raw: fix missing trailing slash

* adds rawpath integration test

* rename trailing slash test
2023-01-03 23:45:34 +05:30
shubhamrasal b03a90df50 fix template path bug, pass the filepath in executeroptions 2023-01-03 12:17:56 +05:30
Sandeep Singh e66821b49f
Added more error + display skipped host on default run for more visibility. (#3123) 2023-01-02 19:00:10 +05:30
Sandeep Singh 212d0e5cfc
Adding more error to ignore with hosts (#3121) 2023-01-02 17:09:39 +05:30
sandeep b6ec247701 version update 2023-01-02 13:59:51 +05:30
xm1k3 34120fbecc
#3046 persistent failed item status and #2065 failed items reporting error once (#3047)
* added logs for debug

* fixes

* removed logs

* using cache item

* implemented multiple tests

* fixed some unit tests

* implemented test for skipping

* added multiple tests together

* added mark failed

* fix on tests

* better test implementation + concurrent

* fix: fixes on concurrent tests

* removed parallel and 1 unit test

DOCS: by default the command go test runs in parallel tests for different packages, and default is the number of CPUs available (see go help build)

* fixes on go routine

* increasing parallelism of once.Do

* bumping go to 1.19 for atomic types support

* removing redundant check + fixing test concurrency on create

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2023-01-02 13:52:06 +05:30
Mzack9999 2c3453500c
Adding empty comparison for scan strategy (#3100)
* Adding empty edge case to scan strategy

* Auto Generate Syntax Docs + JSONSchema [Thu Dec 29 10:10:55 UTC 2022] 🤖

* adding test file

* removing test file

Co-authored-by: GitHub Action <action@github.com>
2022-12-29 20:12:52 +05:30
Mzack9999 6cdff62381
removing unwanted print debug (#2995) 2022-12-28 21:19:06 +05:30
Taufik Mulyana 7093180b6d
Add support to query DNS TLSA record (#3054)
* Add support to query DNS TLSA record

* fix build test

* fix ci-lint

* set expected to 0

* test domain update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-28 21:12:02 +05:30
Mzack9999 260dd1a2c4
Disable include directive preprocessing by default (#3045)
* adding strict syntax check

* returning error on disabled preprocessing

* adding check on matchers
2022-12-28 19:16:34 +05:30
Tarun Koyalwar ff17d12ced
adds scan strategy (#3075) 2022-12-28 02:18:00 +05:30
Tarun Koyalwar af2aaacbc9
fix url panic (#3092) 2022-12-27 22:41:33 +05:30
Shubham Rasal 91f6fdfb36
Merge pull request #3031 from projectdiscovery/parse_from_reader
Add ParseTemplateFromReader function
2022-12-27 20:47:49 +05:30
shubhamrasal 1df878fdd2 add template path in json output 2022-12-27 20:02:48 +05:30
Mzack9999 34976029d3
removing most go routine leaks (#3073)
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-24 19:22:14 +05:30
Tarun Koyalwar aee0870617
scanallip handle edge cases (#3080)
* bug fix:remove port during dns resolution

* scanallip fix edge cases

* add scanallips testcases

* workflow fix

* removing pull cmd

* Auto Generate Syntax Docs + JSONSchema [Sat Dec 24 13:29:21 UTC 2022] 🤖

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2022-12-24 19:03:23 +05:30
shubhamrasal 406d0c1873 Rename function from ParseFromReader to ParseTemplateFromReader 2022-12-22 11:04:16 +05:30
Sandeep Singh 96646c8f53
cloud templates targets sync (#2959)
* Add s3 bucket template provider

- Refactor the custom github template code
- add interface for template provider

* Validate if aws creds are passed if bucket flag

- refactor s3 provider struct to take client
- add function which returns the aws s3 client
- update error messages

* Add aws s3 bucket flags documentation in README.md

- Rename the github_test.go to customTemplate_test.go

* go mod update

* Move template provider code to pkg/external/customtemplates dir

* Added initial data_source sync to cloud

* Misc

* Add pagination to scan output and scan list (#2858)

* Add pagination to scan output and scan list

* Use time based parameters instead of page numbers

* Fix linting errors

* Do not check limits at client, check at server

* Remove unused constant

* Misc update

* Removed unnecessary flags

* Misc

* Misc

* Misc endpoint additions

* Added more routes

* Typo fix

* Misc fixes

* Misc

* Misc fixes to cloud target logic + use int for IDs

* Misc

* Misc fixes

* Misc

* Misc fixes

* readme update

* Add JSON output support for list-scan option (#2876)

* Add JSON output support for list-scan option

* Fix typo in cloud JSON output description

* Following changes

- Update status(finished, running) to be lower-case by default
- Convert status to upper-case in DisplayScanList()

* Update status to be lower-case by default

* Remove additional json flag, instead use existing

* Merge conflict

* Accomodate comment changes and restructure code

Co-authored-by: Jaideep K <jaideep@one2n.in>

* Use integer IDs for scan tasks

* Added get-templates-targets endpoint + JSON + validation

* Added target count list

* misc option / description updates

* Added changes as per code review

* duplicate options + typo updates

* Added tablewriter for tabular data writing by default

* Fixed list scan endpoint

* Review changes

* workflow fix

* Added cloud tags etc based filtering (#3070)

* Added omitempty for filtering request

* go mod tidy

* misc format update

Co-authored-by: shubhamrasal <shubhamdharmarasal@gmail.com>
Co-authored-by: Ice3man <nizamulrana@gmail.com>
Co-authored-by: Jaideep Khandelwal <jdk2588@gmail.com>
Co-authored-by: Siddharth Shashikar <60960197+shashikarsiddharth@users.noreply.github.com>
Co-authored-by: Jaideep K <jaideep@one2n.in>
2022-12-21 22:48:43 +05:30
Mzack9999 093d691c16
Issue 3033 deny list (#3037)
* fixing file deny list + refactoring

* err variable renaming

* removing redundant function

* removing unused code

* adding check on empty operator

* updating tests
2022-12-21 02:29:28 +05:30
xm1k3 bbb561b097
CLI variables are not accessible in SSL Protocol (#3069)
* added vars payload also in ssl

* fix on ssl.go, moved function on payloadValues creation

* added integration test

* rebase + minor changes

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-12-21 02:02:18 +05:30
xm1k3 aaae68ee50
The debug flags do not work correctly with headless templates (#3030)
* added check on BaseURL

* added debug flag instead on info

* added also debug response flag

* code refactoring
2022-12-20 17:30:34 +05:30
Mzack9999 2445662fb1
Fix memory leak on hmap with LRU (#3052)
* fix memory leak on hmap with LRU

* fixing lint issues
2022-12-20 15:37:48 +05:30
Tarun Koyalwar 63150a8ee4
add stop-at-first-match for headless protocol (#3034)
* headless: adds stop-at-first-match

* GH workflow fix

* misc fix

* headless use spm option

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-19 19:52:17 +05:30
shubhamrasal b51aac290e Add tests folder 2022-12-19 19:15:04 +05:30
shubhamrasal cff0d88742 Add tests for parse function
- update the ioutils to io.ReadAll
- remove extra line
2022-12-19 18:51:20 +05:30
Owen Rumney b3d6155f57
fix: Check workflow templates when creating inputhttp helper (#3049)
* go mod update

* fix: Take workflow templates into account when building input helper

- when input helper is created, workflow templates aren't taken into account when deciding if http/https should be added to the inputsHTTP
- include the store.Workflows into the slice of templates that is checked for HTTP Protocol

Resolves #3048

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-19 17:04:09 +05:30
xm1k3 0e3be82c72
Resuming rewriting the output file contents, so previous data removed (#2890)
* used OpenFile instead of Create()

* reverted to original mode

* fixes and resume flag added

* fix on noTimestapt var

* fix on flag

* better code refactoring

* fix on debug error

* code refactoring on file management
2022-12-15 21:11:23 +05:30
Víctor fd59841372
Replace break line characters with HTML notation when exporting to markdown (#3014)
* Fixes #2997, replace break line characters with HTML notation to avoid render the field text in a new line.

* using short helper

Co-authored-by: Víctor Zamanillo <victor.zamanillo@cifraeducacion.com>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-12-15 18:30:40 +05:30
shubhamrasal de3dda0030 Update the Parse function to use ParseFromReader 2022-12-15 17:41:07 +05:30
Mzack9999 a19385376c
Extending YAML to support include preprocessing (#1767)
* Add support for include directive

* adding yamlc support

* mod tidy

* removing yamlc

* moving code around
2022-12-14 01:05:14 +05:30
Mzack9999 221cd7b6a2
Merge pull request #3007 from vzamanillo/input-transform-refactor
Significant refactor around the input to type conversion
2022-12-13 14:12:21 +01:00
Mzack9999 aed709bd06 using helpers 2022-12-13 13:43:54 +01:00
Víctor Zamanillo bbee2ee8db Removed else branch
typeHostWithOptionalPort return the host raw input value if has not port
2022-12-13 09:07:52 +01:00
shubhamrasal 198d84ec25 Add ParseFromReader function 2022-12-13 12:57:47 +05:30
Tarun Koyalwar a5b39dcaa5
automerge url parameters from input and templates (#3010)
* fix automerge url parameters

* fix url encoding & refactor raw request

* handle trailing slash edgecases

* minor code refactoring
2022-12-13 12:09:31 +05:30
Chris Mandich aeddddc31f
Add exporter for splunk hec reporting (#3008)
* Update LICENSE.md

* removing per project COC in favor of global one (#2983)

* removing per project COC in favor of global one

* using global security info

* go mod update

* Add Splunk HEC Exporter support to Nuclei

* small refactor

Co-authored-by: Jane <5116641+JaneX8@users.noreply.github.com>
Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-12-12 21:26:32 +05:30
sandeep 7c2cad7845 dev version update 2022-12-11 18:36:21 +05:30
sandeep f167ad774b bug fix release 2022-12-11 18:13:35 +05:30
Ice3man 3904d541be
Added http probing to clustering + add disable-clustering flag (#3019)
* Added http probing to clustering + add disable-clustering flag

* misc update

* Commented out failing test

* Fixed lint error

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-11 18:06:21 +05:30
sandeep b3312526b7 dev version update 2022-12-11 17:56:07 +05:30
Víctor b77787e9bd
OfflineHTTPProtocol mapping (#2993)
* OfflineHTTPProtocol mapping, fixes #2988

* Reject not mapped protocols

Co-authored-by: Víctor Zamanillo <victor.zamanillo@cifraeducacion.com>
2022-12-11 17:34:25 +05:30
Mzack9999 96c1dd3720
Adding custom ip to protocol generated variables (#3011)
* lint errors

* Extending context args support

* Ip => ip
2022-12-10 00:17:03 +05:30
Víctor Zamanillo c97c3aca33 Better typeHostWithOptionalPort test 2022-12-08 21:08:10 +01:00
Víctor Zamanillo 5f02282468 Significant refactor around the input to type conversion for clarity and dedup. 2022-12-08 21:00:55 +01:00
sandeep f4c2212a88 version update 2022-12-08 22:03:34 +05:30
Tarun Koyalwar e4ae90885b
handle input url edge cases (#3004)
* handle input url edge cases

* remove extra url logic
2022-12-08 20:04:32 +05:30
sandeep 268970363a go mod mismatch / sum fix 2022-12-06 02:35:25 +05:30
Ice3man 30f26a32ed Do not consider fuzzing template during clustering 2022-12-05 23:07:38 +05:30
Tarun Koyalwar 2874a9dff7
fix -iv & minor bugs (#2951)
* fix -iv & minor bugs

* fix ipversion defaults

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-12-05 18:22:04 +05:30
GitHub Action bf1fb7bcb7 Auto Generate Syntax Docs + JSONSchema [Sun Dec 4 17:58:29 UTC 2022] 🤖 2022-12-04 17:58:29 +00:00
xm1k3 628b96f768
added force http2 option (#2919)
* added force http2 option

* implemented http2 with transport method

* fix and added forcehttp on clientpool

* updated readme with new flag

* option update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-04 22:32:01 +05:30
51pwn 38cfc1c183
fixed #2603 set User-Agent bypass Go-http-client for waf 2022-12-03 (#2958) 2022-12-04 22:30:38 +05:30
Ice3man 514c6e2d1e
Added timestamp optional flag + user-agent to probing (#2962)
* Added timestamp optional flag + user-agent to probing

* fix typo

* misc update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-04 22:16:55 +05:30
Mzack9999 fdd22bf0a8
Adding client/server hello in ssl templates (#2782)
* Adding client/server hello in ssl templates

* go mod update

* go mod update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-12-04 22:04:18 +05:30
Sandeep Singh 6ae9eee8d3
README + misc updates (#2961)
* readme update

* version + banner update

* misc option update

* go fmt'ed code

* misc update
2022-12-04 20:51:33 +05:30
Sandeep Singh 515503f5f6
Added connection refused error to skip with MaxHostError option (#2955) 2022-12-03 12:54:03 +05:30
Tarun Koyalwar 3b31799847
Issue 2840 aws signature (#2924)
* docker go version update

* docker fix

* version update

* update chinese readme and typo fixes. (#2862)

* fix aws request signer

* fix reader by upgrading retryablehttp-go

* go mod tidy

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: Xc1Ym <xuedongyuming2233@gmail.com>
2022-12-03 07:10:57 +05:30
Mzack9999 6308d90cd7
Fixing reported dialed ip (#2950)
* Fixing reported dialed ip

* go mod update

* mod fix

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-12-03 06:29:22 +05:30
Shubham Rasal d5a09e733a
Issue 2772 s3 provider support (#2825)
* Add s3 bucket template provider

- Refactor the custom github template code
- add interface for template provider

* Validate if aws creds are passed if bucket flag

- refactor s3 provider struct to take client
- add function which returns the aws s3 client
- update error messages

* Add aws s3 bucket flags documentation in README.md

- Rename the github_test.go to customTemplate_test.go

* go mod update

* Move template provider code to pkg/external/customtemplates dir

* Remove github and aws update variables from flag

* Rename CustomTemplateProvider to Provider

* Update integration and function command in makefile

* Update github test case, accept token

* readme update

* go mod tidy

* Update build-test.yml

* handle empty dir in s3

* Add requested changes

- download/update s3 and github only when `-ut` is passed
- only print the missing env variable for s3
- add the custom templates path in
  ~/.config/nuclei/.template-config.json

* print custom paths only if exists in config file

* misc update

* tag update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-12-02 03:57:00 +05:30
dependabot[bot] 9d6ca66da9
chore(deps): bump github.com/projectdiscovery/uncover from 0.0.9 to 1.0.0 in /v2 (#2926)
* chore(deps): bump github.com/projectdiscovery/uncover in /v2

Bumps [github.com/projectdiscovery/uncover](https://github.com/projectdiscovery/uncover) from 0.0.9 to 1.0.0.
- [Release notes](https://github.com/projectdiscovery/uncover/releases)
- [Changelog](https://github.com/projectdiscovery/uncover/blob/main/.goreleaser.yml)
- [Commits](https://github.com/projectdiscovery/uncover/compare/v0.0.9...v1.0.0)

---
updated-dependencies:
- dependency-name: github.com/projectdiscovery/uncover
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add uncover netlas source

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shubhamrasal <shubhamdharmarasal@gmail.com>
2022-11-30 20:29:55 +05:30
Tarun Koyalwar d566ad9cc6
enhance sarif output (closes #2608) (#2925)
* enhance sarif output (closes #2608)

* sarif: format result title

* go mod update

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-11-30 20:22:27 +05:30
Shubham Rasal ebfd2e648a
Remove nuclei-updatecheck-api as dependency (#2923)
* Remove nuclei-updatecheck-api as dependency

* Run go mod tidy

* go mod tidy

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-11-29 23:53:05 +05:30
Víctor 9c17284616
Display tpl contents (#2906)
* New "td" flag, displays the highlighted template contents
New verboseTemplate method to avoid duplicate code
Grouped (and sorted) template list per directory

* Updated README about the td flag

* Going back to the previous template list format

The new one can't be pipelined

* Implicit template list on template display
Respect --no-color option to disable colors when -td is used

* misc option update

Co-authored-by: Víctor Zamanillo <victor.zamanillo@cifraeducacion.com>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-11-29 17:48:44 +05:30
Ice3man 44476c2e5b
Merge pull request #2909 from projectdiscovery/issue-2848-case-insensitive-matcher-name
Making matcher name case insensitive
2022-11-28 13:58:43 +05:30
Mzack9999 a1ecef6b61
Mocking dns server (#2908)
* mocking dns server

* fix lint errors
2022-11-28 13:52:40 +05:30
dependabot[bot] e0dfc476c3
chore(deps): bump github.com/projectdiscovery/ratelimit from 0.0.1 to 0.0.2 in /v2 (#2915)
* chore(deps): bump github.com/projectdiscovery/ratelimit in /v2

Bumps [github.com/projectdiscovery/ratelimit](https://github.com/projectdiscovery/ratelimit) from 0.0.1 to 0.0.2.
- [Release notes](https://github.com/projectdiscovery/ratelimit/releases)
- [Commits](https://github.com/projectdiscovery/ratelimit/compare/v0.0.1...v0.0.2)

---
updated-dependencies:
- dependency-name: github.com/projectdiscovery/ratelimit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixing int type

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-11-28 12:49:30 +05:30
Mzack9999 d3a929d4c3 Making matcher name case insensitive 2022-11-25 17:22:50 +01:00
Mzack9999 b3d4dba047
Reverting retryablehttp-go to fix custom http client (#2900)
* Reverting retryablehttp-go to fix custom http client

* fixing sandbox test
2022-11-24 21:16:03 +05:30
Ice3man 291a0fea94
Merge pull request #2856 from projectdiscovery/sandbox-pr
Added sandboxing for payload files and requests
2022-11-24 14:07:33 +05:30
Parth Malhotra 3014b40ac6
Fixes #2885 (#2886)
* docker go version update

* docker fix

* version update

* update chinese readme and typo fixes. (#2862)

* Fixes #2885

Fixes #2885

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Co-authored-by: Xc1Ym <xuedongyuming2233@gmail.com>
2022-11-23 18:21:22 +05:30
Ice3man e7fb40a413 Added sandboxing for payload files and requests 2022-11-16 13:49:24 +05:30
Shubham Rasal 6b142d794a
Issue 2254 uncover integration (#2786)
* nuclei -uq 'vuln:CVE-2021-26855' -t cves/2021/

- `nuclei -uq 'vuln:CVE-2021-26855' -t cves/2021/`

* Add automatic template execution using metadata

- Query uncover after the template is loaded.
- Add the received hosts to the input provider from uncover
- Make NormalizeStoreInputValue() function public to add hosts from the
  runner after uncover hosts received.

* run go mod tidy

* Remove unnecessary comments

* Resolve the requested changes

- move uncover code to protocols/common/uncover package
- Use uncover delay to create uncover rate limiter
- Use single ratelimiter object and remove not required ratelimiters
- Create Set() method for input provider interface
- Rename normalizeStoreInputValue to Set() method

* Solved the uncover running twice.

- flag StringSliceVarP adds the default value twice in the variable
- Check if provider keys exists or not
- Add uncover help block to english readme.md

* Add uncover field functionality

- ./nuclei -uq 'vuln:CVE-2021-26855' -t dns -duc -uf host
- ./nuclei -uq 'vuln:CVE-2021-26855' -t dns -duc -uf ip:port

* Update error messages and solve nuclei hang for wrong uncover engine

- Get uncover engine values from uncover package

* Resolve merge conflicts

* misc option update

* Update logging for templates

- remove duplicate env log printing
- Log message for template queries

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-11-16 11:12:39 +05:30
forgedhallpass 0295ca19bc
Add `split` DSL function (#2838)
* Add support for showing overloaded DSL method signatures

* Add `split` DSL function #2837

* fixing lint warnings

* replacing faulty regex with strings methods

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-11-14 06:08:12 +05:30
Mzack9999 1fbbca66f9
Adding support to scan all v4/v6 IPs (#2709)
* Adding support to scan all v4/v6 IPs

* adding tests

* metainput prototype

* using new signature

* fixing nil pointer

* adding request context with metadata

* removing log instruction

* fixing merge conflicts

* adding clone helpers

* attempting to fix ipv6 square parenthesis wrap

* fixing dialed ip info

* fixing syntax

* fixing output ip selection

* adding integration tests

* disabling test due to gh ipv6 issue

* using ipv4 only due to GH limited networking

* extending metainput marshaling

* fixing hmap key

* adding test for httpx integration

* fixing lint error

* reworking marshaling/id-calculation

* adding ip version validation

* improving handling non url targets

* fixing condition check
2022-11-09 18:48:56 +05:30
Mzack9999 840028fa93
adding host with optional port type logic (#2815)
* adding host with optional port type logic

* adding comment support in test cases

* updating test cases with multiple input scenarios

* readding port condition
2022-11-08 19:49:45 +05:30
Mzack9999 6ac669eb43
Replacing rdap with fixed fork (#2819)
* Replacing rdap with pd fixed fork

* mod tidy

* updating rdap commit ref

* reworking rdap client pool

* removing unused code
2022-11-08 17:27:18 +05:30
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
Shubham Rasal 721c4964d7
Issue 2613 custom template GitHub (#2630)
* Add custom template download/update support from github

- Accept the -gtr flag to accept the list of custom template
  repos(public/private)
- Accept the -gt flag for github token. It internally sets os.Env
  variable
- Update the flags from
   - -update to -nuclei-update for nuclei self update
   - -ut to -tup for template-update
   - -ud to -tud for custom template location
- Add github.go file which has code related to download and update
  custom templates repos.

* Reslove golint and test case error

* Take default template from community directory

- No need to give explicit community directory path.
- Update the integration test to support the change in path

* Update functional test script update template flag

* Update the path from community to nuclei-template

- Revert the code changes that were made to add community directory

* remove the comment

* Update the interactsh server url for testing

* Update race condition command

* update race condition cmd to download the templates

* Debug integration test failure

* update integration test to update templates

* Refactor downloadCustomTemplate function.

- Remove the log prining instead send the message.

* Add test case for custom template repo download

* move the download repo for loop into diff function

* refactor updateTemplate function.

* Create struct for github repos.

- Create customtemplate struct for repo.
- Add functions to customtemplate

* update readme.md file

* Refactor the downloadCustomTemplate function

- create const variables for github & community as template type
- Update gologger to INF
- Validate templateUpdate to accept only github & community value.
- Validate tempalteUpdate require githubTemplateRepo

* Resolve requested changes

* go mod update

* misc option update

* test update

* Revert back update-template flag to boolean.

- to update community templates
  `nuclei -ut`
- to update custom templates
  `nuclei -ut -gtr ehsandeep/mobile-nuclei-templates`

* Update readme to update flag documentation

* Update go.mod

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-11-03 20:27:18 +05:30
Ice3man e1b0564c0a
Fixed nested expression replacement using fasttemplate (#2790) 2022-11-03 18:31:04 +05:30
GitHub Action 411e39c40b Auto Generate Syntax Docs + JSONSchema [Tue Nov 1 15:01:38 UTC 2022] 🤖 2022-11-01 15:01:38 +00:00
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 cd0517c887
Fixed invalid fields in request (#2788) 2022-11-01 16:10:41 +05:30
Sajad e163a301b9
add dns protocol ratelimit (#2763)
* add dns protocol ratelimit

* move dns ratelimit to just before sending the request
2022-10-29 04:29:13 +02:00
Mzack9999 cc0c20053a
Improving unsafe uri path (#2722)
* Improving unsafe uri path

* fixing raw path output
2022-10-27 20:09:38 +02:00
mzack fe798c07eb fixing function syntax 2022-10-25 21:01:42 +02:00
dependabot[bot] 1783207803
chore(deps): bump github.com/projectdiscovery/stringsutil from 0.0.1 to 0.0.2 in /v2 (#2751)
* chore(deps): bump github.com/projectdiscovery/stringsutil in /v2

Bumps [github.com/projectdiscovery/stringsutil](https://github.com/projectdiscovery/stringsutil) from 0.0.1 to 0.0.2.
- [Release notes](https://github.com/projectdiscovery/stringsutil/releases)
- [Commits](https://github.com/projectdiscovery/stringsutil/compare/v0.0.1...v0.0.2)

---
updated-dependencies:
- dependency-name: github.com/projectdiscovery/stringsutil
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* updating function name

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-10-25 09:32:35 +02:00
Sajad 928f082109
set content_length as len(body) if response ContentLength is -1 (#2407)
* set content_length as len(body) if response ContentLength is -1

* move content-length calculation to utils

* adding basic tests

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-10-24 16:37:09 +02:00
Jaideep Khandelwal 4cfde111f4
Feature 18 cloud flags (#2708)
* Add cloud flags for nuclei.

* Add flag to get output for a particular scan ID

* Add some comments to the function.

* Get timestamp and id for scan list

* Fix linting errors

* Check if type is enumeration.

* Do not show deleted scans.

* Do not use filter_result, create client once and use it everywhere with
runner.

* Fix the output of scan list to be better

* Format the nuclei scan output list.

* Remove unused constant

* misc option update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-10-22 04:06:52 +05:30
Ice3man 363ffb75db
Added probing for URL + input based on protocol (#2614)
* Added workflow names based condition

* Added conditional filtering to workflow executor

* Replaced names with single name stringslice

* Added probing for URL + input based on protocol

* Remove debug comments

* Fixed typo

* Fixed failing tests

* Fixed workflow matcher condition + tests

* Fixed workflow item name

* Switch to if-else

* Fixed review comment strict

* Increase bulk size

* Added default port for SSL protocol + misc changes

* Fixed failing tests

* Fixed misc changes to executer

* Fixed failing self-contained and offlinehttp tests

* Fixed atomic increment operation

* misc update

* Fixed failing builds

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-10-20 17:23:00 +05:30
Sajad 0149e94f90
add missing template filters to workflow loader (#2741) 2022-10-20 17:14:41 +05:30
Ice3man d956f08cb9
Added attack-type option to override template attack-type (#2724)
* Added attack-type option to override template attack-type

* Added docs + integration tests
2022-10-19 03:51:45 +05:30
Mzack9999 9493dfdb20
Adding automatic request condition detection (#2707)
* Adding automatic request condition detection

* adding missing checks on part

* test update as per latest change

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-10-15 15:19:04 +05:30
Shubham Rasal 897dbe8e4c
Add AS input support (#2712)
* Add AS input support

- Integrate mapcidr asn function to handle ASN number input support
- Check if input is ASN number or not. If yes then query for cidrs
- issue #2706

* Remove \r coz of failing test cases in windows os

* Replace newline char for windows

* remove extra line

* rename goldenfile dir to tests

* fixing folder name

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-10-14 00:25:00 +05:30
LuitelSamikshya 944d24a252 mics changes 2022-10-13 09:30:25 -05:00
LuitelSamikshya cb0da81a14 ratelimit library 2022-10-12 22:04:37 -05:00
Bertold Kolics 1af96fc679
Issue 2460: extended unit tests for replacer (#2691) 2022-10-10 22:00:43 +05:30
mzack 70cecf83fb Adding custom cancel function 2022-10-10 08:10:07 +02:00
Ice3man 09ceb29ba3 Fixed build error on 32bit arch 2022-10-08 01:55:18 +05:30
Ice3man 6c93d99745 Fixed failing lint tests 2022-10-08 00:10:32 +05:30
sandeep 299755b1a3 go mod + version update 2022-10-07 23:17:08 +05:30
Ice3man 9944f5e94e
Added response truncation support with flags (#2688)
* Added response truncation support with flags

* Fixed failing tests for no size
2022-10-07 20:10:00 +05:30
Shubham Rasal 3ebd1f689b
cidr input support #2665 (#2675)
* Add CIDR input support

- Add expandCIDRInputValue function which accepts the cidr,
  and stores the IPs into hmap. It uses mapcidr to get the expanded IPs
- Add test case to test expandCIDRInputValue and isCIDR function
- Update dsl_test.go which had typo. coz of failing test

* Resolve the requested changes
2022-10-07 14:28:02 +05:30
Ice3man 1fd83c03bc
Improved dsl test by removing coloring + fix datatime tests (#2654)
* Improved dsl test by removing coloring + fix datatime tests

* Fixed tests for dsl coloring
2022-10-06 03:18:05 +05:30
Mzack9999 33ed5e7c93
Merge pull request #2671 from bertold/bk/randomip-unittest
Unit test for GetRandomIPWithCidr and fixes
2022-10-04 12:29:41 +02:00
Bertold Kolics 087be32ae0 Added unit test for GetRandomIPWithCidr
Fixed an issue with handling non-zero based networks
Fixed an issue handling network addresses with single IPs
2022-10-03 18:30:55 -05:00
Ice3man e875da208e
Merge pull request #2653 from projectdiscovery/elasticsearch-host-support
Added elasticsearch host reporting field support
2022-10-03 16:47:18 +05:30
Mzack9999 781e4e6105
Shared Execution Context Prototype (#2576)
* renaming var

* Introducing shared execution context prototype

* fixing field name

* adding shared values propagation

* adding shared context lock

* add slice values normalization

* adding integration tests

* adding metadata support for dns

* adding multi-protocol context sharing test

* removing debug test files

* moving contextargs around

* adding comments

* refactoring code

- getter/setter for complex types
- using pointers to avoid heap allocations
2022-10-03 15:42:20 +05:30
Mzack9999 0b1ff2bfa4
Forcing conns to be gc-ed by default disabling keep-alive (#2642)
* Forcing conns to be gc-ed with keep-alive

* removing redundant code

keep-alive are disabled by default

* fixing merge conflict

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-09-30 04:25:56 +05:30
GitHub Action 935dd68355 Auto Generate Syntax Docs + JSONSchema [Wed Sep 28 22:44:26 UTC 2022] 🤖 2022-09-28 22:44:26 +00:00
Mzack9999 18f14b631c
Adding same host redirect support (#2655)
* simplifying test syntax

* adding same host redirect + refactoring redirect handling

* adding missing file

* adding support for template syntax

* adding integration test

* updating options

* fixing issue on same host redirect
2022-09-29 04:11:28 +05:30
Mzack9999 3d2374ab73
Merge pull request #2637 from projectdiscovery/dependabot/go_modules/v2/dev/github.com/go-rod/rod-0.111.0
chore(deps): bump github.com/go-rod/rod from 0.110.0 to 0.111.0 in /v2
2022-09-28 13:41:51 +02:00
mzack 2cf0005eaa updating syntax 2022-09-28 01:51:47 +02:00
Ice3man 6d96f75df7 Added elasticsearch host reporting field support 2022-09-28 01:25:51 +05:30
aprp 57b0d78dcf
add unit tests for extract.go (#2635) 2022-09-28 01:24:00 +05:30
Myung-jong Kim 9eea441b0e
Add `sort(list)`, `sort(string)`, `uniq(list)`, `uniq(string)` helper functions (#2372)
* Add feature in join() to sort a single string slice

Signed-off-by: Myung-jong Kim <mjkim610@gmail.com>

* Add sort helper function and related tests

Signed-off-by: Myung-jong Kim <mjkim610@gmail.com>

* Add uniq helper function and related tests

Signed-off-by: mjkim610 <mjkim610@gmail.com>

Signed-off-by: Myung-jong Kim <mjkim610@gmail.com>
Signed-off-by: mjkim610 <mjkim610@gmail.com>
2022-09-27 02:59:13 +05:30
Ice3man fc27fc94a5
Added default config generation for reporting options (#2605) 2022-09-27 02:40:34 +05:30
GitHub Action 3ad1fec1d2 Auto Generate Syntax Docs + JSONSchema [Tue Sep 20 21:37:56 UTC 2022] 🤖 2022-09-20 21:37:56 +00:00
Mzack9999 99c14f4c9c
implementation of rate limiter with bucket refill and unrestricted token burst (#2536)
* implementation of rate limiter with interval burst

* fixing import path

* fixing syntax

* adding tests

* fixing lint errors

* adding support for context

* moving rate limiter earlier to avoid hitting timeout
2022-09-19 17:09:28 +05:30
Ice3man 03c7e89d9e
Added workflow names based condition (#2594)
* Added workflow names based condition

* Added conditional filtering to workflow executor

* Replaced names with single name stringslice

* Fixed workflow matcher condition + tests

* Fixed workflow item name
2022-09-19 16:49:30 +05:30
mzack 37c016a5f0 fixing lint errors 2022-09-19 08:38:52 +02:00
Ice3man 04b47b0309
Added custom json-unmarshaller + misc updates (#2556)
* Added custom json-unmarshaller + misc updates

* Added support for nuclei-cloud based scan execution

* Removed unnecessary files

* Misc

* Changes as per review comments

* misc option update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-09-19 01:13:59 +05:30
Ice3man 7e209dad01
Added multi-protocol requests support for templates (#2611) 2022-09-16 23:10:39 +05:30
Sajad 5377ee3f36
add proxy support at dialer level (#2549)
* add proxy support at dailer level

* add forward dialer to proxy
2022-09-16 21:36:17 +05:30
Sami f3eb0daa39
additional dsl functions (#2550)
* additional dsl functions

* avoid conversion at each iteration
2022-09-08 14:25:34 +05:30
Mzack9999 7ce03bcc5b
Optional use of local chrome for headless tests via tags (#2568) 2022-09-07 16:09:22 +05:30
forgedhallpass fc0763641f
New dsl functions (#2545)
* Update GO version to 1.18

* Removed redundant entry from the .gitignore file

* Added new DSL functions

to_unix_time(input string, optionalLayout string) int64
hex_to_dec(input string) float64
oct_to_dec(input string|number) float64
bin_to_dec(intput string|number) float64

* Notify if debug is enabled when a proxy cannot be validated

* Documentation: Go version requirement updated to 1.18

* test fix: Timezone agnostic date expectation in the assertion

* code review: extracted the default date-time layouts into a global variable
2022-09-07 00:44:29 +05:30
sandeep 567a8c60a2 dev version update 2022-09-02 12:52:07 +05:30
Ice3man e193e7c87e
Added tlsx integration to nuclei (#2522)
* Added tlsx integration to nuclei

* tls tests fix

* Added helper functions + upgrade tlsx to fix

* go mod update

* workflow fix to race test on windows

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2022-09-01 23:56:55 +05:30
James Turner 42a0732d68
Add sha512 support (#2517) 2022-08-31 12:36:02 +05:30
Ice3man 466176e9e8
Merge pull request #2500 from projectdiscovery/goflags-update
Updated goflags to latest + misc
2022-08-30 11:52:25 +05:30
M. Ángel Jimeno 62a4e0aa52
Return wrapped errors for DSL compilation problems (#2492)
This allows the DSL help information to be printed when in debug mode.

Fixes #2481
2022-08-29 13:41:32 +05:30
Myung-jong Kim 01fbb3050d
Added option to list DSL function (#2497)
* Add lds flag

* misc flag update

* readme update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-08-28 16:37:21 +05:30
Ice3man 8892250583 Updated goflags to latest + misc 2022-08-27 19:35:17 +05:30
sandeep efdc57c7b2 version update 2022-08-26 14:18:32 +05:30
Sajad 011da1388d
add option to specify network interface (#2384)
* add option to specify network interface

* add source-ip flag

* fix typo

* fix err return

* readme update

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-08-25 17:42:35 +05:30
Mzack9999 30054d1fb6
Adding advanced template filtering (#2374)
* Adding advanced template filtering

* fixing bug in slice

* refactoring tests

* adding test cases

* increasing error verbosity

* fixing quoted fields with spaces

* adding more test cases

* fixing merge error

* fixing lint errors

* switching to []string

* updating tag filter tests

* updating functional tests

* fixing functional test cases

* updating syntax
2022-08-25 16:52:08 +05:30
Sami 0aac36a44b
added custom config flag (#2399)
* added custom config flag

* config.yaml file in custom  directory

* lint error fix

* few updates and error checks

* fix lint error

* copy config.yaml file if the dest folder does not exist

* lint error check

* added integration test

* improved test cases

* lint error fix
2022-08-25 16:10:07 +05:30
51pwn 606c361b2a
Add `substr` and `aes_cbc` DSL functions (#2361)
* 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>
2022-08-25 15:50:08 +05:30
Ice3man 0be596efb4
Added variable debug support with debug mode (#2442)
* Added variable debug support with debug mode

* Added changes as per review comments

* Fixed debug request condition
2022-08-25 15:37:03 +05:30
Ice3man 7b7936b7a5
Added show-actions flag to display headless actions (#2456)
* Added show-actions flag to display headless actions

* misc update

* readme update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-08-25 10:43:32 +05:30
M. Ángel Jimeno ecb3f21076
http: prevent HTTP 'connection' header from being added twice (#2480)
* http: prevent HTTP 'connection' header from being added twice

* misc fix

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-08-25 00:25:02 +05:30
Ice3man 8165db2633
Fixed fatal panic in http header map read (#2488) 2022-08-24 23:29:22 +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 e7cffad312
Fixed request annotation based timeout bugs + tests + misc (#2476) 2022-08-23 12:45:55 +05:30
Dani Goland 8670c8b20d
Modified "xpath" extractor to support XML XPath in addition to HTML XPath (#2471)
* Modified "xpath" extractor to support XML XPath in addition to HTML XPath

* Updated function docs
2022-08-22 15:27:32 +05:30
xixijun 2ae7e58c83
Fix socks5 proxy not working on tor proxy (#2455)
* fix: socks5 proxy not working on tor proxy

* fix: socks5 proxy not working on tor proxy

* minor refactoring

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2022-08-22 15:18:45 +05:30
Sami d14c00fc6f
added validation for headless templates (#2423)
* added validation for headless templates

* minor update in log msg
2022-08-17 17:10:27 +04:00
Ice3man 9e531727a7
Fixed a bug with numerical regex in unresolved var detection (#2431) 2022-08-17 03:59:51 +04:00
sandeep 3193bf8f94 version update 2022-08-13 01:26:43 -07:00
Ice3man 67d5769cd9
Added initial catalog interface implementation (#2318)
* Added initial catalog interface implementation

* Added OpenFile to Catalog + disk catalog implementation

* Fixed merge issues

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-08-10 11:05:58 -07:00