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

Authenticated scan does not work with input files (-list, -input-mode) #5506

Closed
nth347 opened this issue Aug 10, 2024 · 7 comments · Fixed by #5646
Closed

Authenticated scan does not work with input files (-list, -input-mode) #5506

nth347 opened this issue Aug 10, 2024 · 7 comments · Fixed by #5646
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@nth347
Copy link

nth347 commented Aug 10, 2024

It's pefectly fine to run this as an authenticated scan:

nuclei -debug -prefetch-secrets -secret-file my-secret-file.yaml -proxy http://burp-proxy:8080 -target https://target.com

But when I specifying target as a Burp file, it does not work:

nth347@ubuntu:~$ nuclei -debug -prefetch-secrets -secret-file my-secret-file.yaml -proxy http://burp-proxy:8080 -list burp.xml -input-mode burp

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

		projectdiscovery.io

[WRN] Setting thread count to 0 for 45 templates, dynamic extractors are not supported with payloads yet
[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: 24
[INF] Executing 24 signed templates from projectdiscovery/nuclei-templates
[INF] Targets loaded for current scan: 1
[INF] Pre-fetching secrets from authprovider[s]
[FTL] Could not run nuclei: could not pre-fetch secrets: no templates found for path: ***path to***/my-login.yaml

I tried with proxify logs and got the same error, no request was sent to Burp proxy.

@nth347 nth347 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Aug 10, 2024
@nth347
Copy link
Author

nth347 commented Sep 16, 2024

hi @ehsandeep , have a look to this issue please

@nth347
Copy link
Author

nth347 commented Sep 16, 2024

The issue seems to be duplicated with #5493

@RamanaReddy0M
Copy link
Contributor

@nth347 Applied fix here:

Can you try this pr?

@RamanaReddy0M RamanaReddy0M linked a pull request Sep 19, 2024 that will close this issue
4 tasks
@ehsandeep ehsandeep added this to the nuclei v3.3.3 milestone Sep 19, 2024
@nth347
Copy link
Author

nth347 commented Sep 21, 2024

hi @RamanaReddy0M ,

It works! Thanks so much for the fix!

@nth347
Copy link
Author

nth347 commented Sep 24, 2024

hi everyone,

I find out that after merging the fix to the dev branch, it does not work.

I mean:

# cd nuclei/
git checkout issue-5493-fix-dynamic-auth-with-fuzzing
go build cmd/nuclei/main.go && mv main nuclei

The resulting nuclei binary works with dynamic auth templates on fuzzing as expected.

# cd nuclei/
git checkout dev
go build cmd/nuclei/main.go && mv main nuclei

The resulting nuclei binary work does not work as expected. Here is the error:

./nuclei -list request-get.xml -input-mode burp -prefetch-secrets -secret-file secret-file.yaml -proxy http://192.168.52.110:8080

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

		projectdiscovery.io

[WRN] Found 1 templates with runtime error (use -validate flag for further examination)
[INF] Current nuclei version: v3.3.2 (latest)
[INF] Current nuclei-templates version: v10.0.0 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 255
[INF] Templates loaded for current scan: 25
[INF] Executing 25 signed templates from projectdiscovery/nuclei-templates
[INF] Targets loaded for current scan: 1
[INF] Pre-fetching secrets from authprovider[s]
[FTL] Could not run nuclei: could not pre-fetch secrets: no templates found for path: login.yaml

can you look into this, @RamanaReddy0M ?

@RamanaReddy0M
Copy link
Contributor

RamanaReddy0M commented Sep 24, 2024

➜  nuclei git:(dev) ✗ cat secrets.yaml
dynamic:
  - template: login.yaml
    variables:
      - key: username 
        value: name1 
      - key: password
        value: pass1
    type: bearertoken
    domains:
      - 127.0.0.1:5002
    input: http://127.0.0.1:5002 
    token: "{{auth_token}}"
➜  nuclei git:(dev) ✗ go run . -im openapi -list openapi-5493.json -p http://127.0.0.1:8080 -ps -sf secrets.yaml -t sqli.yaml -v

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

                projectdiscovery.io

[VER] Using http://127.0.0.1:8080 as proxy server
[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.3.2 (latest)
[INF] Current nuclei-templates version: v10.0.0 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 14
[INF] Templates loaded for current scan: 1
[WRN] Loading 1 unsigned templates for scan. Use with caution.
[INF] Targets loaded for current scan: 1
[INF] Pre-fetching secrets from authprovider[s]
[VER] [login] Sent HTTP request to http://127.0.0.1:5002/users/v1/login
[VER] [sqli-test] Sent HTTP request to http://127.0.0.1:5002/api/v1/test
[VER] [sqli-test] Sent HTTP request to http://127.0.0.1:5002/api/test
[sqli-test:sql_error] [http] [critical] http://127.0.0.1:5002/api/test [path:/api] [GET]

It works for me!

@nth347
Copy link
Author

nth347 commented Sep 24, 2024

I pulled the repo again and it works for me now, thanks @RamanaReddy0M

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.

3 participants