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

fix stop-at-first-match issue in http protocol #4752

Merged
merged 8 commits into from
Feb 12, 2024
Merged

Conversation

tarunKoyalwar
Copy link
Member

@tarunKoyalwar tarunKoyalwar commented Feb 12, 2024

Proposed Changes

id: flow-spm-bug

info:
  name: Test HTTP Template
  author: pdteam
  severity: info


http:
  - method: GET
    path:
      - "{{BaseURL}}/{{paths}}"

    payloads:
      paths:
        - gg
        - gg
        - gg

    stop-at-first-match: true
    matchers:
      - type: status
        status:
          - 404

Earlier

$  echo https://example.com  | nuclei -t a.yaml

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.1.10

		projectdiscovery.io

[INF] Current nuclei version: v3.1.10 (latest)
[INF] Current nuclei-templates version: v9.7.5 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 106
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[flow-spm-bug] [http] [info] https://example.com/gg [paths="gg"]
[flow-spm-bug] [http] [info] https://example.com/gg [paths="gg"]
[flow-spm-bug] [http] [info] https://example.com/gg [paths="gg"]

Now

$  echo https://example.com  | ./nuclei -t a.yaml

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.0-dev

		projectdiscovery.io

[INF] Current nuclei version: v3.2.0-dev (development)
[INF] Current nuclei-templates version: v9.7.5 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 106
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[flow-spm-bug] [http] [info] https://example.com/gg [paths="gg"]

@tarunKoyalwar tarunKoyalwar self-assigned this Feb 12, 2024
@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review February 12, 2024 13:08
@tarunKoyalwar tarunKoyalwar linked an issue Feb 12, 2024 that may be closed by this pull request
@tarunKoyalwar tarunKoyalwar marked this pull request as draft February 12, 2024 14:05
@tarunKoyalwar
Copy link
Member Author

Added Support for stop-at-first-match in race ( + pipeline requests)

id: race-condition-testing

info:
  name: Race Condition testing
  author: pdteam
  severity: info

requests:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

        test      

    race: true
    race_count: 10
    stop-at-first-match: true

    matchers:
      - type: status
        part: header
        status:
          - 200

Earlier

$  nuclei -u https://scanme.sh -t x.yaml 

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.1.10

		projectdiscovery.io

[WRN] Found 1 templates loaded with deprecated protocol syntax, update before v3 for continued support.
[INF] Current nuclei version: v3.1.10 (latest)
[INF] Current nuclei-templates version: v9.7.5 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 106
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/
[race-condition-testing] [http] [info] https://scanme.sh/

Now

$  ./nuclei -u https://scanme.sh -t x.yaml

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.2.0-dev

		projectdiscovery.io

[WRN] Found 1 templates loaded with deprecated protocol syntax, update before v3 for continued support.
[INF] Current nuclei version: v3.2.0-dev (development)
[INF] Current nuclei-templates version: v9.7.5 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 106
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[race-condition-testing] [http] [info] https://scanme.sh/

@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review February 12, 2024 16:38
@ehsandeep ehsandeep merged commit 2cbc21e into dev Feb 12, 2024
12 checks passed
@ehsandeep ehsandeep deleted the issue-4744-spm-flow branch February 12, 2024 19:50
@ehsandeep ehsandeep mentioned this pull request Feb 20, 2024
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.

stop-at-first-match + payloads doesn't work with flow Nuclei does not stop at first match
2 participants