Merge pull request #1717 from dwisiswant0/headless/extract-urls

Add URL extractor from HTML attributes
patch-1
Sandeep Singh 2021-06-18 12:21:46 +05:30 committed by GitHub
commit 9b27ac6717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
id: extract-urls
info:
name: Extract URLs from HTML attributes
author: dwisiswant0
severity: info
tags: headless,extractor
headless:
- steps:
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- 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'
extractors:
- type: kval
part: extract
kval:
- extract