Commit Graph

2038 Commits (ef8ef8edb3210156ea13cb9508b4b7c89a4c7515)

Author SHA1 Message Date
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
Ice3man 4dc98a1d95
Added support for blank Request-URI which specifies no slash suffix (#2414) 2022-08-10 10:15:09 -07:00
Sajad c4ba2b4edb
Additional helpers (#2359)
* add starts_with, ends_with helper functions

* add test cases, update dsl signatures

* change split_starts_with to line_starts_with
2022-08-06 23:16:03 +05:30
sandeep c815f53e67 interactsh test domain update 2022-08-04 19:37:33 +05:30
forgedhallpass d24736f655 fix typo in the headless `setmethod` function #2365 2022-07-29 14:38:07 +03:00
sandeep 125588046e version update 2022-07-28 17:05:29 +05:30
Mzack9999 b942ddc6ad
Fixing map race condition (#2340) 2022-07-26 18:30:15 +05:30
Sami 4da4ca5a16
missing ip in json (#2310)
* missing ip in json

* using GetDNSData in place of GetDialedIP

* updated go mod

* bumping rawhttp test version

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-07-26 17:08:53 +05:30
sandeep 3052d8a7f6 Merge branch 'dev' of https://github.com/projectdiscovery/nuclei into dev 2022-07-24 15:00:44 +05:30
sandeep ee9f8b7651 version update 2022-07-24 15:00:36 +05:30
Sajad 005b92217f
return on parse template error unconditionally (#2327) 2022-07-24 14:56:06 +05:30
Ice3man 7d7314e3f3
Added global variables support to SSL protocol (#2325) 2022-07-22 01:35:21 +05:30
Ice3man 2873e6ebc8
Added timeout context cancellation to http requests (#2319) 2022-07-21 21:29:34 +05:30
Mike Rheinheimer 9efba05e0c
expose hosterrorscache.Cache as an interface (#2291)
* expose hosterrorscache as an interface, change signature to capture the error reason

* use the hosterrorscache.CacheInterface as struct field so users of Nuclei embedded can provide their own cache implementation

Co-authored-by: Mike Rheinheimer <mrheinheimer@atlassian.com>
2022-07-19 02:05:53 +05:30
Ice3man 07d5beb73a
Fixed race condition with raw http options (#2306) 2022-07-19 01:08:30 +05:30
Mzack9999 cf1039f49c
Adding prototype of request flow override annotations (#2161)
* Adding prototype of request flow override annotations

* reworking iteration engine

* adding directory to .gitignore
2022-07-18 14:16:03 +05:30
sandeep 4ae458df98 readme update 2022-07-18 13:11:28 +05:30
dependabot[bot] 85ca247d26
chore(deps): bump github.com/go-rod/rod from 0.107.3 to 0.108.1 in /v2 (#2272)
* chore(deps): bump github.com/go-rod/rod from 0.107.3 to 0.108.1 in /v2

Bumps [github.com/go-rod/rod](https://github.com/go-rod/rod) from 0.107.3 to 0.108.1.
- [Release notes](https://github.com/go-rod/rod/releases)
- [Commits](https://github.com/go-rod/rod/compare/v0.107.3...v0.108.1)

---
updated-dependencies:
- dependency-name: github.com/go-rod/rod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* increasing page timeout

* further increasing timeout

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-07-14 03:14:13 +05:30
invist db727db006
Optionally disable templates syntax strict check (#2266)
* nuclei::templates|define strict option (default)

* renaming flag and internal variable

* misc flag update

Co-authored-by: c-f <you@example.com>
Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-07-13 17:00:11 +05:30
Sami 6c2fdd3387
Issue 2227 ntv flag run new templates added in specific version (#2275)
* ntv flag to run templates added in specified version

* added missing arguments

* misc update

* added functional test and err check

* updated the min version

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-07-13 16:49:06 +05:30
Sajad be73fde0db
use go-homedir instead of standard os.userhomedir (#2262)
* use go-homedir instead of standard os.userhomedir

* set r.templatesConfig before write attempt to avoid panic
2022-07-13 13:33:13 +05:30
Mzack9999 1c332bb85b
Improving RFC request/response passive parsing (#2192)
* Improving RFC request/response passive parsing

* adding test
2022-07-11 22:43:10 +05:30
Mzack9999 3c945f6ae9
Adding stricter check on offline templates list (#2213) 2022-07-11 22:38:07 +05:30
Ice3man 5b3c2861c2
Added interact-url placeholder support to variables in http requests (#2237)
* Added interact-url placeholder support to variables in http requests

* Fixed variable errors

* Fixed issue with interactsh in req
2022-07-11 22:18:13 +05:30
anykno 73a0043f2d
fix: socks5 proxy not working on https target (#2228)
* fix: socks5 proxy not working on https target

* small name refactor

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-07-01 15:31:00 +05:30
Mzack9999 476773ff8c
Replacing hasstdin with helper library (#2191)
* Replacing hasstdin with helper library

* adding timeout reader on stdin

* adding large input read timeout

* reducing stdin timeout + nostdin flag

* go mod update

* readme update

* go mod tidy

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-06-30 17:51:54 +05:30
Mzack9999 3838d06aeb
Adding prototype for unexpected fields validation in matchers (#2171)
* Adding unexpected fields validation

* using expected fields

* adding missing expected field

* using reflect
2022-06-30 16:50:54 +05:30
Ice3man f3de611b49
Added enhancements for http variables support (#2223) 2022-06-28 20:20:18 +05:30
Ice3man 8040b66370
Added http request timeout support with annotations (#2233)
* Added http request timeout support with annotations

* Added nolint statements for lostcontext

* misc

* misc
2022-06-27 18:36:46 +05:30
Ice3man ffe6ab04b3
Added include-templates force-loading for templates (#2232)
* Added include-templates force-loading for templates

* Fixed loader case with include-templates

* Added integration test for excluded-template in loader
2022-06-27 18:09:29 +05:30
Ice3man 7875b06fc8
Added exclude-matchers support for template & matchers (#2218)
* Added exclude-matchers support for template & matchers

* Fixed panics due to typo

* Added support for only template ID + misc cleanup
2022-06-24 23:09:27 +05:30
Ice3man 9073b753ca
Added aes_gcm implementation for DSL function (#2196)
* Added aes_gcm implementation for DSL function

* Added integration test for dsl-functions.yaml
2022-06-23 16:16:24 +05:30
sandeep 7f28c048a6 version update 2022-06-22 00:45:08 +05:30
Mzack9999 0b351e83f3
Add self diagnostic functionality (#2178)
* Adding Self-Diagnostic

* adding comment
2022-06-22 00:40:10 +05:30
dependabot[bot] 1047047790
chore(deps): bump github.com/go-rod/rod from 0.106.8 to 0.107.1 in /v2 (#2114)
* chore(deps): bump github.com/go-rod/rod from 0.106.8 to 0.107.1 in /v2

Bumps [github.com/go-rod/rod](https://github.com/go-rod/rod) from 0.106.8 to 0.107.1.
- [Release notes](https://github.com/go-rod/rod/releases)
- [Commits](https://github.com/go-rod/rod/compare/v0.106.8...v0.107.1)

---
updated-dependencies:
- dependency-name: github.com/go-rod/rod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* fixing function call

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-06-22 00:31:08 +05:30
Mzack9999 112762f024
Adding http request validation at compile time (#2193)
* Adding http request validation at compile time

* misc update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-06-22 00:26:06 +05:30
Ice3man 50d21c0464
Fixed a issue with random invalid matches in DSL (#2195) 2022-06-21 21:58:43 +05:30
M. Ángel Jimeno af4854f90d
output: fix WriteStoreDebugData file permissions (#2187)
Fixes #2180
2022-06-20 17:10:22 +05:30
Sajad 644c951449
use formedURL instead reqURL in http request dump message (#2174) 2022-06-16 17:24:21 +05:30
Sajad b715a601e8
Adding nil operator check on clustering (#2173)
* add nil operator check

* move nil pointer check
2022-06-16 14:41:05 +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
Sajad e7591ec8b3
use request numbering as per template definition in req-condition (#2135)
* use original request number instead of current iteration in request-condition

* add previousEvent tracking back for request condition

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-06-11 14:29:05 +05:30
tanimdiucse123 e575f53be7
Empty string test can be improved (#2115)
It is not recommended to use len for empty string test.

A string can be tested for its emptiness either by treating it as a slice and calculating the length of the slice, or by treating it as a string and directly comparing the value. While both produce identical code when compiled, it makes more sense to treat a string as itself, than a slice, for the sake of comparison of values.

Examples

Bad practice

len(s) == 0

Recommended

s == ""

The recommended practice is considered more idiomatic in Go.

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-06-11 14:11:43 +05:30
Sandeep Singh 5281d342c0
Merge pull request #2138 from mikerott/dev
protect against multiple unnecessary Init calls
2022-06-10 18:12:31 +05:30
Mike Rheinheimer 22a8d72c65 protect against multiple unnecessary Init calls 2022-06-09 17:18:49 -05:00
forgedhallpass 9fd9892f49 test: extra DSL function test cases 2022-06-08 20:58:46 +03:00
forgedhallpass 04e7e053de refactor: replace date, time, time_format, time_to_string DSL functions to date_time 2022-06-08 20:41:32 +03:00
forgedhallpass ef20e0711b refactor: replace date, time, time_format, time_to_string DSL functions to date_time 2022-06-08 20:33:55 +03:00
forgedhallpass a10d58c6d2 refactor: rename concat_ws DSL function to join 2022-06-08 16:31:33 +03:00
forgedhallpass 145bdaabe5 refactor: extract duplicated hashing logic 2022-06-08 16:11:15 +03:00
forgedhallpass 6d8908c352 refactor: replace hmac_sha1 and hmac_sha256 DSL functions with hmac 2022-06-08 16:00:14 +03:00
James Turner 9d37bd6c0c Add two new DSL helper functions
hmac_sha1 and concat_ws (with seperator) this are helpful in
signing API requests.
2022-06-07 18:26:22 +03:00
forgedhallpass f3514e9b92 Merge branch 'dev' into new_dsl_functions 2022-06-07 17:26:10 +03:00
Sajad 7170cc2828
dsl matcher separate ignorable(No parameter) errors from others (#2127) 2022-06-07 18:23:07 +05:30
Mzack9999 cc37382519
Adding Client TLS1.0 (#2091)
* Adding Client TLS1.0

* bumping fastdialer version
2022-06-04 17:45:16 +05:30
Sajad b79817e0a9
change dsl evaluate warning messages to error (#2096)
* change dsl evaluate warning messages to error

* add template-id to dsl match error logs
2022-06-03 13:41:36 +05:30
Sami fa369b728e
ssl protocol with ms flag crash (#2101)
* crash with ssl protocol when used with ms flag fix

* added missing template info in case of failure
2022-06-03 13:32:45 +05:30
sandeep 900addc43f version update 2022-06-03 03:02:11 +05:30
M4rtin Hsu aebd32b198
Add decimal to hexadecimal helper function (#2076)
* Add decimal to hexadecimal auxiliary functions

* Fixed unit test

* Modify the helper function name and check the unit test.

* dsl function update

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2022-06-03 02:17:35 +05:30
Ice3man 2b631e8e95
Add optional line number for file templates by default (#1966)
* Add optional line number for file templates by default

* updating docs

* misc flag update

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-06-02 17:06:50 +05:30
Mzack9999 4bcb94e4df
Increasing timeout and fixed error msg (#2092)
* Increasing timeout and fixed error msg

* increasing timeout
2022-06-02 00:00:18 +05:30
Sajad 9f600d2829
keep the original extactor var for multiple results while preparing data for matchers (#1948) 2022-05-31 02:46:51 +05:30
Ice3man be5f1a7623
Added redirected matched URL + stop-at-first-match for redirect chains (#2050)
* Added redirected matched URL + stop-at-first-match for redirect chains

* Pleasing go-linter
2022-05-30 15:19:09 +05:30
Ice3man 8723a1fd70
Added header as DSL part value (#2052)
* Added header as DSL part value

* Fixed failing DSL part test cases
2022-05-30 15:16:27 +05:30
Ice3man 34ed4e531a
Added hang monitor for goroutine dumping (#1949)
* Added hang monitor for goroutine dumping

* misc

* Made hang monitor optional with flag

* Added stack comparison for monitoring + misc

* Removed debug statements

* misc update

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-05-30 14:41:24 +05:30
Mzack9999 dd3b0a3cfc
Increasing buffer size on AND condition (#2030)
* Increasing buffer size on AND condition

* adding integration tests

* fixing tests data path
2022-05-30 13:45:28 +05:30
Ice3man f53f360c74
Fixed websocket status-101 response reading for http (#2081) 2022-05-27 22:36:42 +05:30
Mzack9999 16a05d0aa2
Adding CLI SNI support to unsafe http (#2077)
* Adding CLI SNI support to unsafe http

* adding http unsafe sni test
2022-05-27 21:53:07 +05:30
Mzack9999 02eaf91e6a
Adding variables support for headless templates (#2064) 2022-05-27 21:31:56 +05:30
Ice3man 3648c47e35
Fixed template validation edge cases (#2051) 2022-05-25 11:26:05 +05:30
forgedhallpass 096f34e4e3 refactor: DSL date/time functions 2022-05-24 13:38:26 +03:00
forgedhallpass 346db4cf15 refactor: timetostring DSL to time_to_string 2022-05-24 13:11:55 +03:00
forgedhallpass 45c27bc5f0 test: DSL test fixes (hmac_sha256, time_format) 2022-05-24 13:11:03 +03:00
Rahmat feae805834 Add hmac_sha256 dslExpression 2022-05-24 12:59:09 +03:00
Rahmat f2ca75c536 Add time_format dslExpression 2022-05-24 12:47:56 +03:00
Ice3man 80f3cec293
Disable printing variables in http protocol output (#2037) 2022-05-23 20:50:51 +05:30
Sajad 4f834f1f33
store vars in values instead of payloads to fix #1882 for self contained http templates (#1924)
Co-authored-by: sandeep <sandeep@projectdiscovery.io>
2022-05-23 15:12:58 +05:30
sandeep 91c35df911 version + readme update 2022-05-17 16:36:33 +05:30
Mzack9999 d5e4516829
Iterating payloads over HTTP path/raw sequence (#1981)
* Iterating payloads over path/raw sequence

* fixing logic check
2022-05-17 15:22:00 +05:30
Ice3man 062fe6d01e
Added urldns gadget from ysoserial (#1985) 2022-05-17 14:33:17 +05:30
Owen Rumney 4a5039cc75
chore(deps): Bump sarif to v2 (#1930)
Signed-off-by: Owen Rumney <owen@owenrumney.co.uk>

Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
2022-05-13 03:48:14 +05:30
Mzack9999 39c7317ec3
Adding SNI override via request annotations (#1970)
* Adding SNI override via request annotations

* adding cli flag priority
2022-05-12 16:43:56 +05:30
Sami 6ca4374f91
sonar category: String literals should not be duplicated (#1944)
* sonar category: String literals should not be duplicated

* lint error fix

* better naming conventions for constants

* improved naming conventions and methods
2022-05-12 15:40:14 +05:30
Mzack9999 2f1330345f
Adding global SNI support for HTTP protocol via CLI (#1964)
* Adding global SNI support via CLI

* adding integration test

* adding cli option to docs

* reverting deleted test
2022-05-11 16:00:39 +05:30
Ice3man a2947192e2
Added mutex to output writing (#1969) 2022-05-10 18:47:22 +05:30
Ice3man d5578200f0
Fixed query parameter addition to http raw requests (#1975) 2022-05-10 17:33:27 +05:30
Ice3man 25d6cbd95b
Use nuclei-templates instead of custom autoscan directory list (#1968)
* Use nuclei-templates instead of custom autoscan directory list

* Use templates directory from config file
2022-05-10 17:26:46 +05:30
Ice3man d7d80e3447 Added normalized wappalyzer versioned appName 2022-05-09 11:02:21 +05:30
sandeep 474d66c09d go mod + version update 2022-05-08 15:29:33 +05:30
Mzack9999 a534b9f06c
Fixing directory walk error check on windows (#1951)
* Fixing directory walk error check on windows

* moving check to helper package

* replacing godirwalk with standard library
2022-05-08 12:22:21 +05:30
mzack 3c5aea85e7 Merge branch 'dev' into issue-1849-iserver-registration 2022-05-06 13:13:50 +02:00
mzack 6a52f4f709 updating go mods + logic 2022-05-06 12:59:16 +02:00
Sandeep Singh 2e8a5fa0c7
Merge pull request #1934 from projectdiscovery/pipeline-fix
replace rawhttp dev with fix branch, don't drain resp body if pipeline is on
2022-05-05 18:14:51 +05:30
Sajad Parra df6c4eea34 fix #1929 2022-05-04 22:09:47 +05:30
Sajad Parra 14f11d24c2 replace rawhttp dev with fix branch, don't drain resp body if pipeline is on 2022-05-04 19:52:35 +05:30
Sandeep Singh b4c6efd083
Merge pull request #1903 from projectdiscovery/issue-1834-alpine
Automatic fallback to system chrome on alpine via musl detection
2022-04-29 23:34:16 +05:30
mzack d197b8df7b adding musl detection 2022-04-28 01:50:22 +02:00
LuitelSamikshya 3ccbfe4626 disable redirects flag 2022-04-27 11:19:44 -05:00
GitHub Action 737132bc88 Auto Generate Syntax Docs + JSONSchema [Mon Apr 25 08:40:12 UTC 2022] 🤖 2022-04-25 08:40:12 +00:00
Ice3man 51d8f80713 Fixed bug with docgen 2022-04-25 14:08:23 +05:30
LuitelSamikshya b0508ab194 alternative server if a server failed 2022-04-22 16:31:42 -05:00