这是一篇关于PortSwigger 中"用户名枚举与密码暴力破解" 的详细教程。
实验简介
在Web安全测试中,登录接口往往是最容易暴露漏洞的地方。今天我们将通过PortSwigger的"Username enumeration via different responses"实验,学习如何利用服务器返回的不同错误信息,先枚举出有效的用户名,再暴力破解对应的密码。
实验准备
-
已安装Burp Suite(社区版即可)
-
浏览器已配置Burp代理(默认127.0.0.1:8080)

-
开启Burp的拦截功能或仅使用HTTP历史记录
提供的字典有(复制时注意换行):
1)uesrname列表:
carlos
root
admin
test
guest
info
adm
mysql
user
administrator
oracle
ftp
pi
puppet
ansible
ec2-user
vagrant
azureuser
academico
acceso
access
accounting
accounts
acid
activestat
ad
adam
adkit
admin
administracion
administrador
administrator
administrators
admins
ads
adserver
adsl
ae
af
affiliate
affiliates
afiliados
ag
agenda
agent
ai
aix
ajax
ak
akamai
al
alabama
alaska
albuquerque
alerts
alpha
alterwind
am
amarillo
americas
an
anaheim
analyzer
announce
announcements
antivirus
ao
ap
apache
apollo
app
app01
app1
apple
application
applications
apps
appserver
aq
ar
archie
arcsight
argentina
arizona
arkansas
arlington
as
as400
asia
asterix
at
athena
atlanta
atlas
att
au
auction
austin
auth
auto
autodiscover
2)password列表
123456
password
12345678
qwerty
123456789
12345
1234
111111
1234567
dragon
123123
baseball
abc123
football
monkey
letmein
shadow
master
666666
qwertyuiop
123321
mustang
1234567890
michael
654321
superman
1qaz2wsx
7777777
121212
000000
qazwsx
123qwe
killer
trustno1
jordan
jennifer
zxcvbnm
asdfgh
hunter
buster
soccer
harley
batman
andrew
tigger
sunshine
iloveyou
2000
charlie
robert
thomas
hockey
ranger
daniel
starwars
klaster
112233
george
computer
michelle
jessica
pepper
1111
zxcvbn
555555
11111111
131313
freedom
777777
pass
maggie
159753
aaaaaa
ginger
princess
joshua
cheese
amanda
summer
love
ashley
nicole
chelsea
biteme
matthew
access
yankees
987654321
dallas
austin
thunder
taylor
matrix
mobilemail
mom
monitor
monitoring
montana
moon
moscow
Burp Intruder 实战步骤
1. 抓取登录请求
在浏览器输入任意账号密码如username=test&password=test:
使用 Burp Proxy 拦截请求:

2. 发送到 Intruder
右键请求:
Send to Intruder
3. 用户名枚举攻击(第一轮)
1️⃣ 设置 payload 位置
选中自定义的username,点击 Add §
此时显示:username=§test§&password=123
👉 只在 username 处添加 §
2️⃣ Attack type
选择:
Sniper
3️⃣ 加载用户名字典
使用实验提供的:Candidate usernames

4️⃣ 开始攻击
点击:Start attack
5️⃣ 找到正确username
点击排序: Length,
注意,其中一条记录比其他记录长。将此有效载荷的响应与其他响应进行比较。注意,其他响应包含消息Invalid username,但此响应包含消息Incorrect password。记下**"有效载荷"**列中的用户名。

排序后最长的那条Payload 即我们要要找的正确的username,它的response中会显示唯一的 Incorrect password

🎯 结果判断:
| 响应内容 | 含义 |
|---|---|
| Invalid username | 用户不存在 |
| Incorrect password | 用户存在 ✔ |
得到了有效的用户名:anaheim
4. 密码爆破攻击(第二轮)
1️⃣ 重置 Intruder
点击:Clear §

2️⃣ 设置 payload 位置
首先clear Payload
粘贴密码字典点击paste
同时注意修改username=anaheim
password=§test§

👉 此时爆破 password
3️⃣ 开始攻击
Start attack
5️⃣ 判断成功结果
观察:Status 列:

🎯 最终结果:
username = anaheim
password = 666666

字典是爆破与枚举攻击的核心基础,直接决定攻击效率与成功率,例如常用的 SecLists 用户名字典、rockyou.txt 密码字典 以及默认账号如 admin/root 的弱口令集合。