diff --git a/Config/config_decorators.py b/Config/config_decorators.py index 4782efc..30fec2c 100644 --- a/Config/config_decorators.py +++ b/Config/config_decorators.py @@ -65,6 +65,6 @@ def Save_Csv(fun): # 写入多行数据 for i in result: writer.writerow(list(i.values())) - status_print('结果已保存至:'+filename,1) + status_print('全部结果已保存至:'+filename,1) # return fun(*args, **kwargs) return work diff --git a/Meppo_Api.py b/Framework/console_api.py similarity index 82% rename from Meppo_Api.py rename to Framework/console_api.py index 1a5a9f1..80c1f33 100644 --- a/Meppo_Api.py +++ b/Framework/console_api.py @@ -16,7 +16,10 @@ from Config.config_banner import Banner from flask import Flask +from gevent import pywsgi from flask import request + +from Config.config_print import status_print from Framework.console_attack import run_poc_api from Tools.ReBuild import get_moudle, get_payload @@ -50,7 +53,11 @@ def list(): res[i]=get_payload(i) return res +def run(port=1988): + status_print('服务已启动:'+'0.0.0.0:'+str(port)) + server = pywsgi.WSGIServer(('0.0.0.0', port), app) + server.serve_forever() if __name__ == '__main__': Banner() - app.run(host='0.0.0.0', port=1988, debug=False) \ No newline at end of file + app.run(host='0.0.0.0', port=1988, debug=False) diff --git a/Framework/console_main.py b/Framework/console_main.py index 176a514..6432646 100644 --- a/Framework/console_main.py +++ b/Framework/console_main.py @@ -12,6 +12,7 @@ import argparse from Config.config_api import FOFA_API_KEY, SHODAN_API_KEY, HUNTER_API_KEY from Config.config_print import status_print from Framework import console_attack +from Framework import console_api from Seek import fofaapi, shodanapi, hunterapi from Framework.console_attack import get_urls from Framework.console_list import moudle_list, payload_list, payload_list_all @@ -23,6 +24,7 @@ def Console(): parser = argparse.ArgumentParser() M_POC = parser.add_argument_group('漏洞检测模块') M_SEEK = parser.add_argument_group('资产爬取模块') + M_API = parser.add_argument_group('API服务模块') ######################################################################################################################## parser.add_argument("-l", dest='list',help="list",action='store_true') @@ -42,6 +44,10 @@ def Console(): M_SEEK.add_argument("-shodan", dest='shodan',help="资产爬取") M_SEEK.add_argument("-num", dest='num',help="资产数量") + #API服务模块 + M_API.add_argument("-server", help="启动API服务", action='store_true') + M_API.add_argument("-port", dest='port',help="监听端口") + args = parser.parse_args() ######################################################################################################################## @@ -111,21 +117,28 @@ def Console(): moudle_list() elif args.listall: payload_list_all() + elif args.server: + if args.port: + console_api.run(args.port) + else: + console_api.run() else: status_print("Usage:" - "\n\tpython Meppo.py -l\t\t\t\tList All Moudles" - "\n\tpython Meppo.py -ll\t\t\t\tList All Payloads" - "\n\tpython Meppo.py -m xxx -l\t\t\tList Payload Of The Moudle" - "\n\tpython Meppo.py -poc xxx -u target\t\t单目标 单POC监测" - "\n\tpython Meppo.py -poc xxx -f targets.txt\t\t多目标 单POC监测" - "\n\tpython Meppo.py -m xxx -u target\t\t单目标 模块监测" - "\n\tpython Meppo.py -m xxx -f targets.txt\t\t多目标 模块监测" - "\n\tpython Meppo.py -fofa APP=\"DEMO\"\t\tFOFA API 报告导出 num默认1000" - "\n\tpython Meppo.py -fofa APP=\"DEMO\" -num 100\tFOFA API 报告导出 自定义数量" - "\n\tpython Meppo.py -hunter APP=\"DEMO\"\t\tHUNTER API 报告导出 num默认1000" - "\n\tpython Meppo.py -hunter APP=\"DEMO\" -num 100\tSHODAN HUNTER 报告导出 自定义数量" - "\n\tpython Meppo.py -shodan APP=\"DEMO\"\t\tSHODAN API 报告导出 num默认1000" - "\n\tpython Meppo.py -shodan APP=\"DEMO\" -num 100\tSHODAN API 报告导出 自定义数量",5) + "\n\tpython Meppo.py -l\t\t\t\tList All Moudles" + "\n\tpython Meppo.py -ll\t\t\t\tList All Payloads" + "\n\tpython Meppo.py -m xxx -l\t\t\tList Payload Of The Moudle" + "\n\tpython Meppo.py -poc xxx -u target\t\t单目标 单POC监测" + "\n\tpython Meppo.py -poc xxx -f targets.txt\t\t多目标 单POC监测" + "\n\tpython Meppo.py -m xxx -u target\t\t单目标 模块监测" + "\n\tpython Meppo.py -m xxx -f targets.txt\t\t多目标 模块监测" + "\n\tpython Meppo.py -fofa APP=\"DEMO\"\t\tFOFA API 报告导出 num默认1000" + "\n\tpython Meppo.py -fofa APP=\"DEMO\" -num 100\tFOFA API 报告导出 自定义数量" + "\n\tpython Meppo.py -hunter APP=\"DEMO\"\t\tHUNTER API 报告导出 num默认1000" + "\n\tpython Meppo.py -hunter APP=\"DEMO\" -num 100\tSHODAN HUNTER 报告导出 自定义数量" + "\n\tpython Meppo.py -shodan APP=\"DEMO\"\t\tSHODAN API 报告导出 num默认1000" + "\n\tpython Meppo.py -shodan APP=\"DEMO\" -num 100\tSHODAN API 报告导出 自定义数量" + "\n\tpython Meppo.py -server\t\t\t\t启动API服务 默认1988端口" + "\n\tpython Meppo.py -server -port 1988\t\t启动API服务 自定义端口",5) ######################################################################################################################## diff --git a/Moudle/Jenkins/CVE_2018_1000861.py b/Moudle/Jenkins/CVE_2018_1000861.py index e09f787..d829737 100644 --- a/Moudle/Jenkins/CVE_2018_1000861.py +++ b/Moudle/Jenkins/CVE_2018_1000861.py @@ -6,6 +6,7 @@ import re import urllib import binascii from Config.config_requests import headers + requests.packages.urllib3.disable_warnings() ######################################################################################################################## diff --git a/Moudle/Joomla/joomla_config_find.py b/Moudle/Joomla/joomla_config_find.py index 9a9c156..ba52cc6 100644 --- a/Moudle/Joomla/joomla_config_find.py +++ b/Moudle/Joomla/joomla_config_find.py @@ -2,11 +2,10 @@ # _*_ coding:utf-8 _*_ import requests -import requests.packages.urllib3 from Config.config_requests import ua -from requests.packages.urllib3.exceptions import InsecureRequestWarning -requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + +requests.packages.urllib3.disable_warnings() # 脚本信息 diff --git a/Moudle/Nexus/CVE_2019_7238.py b/Moudle/Nexus/CVE_2019_7238.py index 64e5d49..c5cf1ac 100644 --- a/Moudle/Nexus/CVE_2019_7238.py +++ b/Moudle/Nexus/CVE_2019_7238.py @@ -2,8 +2,6 @@ # _*_ coding:utf-8 _*_ import requests -import requests.packages.urllib3 - requests.packages.urllib3.disable_warnings() diff --git a/README.md b/README.md index d967b66..fe5fce6 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,8 @@ Usage: python Meppo.py -hunter APP="DEMO" -num 100 SHODAN HUNTER 报告导出 自定义数量 python Meppo.py -shodan APP="DEMO" SHODAN API 报告导出 num默认1000 python Meppo.py -shodan APP="DEMO" -num 100 SHODAN API 报告导出 自定义数量 - + python Meppo.py -server 启动API服务 默认1988端口 + python Meppo.py -server -port 1988 启动API服务 自定义端口 ``` ```angular2html @@ -75,6 +76,10 @@ options: -shodan SHODAN 资产爬取 -num NUM 资产数量 +API服务模块: + -server 启动API服务 + -port PORT 监听端口 + ``` ```angular2html _____ diff --git a/Seek/fofaapi.py b/Seek/fofaapi.py index 1538cf1..718b7bc 100644 --- a/Seek/fofaapi.py +++ b/Seek/fofaapi.py @@ -27,6 +27,7 @@ def fofaapi(keyword,num): dic['server'] = i[5] dic['title'] = i[6] reslist.append(dic) + hosts.append(i[0]) print(dic) gethosts(hosts) return reslist