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

Negative matcher issue with file protocol #5771

Open
1 task done
dmaciejak opened this issue Oct 25, 2024 · 0 comments
Open
1 task done

Negative matcher issue with file protocol #5771

dmaciejak opened this issue Oct 25, 2024 · 0 comments
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@dmaciejak
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues.

Current Behavior

I have some issue while testing a negative match with file protocol,
not sure if it's a bug or if it's me not understanding the feature.
I am trying to detect if a string is not present in a file.

Expected Behavior

If the string is in the file but negative matcher is set to true, the template should not match.

Steps To Reproduce

I am using the run command: nuclei -t check-username.yaml --target users.txt

$ cat users.txt 
root
john
admin

with those test cases:

Test case 1:

id: check-username

info:
  name: check username
  author: dma
  severity: info

file:
  - extensions:
      - txt
    matchers:
      - type: word
        words:
          - "john"
        negative: false

Output:
[check-username] [file] [info] users.txt
Test:
Is john in the user list ?
Expected result:
Correct, john is in the user list.

Test case 2:

id: check-username

info:
  name: check username
  author: dma
  severity: info

file:
  - extensions:
      - txt
    matchers:
      - type: word
        words:
          - "john"
        negative: true

Output:
[check-username] [file] [info] users.txt
Test:
Is john not in the user list ?
Expected result:
Wrong, the template should not match if john is in the user list.

Please note, if I am checking for another user not in the list, negative matching is working as expected.

Relevant log output

No response

Environment

  • OS:
  • Nuclei: v3.3.5
  • Go:

Anything else?

No response

@dmaciejak dmaciejak added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Oct 25, 2024
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

No branches or pull requests

1 participant