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

pre-condition does not create matcher-status event #5449

Closed
tarunKoyalwar opened this issue Jul 26, 2024 · 1 comment · Fixed by #5450
Closed

pre-condition does not create matcher-status event #5449

tarunKoyalwar opened this issue Jul 26, 2024 · 1 comment · Fixed by #5450
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@tarunKoyalwar
Copy link
Member

Nuclei version:

main | latest

Current Behavior:

when using pre-condition if its value is false then the matcher-status event is not generated for javascript protocol

Expected Behavior:

a matcher-status event regardless when it exits

Steps To Reproduce:

id: ssh-server-enumeration

info:
  name: Detect SSH on port 22.
  author: Justin Bacco
  severity: info
  metadata:
    max-request: 2
    shodan-query: port:22
  tags: enum,js,ssh,network

javascript:
  - pre-condition: |
      isPortOpen(Host,Port)
    code: |
      var m = require("nuclei/ssh");
      var c = m.SSHClient();
      var response = c.ConnectSSHInfoMode(Host, Port);
      Export(response);

    args:
      Host: "{{Host}}"
      Port: 22

    matchers:
      - type: dsl
        dsl:
          - "success == true"
$ nuclei -u scanme.sh:1234 -t a.yaml -ms -v

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

		projectdiscovery.io

[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.3.0 (latest)
[INF] Current nuclei-templates version: v9.9.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 67
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[WRN] [ssh-server-enumeration] Could not execute request for scanme.sh:1234: [ssh-server-enumeration:RUNTIME] could not execute pre-condition: dial tcp [2400:6180:0:d0::91:1001]:1234: connect: connection refused
[INF] No results found. Better luck next time!

Anything else:

@tarunKoyalwar tarunKoyalwar added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 26, 2024
@tarunKoyalwar
Copy link
Member Author

dast pre-condition seems to work and this issue only seems to affect javascript protocol

 $ nuclei -u https://scanme.sh/\?q\=123 -t b.yaml -ms -dast          

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

		projectdiscovery.io

[INF] Current nuclei version: v3.3.0 (latest)
[INF] Current nuclei-templates version: v9.9.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 67
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[fuzz-query-num] [failed] [http] [info] scanme.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants