Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Issue 3350 matcher condition or not work #3397

Merged
merged 10 commits into from
Mar 15, 2023

Conversation

RamanaReddy0M
Copy link
Contributor

@RamanaReddy0M RamanaReddy0M commented Mar 7, 2023

Proposed changes

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@ehsandeep ehsandeep linked an issue Mar 7, 2023 that may be closed by this pull request
@tarunKoyalwar
Copy link
Member

Before

$ nuclei -u scanme.sh -t http/default-matcher-condition.yaml                              1 ↵

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9

		projectdiscovery.io

[INF] Using Nuclei Engine 2.8.9 (latest)
[INF] Using Nuclei Templates 9.3.8 (latest)
[INF] Templates added in last update: 656
[INF] Templates loaded for scan: 1
[INF] Targets loaded for scan: 1
[INF] Running httpx on input host
[INF] Found 1 URL from httpx
[INF] Using Interactsh Server: oast.fun
[INF] No results found. Better luck next time!

Integration Test result covering both cases

$ ./integration-test -protocol http -template matcher-condition                        130 ↵
./nuclei -t http/default-matcher-condition.yaml -target http://127.0.0.1:56674/interactsh -duc -debug

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9

		projectdiscovery.io

[INF] Using Nuclei Engine 2.8.9 (latest)
[INF] Using Nuclei Templates 9.3.8 (latest)
[INF] Templates added in last update: 656
[INF] Templates loaded for scan: 1
[INF] Targets loaded for scan: 1
[INF] Using Interactsh Server: oast.fun


...redacted...

[default-matcher-condition:word-1] [http] [info] http://127.0.0.1:56674/interactsh/?action=curltest&url=cg4ef9a401gd2u5i0uv058cbbaqbq6nkr.oast.fun

./nuclei -t http/default-matcher-condition.yaml -target http://127.0.0.1:56674/status -duc -debug

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9

		projectdiscovery.io

[INF] Using Nuclei Engine 2.8.9 (latest)
[INF] Using Nuclei Templates 9.3.8 (latest)
[INF] Templates added in last update: 656
[INF] Templates loaded for scan: 1
[INF] Targets loaded for scan: 1
[INF] Using Interactsh Server: oast.pro

...redacted....

[default-matcher-condition:status-2] [http] [info] http://127.0.0.1:56674/status/?action=curltest&url=cg4efaq401gd2uti0uv069oj3dw5efeqo.oast.pro

@tarunKoyalwar tarunKoyalwar removed their request for review March 8, 2023 19:59
@tarunKoyalwar
Copy link
Member

tarunKoyalwar commented Mar 8, 2023

TODO

  • fix Lint error
  • validate data race detected in integration test and create a follow up issue with details

@RamanaReddy0M

// Server endpoint where only interactsh matcher is successful and status code is not 200
router.GET("/interactsh/", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
value := r.URL.Query().Get("url")
if value != "" {

Check failure

Code scanning / CodeQL

Uncontrolled data used in network request

The [URL](1) of this request depends on a [user-provided value](2).
@ehsandeep
Copy link
Member

Follow up ticket for build fail - #3423

@tarunKoyalwar
Copy link
Member

@ehsandeep ,

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@ehsandeep ehsandeep merged commit c9634fa into dev Mar 15, 2023
@ehsandeep ehsandeep deleted the issue-3350-matcher-condition-or-not-work branch March 15, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: default matcher-condition 'or' cannot work
3 participants