Hypdncy / NessusToReport

Nessus扫描报告自动化生成工具
Apache License 2.0
533 stars 134 forks source link

大佬,已经调整了translate_asyncios的值,但始终报这个错! #11

Closed safebaseline closed 3 years ago

safebaseline commented 3 years ago

image

safebaseline commented 3 years ago

也转了UTF-8的编码的csv

safebaseline commented 3 years ago

也升级为百度高级版用户

safebaseline commented 3 years ago

2021-06-06 23:53:56,298 - root - INFO - 开始初始化数据 2021-06-06 23:53:56,298 - root - INFO - ---开始读取数据 2021-06-06 23:53:56,314 - root - INFO - ----漏洞种类总数:19 2021-06-06 23:53:56,314 - root - INFO - ----漏洞主机总数:5 2021-06-06 23:53:56,314 - root - INFO - ---开始翻译数据 2021-06-06 23:53:56,314 - root - INFO - ------翻译漏洞总数:1 Traceback (most recent call last): File "main.py", line 45, in h = Handle(args.docxtype) File "C:\Users\Administrator\Desktop\NessusToReport-master\modle\handle.py", line 54, in init TranBaidu(self.LOOPHOLES).run() File "C:\Users\Administrator\Desktop\NessusToReport-master\modle\common\translate\base.py", line 84, in run self._tran() File "C:\Users\Administrator\Desktop\NessusToReport-master\modle\common\translate\baidu.py", line 87, in _tran self.LOOPHOLES[plugin_id][type_cn] = resinfo["trans_result"][0]["dst"] KeyError: 'trans_result'

Hypdncy commented 3 years ago

说实在的没碰到过,尝试下换个网络,比如移动热点?

199-LI commented 3 years ago

好像安全设备的漏洞无法翻译

Hypdncy commented 3 years ago

可以把nessus的csv导出给我吗,hypdncy@163.com

safebaseline commented 3 years ago

已发

Hypdncy commented 3 years ago

"D:\Program Files\Python38\python.exe" F:/GitHub/NessusToReport/main.py 2021-06-07 11:05:55,586 - root - INFO - 开始初始化数据 2021-06-07 11:05:55,586 - root - INFO - ---开始读取数据 2021-06-07 11:05:55,597 - root - INFO - ----漏洞种类总数:17 2021-06-07 11:05:55,597 - root - INFO - ----漏洞主机总数:5 2021-06-07 11:05:55,597 - root - INFO - ---开始翻译数据 2021-06-07 11:05:55,599 - root - INFO - ------翻译漏洞总数:0 2021-06-07 11:05:55,602 - root - INFO - ------翻译完成 2021-06-07 11:05:55,603 - root - INFO - 开始生成漏洞排序报告 2021-06-07 11:05:55,603 - root - INFO - ---开始处理数据 2021-06-07 11:05:55,603 - root - INFO - ---开始处理文档 2021-06-07 11:05:56,071 - root - INFO - ---保存漏洞排序文档:./懂王主机扫描报告-2021-06-07-漏洞排序.docx Microsoft Word 2021-06-07 11:06:01,764 - root - INFO - 开始生成主机排序报告 2021-06-07 11:06:01,764 - root - INFO - ---开始处理数据 2021-06-07 11:06:01,764 - root - INFO - ---开始处理文档 2021-06-07 11:06:02,247 - root - INFO - ---保存主机排序文档:./懂王主机扫描报告-2021-06-07-主机排序.docx Microsoft Word 2021-06-07 11:06:07,139 - root - INFO - ---程序结束---

Process finished with exit code 0

Hypdncy commented 3 years ago

没有问题,替换下 vlundb库吧

safebaseline commented 3 years ago

image 读取的数量怎么不同!!!

safebaseline commented 3 years ago

库已经是最新的!!!

199-LI commented 3 years ago

我也是同样的问题,库是最新的,还是报错 image

Ciyfly commented 3 years ago

个人觉得是异步请求打到百度翻译频率过高导致,临时的解决办法 限制并发数量为1 然后对于没有翻译完成的也继续走流程最后会输出 部分翻译的报告
cnf\const.py 修改 translate_asyncios =1 modle\common\translate\baidu.py 87行修改为

        for plugin_id, type_cn, resinfo in cn_resinfos:
            if "trans_result" not in list(resinfo.keys()):
                continue
            self.LOOPHOLES[plugin_id][type_cn] = resinfo["trans_result"][0]["dst"]

modle\common\translate\base.py 48行加上

    def _check_en2cn(self):
        for plugin_id, info in self.LOOPHOLES.items():
            if not info['name_cn'] and  not info['describe_cn']:
                logging.error("name 和 describe 都翻译失败")
                raise
Hypdncy commented 3 years ago

个人觉得是异步请求打到百度翻译频率过高导致,临时的解决办法 限制并发数量为1 然后对于没有翻译完成的也继续走流程最后会输出 部分翻译的报告 cnf\const.py 修改 modle\common\translate\baidu.py 87行修改为translate_asyncios =1

        for plugin_id, type_cn, resinfo in cn_resinfos:
            if "trans_result" not in list(resinfo.keys()):
                continue
            self.LOOPHOLES[plugin_id][type_cn] = resinfo["trans_result"][0]["dst"]

modle\common\translate\base.py 48行加上

    def _check_en2cn(self):
        for plugin_id, info in self.LOOPHOLES.items():
            if not info['name_cn'] and  not info['describe_cn']:
                logging.error("name 和 describe 都翻译失败")
                raise

现在已经限制了并发的QPS可以尝试下

Hypdncy commented 3 years ago

最新的代码已经限制了QPS,请查看