Authenticated scan via secret file not working #5262
-
Nuclei version:v3.2.8 I am trying to do authenticated scanning against the DVWA of OWASP for educational purposes. But i am always getting the following error: Steps To Reproduce:
The dvwa-secrets.yaml looks like this:
And the dvwa-login.yaml like this:
I am probably just doing something wrong but even if i reduce both .yaml files to a minimum i always get this message either as a error or as a warning with a different followup error message like this: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Here is a reduced example where i just added a plain get request and a extractor for the cookie
I get the following error: |
Beta Was this translation helpful? Give feedback.
-
@Lebotek , you were almost correct but here are some things you missed in template dynamic:
- template: login.yaml
variables:
- key: username # <- its `key` and not `name`
value: admin
- key: password # <- its `key` and not `name`
value: password
type: cookie
domains:
- localhost:4280
input: http://localhost:80 # <- specify input where auth templates should be run ( specify here or make template a self-contained one)
cookies:
- raw: "{{session-cookie}}" id: test-login
info:
name: DVWA Login
author: lebotek
severity: info
description: |
Login template for testing.
tags: test,login
requests:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
extractors:
- type: regex
name: session-cookie # <- this name should match variable name in secret file (earlier it was cookie and not session-cookie)
part: header
internal: true # <- this is optional and not a requirement
regex:
- 'Set-Cookie.+?\sPHPSESSID=.+?;' nuclei -id tech-detect -sf secrets.yaml -v -ps -u http://localhost:80
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.2.8
projectdiscovery.io
[VER] Started metrics server at localhost:9092
[WRN] Excluded 115 template[s] with known weak matchers / tags excluded from default run using .nuclei-ignore
[INF] Current nuclei version: v3.2.8 (latest)
[INF] Current nuclei-templates version: v9.8.7 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 62
[INF] Templates loaded for current scan: 1
[INF] Executing 1 signed templates from projectdiscovery/nuclei-templates
[INF] Targets loaded for current scan: 1
[INF] Pre-fetching secrets from authprovider[s]
[VER] [test-login] Sent HTTP request to http://localhost:80
[VER] [tech-detect] Sent HTTP request to http://localhost:80
[tech-detect:php] [http] [info] http://localhost:80 setupdocker run --rm -it -p 80:80 vulnerables/web-dvwa looks like we need to improve docs or new blog post with example about ^ (auth) |
Beta Was this translation helpful? Give feedback.
-
I am having the same issue that Labotek mentioned. @tarunKoyalwar was does the Your domain is something like app.example.com, but you need to authenticate against app.auth0.com so you want to specify the input to app.auth0.com? |
Beta Was this translation helpful? Give feedback.
@Lebotek , you were almost correct but here are some things you missed in template