suport muilt script headless? #4490
-
Is it impossible to extract the information of the input object? But only url information can be obtained. Does it only support one script?
Also I found |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@tarunKoyalwar can you take a look at this one? |
Beta Was this translation helpful? Give feedback.
-
@hktalent , not able to reproduce this and script seems to be working as expected . you can always use
Example Templateid: headless-extract-values
info:
name: Headless Extract Value
author: pdteam
severity: info
tags: headless
headless:
- steps:
- action: navigate
args:
url: "{{BaseURL}}"
- action: waitload
# From headless/extract-urls.yaml
- action: script
name: extract
args:
code: |
() => '\n' + [...new Set(Array.from(document.querySelectorAll('[src], [href], [url], [action]')).map(i => i.src || i.href || i.url || i.action))].join('\r\n') + '\n'
- action: script
name: allInput
args:
code: |
() => {
return '\n' + [...new Set(Array.from(document.querySelectorAll('input,textarea,select')).map(i => (i.name || i.id) + "=" + i.value))].join('\r\n') + '\n'
}
matchers:
- type: status
status:
- 200
extractors:
- type: dsl
dsl:
- '"urls :" + extract'
- '"form kv :" + allInput' $ ./nuclei -t a.yaml -headless -u https://www.instagram.com/accounts/login/ -v -svd
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.5
projectdiscovery.io
[VER] Started metrics server at localhost:9092
[INF] Current nuclei version: v3.1.5 (latest)
[INF] Current nuclei-templates version: v9.7.2 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 61
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 1
[DBG] Headless Protocol request variables:
[DBG] Headless Protocol request variables:
1. BaseURL => https://www.instagram.com/accounts/login/
2. DN => instagram
3. FQDN => www.instagram.com
4. File => login
5. Host => www.instagram.com
6. Hostname => www.instagram.com
7. Input => https://www.instagram.com/accounts/login/
8. Path => /accounts/login
9. Port => 443
10. RDN => instagram.com
11. RootURL => https://www.instagram.com
12. SD => www
13. Scheme => https
14. TLD => com
15. ip =>
[VER] Sent Headless request to https://www.instagram.com/accounts/login/
[DBG] Headless Protocol response variables:
1. allInput => username= password= =en
2. data => <html class="_9dls js-foc .... /div></div></body></html>
3. extract => https://static.cdninstag .... isplay:block!important;}
4. header => Content-Encoding: br Acce .... Svc: h3=":443"; ma=86400
5. history => GET https://www.instagram .... ")};g["default"]=a}),98);
6. host => https://www.instagram.com/accounts/login/
7. matched => https://www.instagram.com/accounts/login/
8. req =>
9. status_code => 200
10. template-id => headless-extract-values
11. template-info => {Headless Extract Value p .... nil> {info} map[] <nil> }
12. template-path => /Users/tarun/Codebase/nuclei/a.yaml
13. type => headless
[headless-extract-values] [headless] [info] https://www.instagram.com/accounts/login/ [urls :
https://static.cdninstagram.com/rsrc.php/v3/yI/r/VsNE-OHk_8a.png
https://static.cdninstagram.com/rsrc.php/v3/yR/r/lam-fZmwmvn.png
https://static.cdninstagram.com/rsrc.php/v3/ys/r/aM-g435MtEX.png
... redacted ...
,form kv :
username=
password=
=en
] |
Beta Was this translation helpful? Give feedback.
-
thanks @tarunKoyalwar |
Beta Was this translation helpful? Give feedback.
@hktalent , not able to reproduce this and script seems to be working as expected . you can always use
-svd
to verify what variables are availableExample Template