119 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			119 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # 使用说明文档 - 后门检测系统
 | ||
| 
 | ||
| 本文档提供了后门检测系统的使用方法,包括依赖版本漏洞检测和静态代码后门检测两部分。这将帮助用户正确执行安全检测,并理解输出结果。
 | ||
| 
 | ||
| ## 下载和配置
 | ||
| 
 | ||
| - 克隆或下载后门检测系统到您的本地环境。
 | ||
| - 确保脚本文件 (`requirements_detection.py` 和 `backdoor_detection.py`) 在您的工作目录中。
 | ||
| 
 | ||
| ## 打包
 | ||
| 
 | ||
| ### pip
 | ||
| 
 | ||
| #### 打包命令
 | ||
| 
 | ||
| ```bash
 | ||
| pip install wheel
 | ||
| python setup.py sdist bdist_wheel
 | ||
| ```
 | ||
| 
 | ||
| 执行上述命令后,会在 dist 目录下生成 .tar.gz 和 .whl 文件。
 | ||
| 
 | ||
| #### 本地安装
 | ||
| 
 | ||
| - 安装 .whl 文件:
 | ||
| 
 | ||
| ``` bash
 | ||
| pip install dist/backdoor_buster-0.1.0-py3-none-any.whl
 | ||
| ```
 | ||
| 
 | ||
| - 安装 .tar.gz 文件:
 | ||
| 
 | ||
| ``` bash
 | ||
| pip install dist/backdoor_buster-0.1.0.tar.gz
 | ||
| ```
 | ||
| 
 | ||
| #### 上传到 PyPI
 | ||
| 
 | ||
| - 安装 twine:
 | ||
| 
 | ||
| ``` bash
 | ||
| pip install twine
 | ||
| ```
 | ||
| 
 | ||
| - 使用 twine 上传包到 PyPI:
 | ||
| 
 | ||
| ``` bash
 | ||
| twine upload dist/*
 | ||
| ```
 | ||
| 
 | ||
| 需要提供 PyPI 的用户名和密码。如果没有 PyPI 账号,可以在 PyPI 注册。
 | ||
| 
 | ||
| #### 使用 PyPI 安装
 | ||
| 
 | ||
| 包上传到 PyPI 后,可以通过以下命令安装:
 | ||
| 
 | ||
| ``` bash
 | ||
| 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
 | ||
| ```
 | ||
| 
 | ||
| ## 结果解读
 | ||
| 
 | ||
| - 输出结果将根据指定的格式保存在您指定的文件中。
 | ||
| - 结果中会标注出每个文件中发现的高风险和中风险函数调用位置。
 | ||
| - 对于依赖检测,结果将标明每个依赖包的安全状态,包括存在安全风险的依赖及其版本。
 | ||
| 
 | ||
| ## 常见问题处理
 | ||
| 
 | ||
| - 确保所有路径都正确无误,避免因路径错误导致文件读取失败。
 | ||
| - 如果输出格式指定错误,系统将默认输出为 `.txt` 格式。
 | ||
| - 确保安装了所有必要的依赖库,以避免运行时错误。
 | ||
| 
 | ||
| ## 支持
 | ||
| 
 | ||
| 如果您在使用过程中遇到任何问题,或需要进一步的技术支持,请联系开发团队或访问我们的Git仓库以获取帮助和最新信息。
 | ||
| 
 | ||
| ---
 | ||
| 
 | ||
| 以上是后门检测系统的使用说明文档。请按照这些步骤进行操作,以确保您能有效地使用本系统进行安全检测。
 |