docs: 完善文档
This commit is contained in:
@@ -17,51 +17,6 @@ pip install -r requirements.txt
|
||||
- 克隆或下载后门检测系统到您的本地环境。
|
||||
- 确保脚本文件 (`requirements_detection.py` 和 `backdoor_detection.py`) 在您的工作目录中。
|
||||
|
||||
## 运行依赖版本漏洞检测脚本
|
||||
|
||||
**命令格式**:
|
||||
|
||||
```bash
|
||||
python requirements_detection.py <requirements_file> -o <output_file>
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
|
||||
- `<requirements_file>`: 项目的 `requirements.txt` 文件路径。
|
||||
- `<output_file>`: 指定输出结果的文件路径和格式,支持的格式有 `.txt`, `.md`, `.html`, `.pdf`。
|
||||
|
||||
**示例**:
|
||||
|
||||
```bash
|
||||
python requirements_detection.py requirements.txt -o output/report.md
|
||||
```
|
||||
|
||||
## 运行静态代码后门检测脚本
|
||||
|
||||
**命令格式**:
|
||||
|
||||
```bash
|
||||
python backdoor_detection.py <code_path> -o <output_file> -m <mode>
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
|
||||
- `<code_path>`: 代码文件或目录的路径。
|
||||
- `<output_file>`: 指定输出结果的文件路径和格式,支持的格式有 `.txt`, `.md`, `.html`, `.pdf`。
|
||||
- `<mode>`: 指定检测模式,目前支持的模式有 `regex` 和 `llm`。
|
||||
|
||||
**示例**:
|
||||
|
||||
```bash
|
||||
python backdoor_detection.py ./src -o output/report.pdf -m regex
|
||||
```
|
||||
|
||||
## 结果解读
|
||||
|
||||
- 输出结果将根据指定的格式保存在您指定的文件中。
|
||||
- 结果中会标注出每个文件中发现的高风险和中风险函数调用位置。
|
||||
- 对于依赖检测,结果将标明每个依赖包的安全状态,包括存在安全风险的依赖及其版本。
|
||||
|
||||
## 打包
|
||||
|
||||
### pip
|
||||
@@ -113,6 +68,51 @@ twine upload dist/*
|
||||
pip install backdoor_buster
|
||||
```
|
||||
|
||||
## 运行依赖版本漏洞检测脚本
|
||||
|
||||
**命令格式**:
|
||||
|
||||
```bash
|
||||
python -m detection.requirements_detection <requirements_file> -o <output_file>
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
|
||||
- `<requirements_file>`: 项目的 `requirements.txt` 文件路径。
|
||||
- `<output_file>`: 指定输出结果的文件路径和格式,支持的格式有 `.txt`, `.md`, `.html`, `.pdf`。
|
||||
|
||||
**示例**:
|
||||
|
||||
```bash
|
||||
python -m detection.requirements_detection requirements.txt -o output/report.md
|
||||
```
|
||||
|
||||
## 运行静态代码后门检测脚本
|
||||
|
||||
**命令格式**:
|
||||
|
||||
```bash
|
||||
python -m detection <code_path> -o <output_file> -m <mode>
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
|
||||
- `<code_path>`: 代码文件或目录的路径。
|
||||
- `<output_file>`: 指定输出结果的文件路径和格式,支持的格式有 `.txt`, `.md`, `.html`, `.pdf`。
|
||||
- `<mode>`: 指定检测模式,目前支持的模式有 `regex` 和 `llm`。
|
||||
|
||||
**示例**:
|
||||
|
||||
```bash
|
||||
python -m detection ./src -o output/report.pdf -m regex
|
||||
```
|
||||
|
||||
## 结果解读
|
||||
|
||||
- 输出结果将根据指定的格式保存在您指定的文件中。
|
||||
- 结果中会标注出每个文件中发现的高风险和中风险函数调用位置。
|
||||
- 对于依赖检测,结果将标明每个依赖包的安全状态,包括存在安全风险的依赖及其版本。
|
||||
|
||||
## 常见问题处理
|
||||
|
||||
- 确保所有路径都正确无误,避免因路径错误导致文件读取失败。
|
||||
|
||||
Reference in New Issue
Block a user