Compare commits

...

4 Commits

3 changed files with 6 additions and 41 deletions

View File

@@ -170,7 +170,9 @@ def process_path(path: str, output_format: str, mode: str, output_file=None):
def main():
import argparse
parser = argparse.ArgumentParser(description="Backdoor detection tool.")
parser = argparse.ArgumentParser(
description="Backdoor detection tool.", prog="detection"
)
parser.add_argument("path", help="Path to the code to analyze")
parser.add_argument("-o", "--output", help="Output file path", default=None)
parser.add_argument(

View File

@@ -6,14 +6,10 @@
在开始使用本系统之前,请确保您的环境中安装了以下依赖:
- Python 3.6 或更高版本
- `packaging` 库:用于版本控制和比较
- `reportlab` 库:用于生成 PDF 报告
您可以通过以下命令安装必要的 Python 库:
```bash
pip install packaging reportlab
pip install -r requirements.txt
```
## 下载和配置
@@ -117,40 +113,6 @@ twine upload dist/*
pip install backdoor_buster
```
### deb
#### 命令
- 安装`stdeb`
```bash
sudo apt-get install python-stdeb
```
- 创建`debian`目录
- 编写 debian/rules 文件
```makefile
#!/usr/bin/make -f
%:
dh $@
```
- 打包
```bash
python setup.py --command-packages=stdeb.command bdist_deb
```
- 构建DEB包
```bash
cd deb_dist
sudo dpkg -i backdoor_buster.deb
```
## 常见问题处理
- 确保所有路径都正确无误,避免因路径错误导致文件读取失败。

View File

@@ -1,7 +1,7 @@
import unittest
import warnings
from detection.backdoor_detection import find_dangerous_functions
from detection.__main__ import find_dangerous_functions
from detection.GPTdetection import detectGPT
import os
@@ -83,5 +83,6 @@ class TestBackdoorDetection(unittest.TestCase):
self.assertEqual(len(results["medium"]), 0)
self.assertEqual(len(results["low"]), 0)
if __name__ == "__main__":
unittest.main()