https://github.com/Anthem-whisper/YApi-Exploit
YApi boolean-based injection exploit.
https://github.com/Anthem-whisper/YApi-Exploit
yapi
Last synced: 22 days ago
JSON representation
YApi boolean-based injection exploit.
- Host: GitHub
- URL: https://github.com/Anthem-whisper/YApi-Exploit
- Owner: Anthem-whisper
- Created: 2022-11-28T13:37:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-08T15:57:44.000Z (about 3 years ago)
- Last Synced: 2025-06-21T16:44:24.248Z (9 months ago)
- Topics: yapi
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 58
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YApi-Exploit
YApi boolean-based injection [exploit](https://github.com/Anthem-whisper/YApi-Exploit).
## 声明
本工具仅用于合法的测试,请明确您对于目标是否得到了授权
请勿用于任何非法用途,否则后果自负
## 用法
```
❯ python exp.py -h
__ _____ _ ______ __ _ __
\ \/ / | ____ (_) / ____/ ______ / /___ (_) /_
\ / /| | / __ \/ / / __/ | |/_/ __ \/ / __ \/ / __/
/ / ___ |/ /_/ / / / /____> /_/ / / /_/ / / /_
/_/_/ |_/ .___/_/ /_____/_/|_/ .___/_/\____/_/\__/
/_/ /_/
usage: python3 exp.py [-h] [-shell] [-target TARGET] [-proxy PROXY] [-action ACTION] [-salt SALT] [-sleep SLEEP]
[-timeout TIMEOUT] [-token TOKEN] [-uid UID] [-id ID] [-entoken ENTOKEN] [-cmd CMD]
optional arguments:
-h, --help show this help message and exit
-shell 交互式操作, 如果使用这个参数则无需输入其他任何参数
-target TARGET 目标站点, 比如: http://127.0.0.1:3000/
-proxy PROXY HTTP代理, 比如: http://127.0.0.1:8080/, 默认为空
-action ACTION 要执行操作, 有如下几个操作:
encrypt_token 从token和uid加密得到encrypted token
decrypt_token 解密encrypted token, 得到uid和token
check_token_validity 检测当前token是否可用
get_alive_api_list 获取所有支持GET和POST方法的API
get_token_by_inject 通过布尔盲注获得一个(加密之前的)token
get_id_uid_by_token 通过一个(加密之前的)token获得项目id和作者uid
execute_command 通过pre_script执行命令, 需要项目id和一个(加密过后的)token
-salt SALT YApi用于加密uid和token的盐, 默认为'abcde'
-sleep SLEEP 每个请求的间隔的秒数, 默认为0.2
-timeout TIMEOUT 请求超时时间, 默认为3
-token TOKEN 加密之前的token, 如果你有的话
-uid UID 项目作者的uid, 如果你有的话
-id ID 项目id, 如果你有的话
-entoken ENTOKEN 加密之后的token, 如果你有的话
-cmd CMD 要执行的命令, 无回显
```

## 注意事项
- 利用条件
- YApi version < [v1.11.0](https://github.com/YMFE/yapi/pull/2628)
- 需要项目存在测试集合`X`, 且`X`中的接口数量大于0
- 暂不考虑自动添加测试合集并加入接口的功能
- `pre_script`
- 这个参数会在所有接口测试的时候执行, 也就是说:当测试合集`X`中的接口数量为`n`, 你的命令会被执行`n`次, 请注意不要把业务打崩