Skip to content

Commit

Permalink
修改默认排序方式、修复部分格式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypdncy committed Jul 13, 2021
1 parent 04e97d5 commit c888fbb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

> Github地址:`https://github.com/Hypdncy/NessusToReport`
> **V2.0** 求个Start,欢迎各大厂提供自己的报告样例,我可以做成模板!!!
> **V2.0** 求个Start,欢迎各大厂提供自己的报告样例,我可以做成模板!!!
> **V2.0** 求个Start,欢迎各大厂提供自己的报告样例,我可以做成模板!!!
这是一个nessus自动报告生成工具,可以用来自动生成nessus扫描器的中文报告--NessusToReport,程序有两种报告方式:

- 漏洞排序:以漏洞为单位一一罗列拥有该漏洞的主机及其信息
- 主机排序:以主机为单位一一罗列主机所拥有的漏洞及其信息
- 单个主机:以主机为单位一一罗列每个主机的漏洞报告(一个主机一份报告)

## 使用说明

#### 安装方法

建议在windows下安装python3.8+版本

> python3.6及其以下版本可能会出现协程错误
> python3.6及其以下版本可能会出现字典错误
> python3.8及其以下版本可能会出现携程错误
```shell script
root@hypdncy:~# pip install -r requirement.txt
Expand All @@ -31,9 +28,10 @@ root@hypdncy:~# pip install -r requirement.txt
1. 执行命令`python main.py`

```shell script
root@hypdncy:~# python main.py # 默认出两种类型扫描报告
root@hypdncy:~# python main.py # 默认出漏洞排序类型扫描报告
root@hypdncy:~# python main.py -t loops # 指定漏洞排序类型扫描报告
root@hypdncy:~# python main.py -t hosts # 指定主机排序类型扫描报告
root@hypdncy:~# python main.py -t host # 指定单个主机类型扫描报告
```

## 配置说明
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")

parser = argparse.ArgumentParser(description="自动化报告生成程序,用于生成主机扫描的报告文档")
parser.add_argument("-t", "--type", dest="docxtype", type=str, action="store", default="all",
parser.add_argument("-t", "--type", dest="docxtype", type=str, action="store", default="loops",
choices=["loops", "hosts", "host", "all"],
help="配置文档生成方式")
args = parser.parse_args()
Expand Down
2 changes: 0 additions & 2 deletions modle/docx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
# '.:::::' ':'````..
# ------------------------------------------------------------

from docx import Document
import re
import logging
import platform
from abc import abstractmethod
from pathlib import Path
from docx import Document

Expand Down
4 changes: 2 additions & 2 deletions modle/docx/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
# ````':. ':::::::::' ::::..
# '.:::::' ':'````..
# ------------------------------------------------------------
import logging

from docx import Document
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT

from modle.common.loophole.loopholes import Loopholes
from modle.docx.base import DocxBase

from cnf.const import template_file, company_name
from cnf.data import cnf_data, host_loop_ports, system_host_names
from cnf.data import host_loop_ports, system_host_names


class DocxHosts(DocxBase):
Expand Down

0 comments on commit c888fbb

Please sign in to comment.