示例#1
0
    def __pocsuite3_scanner(self, _poc_config):
        '''Pocsuite3 API调用
        '''
        init_pocsuite(_poc_config)
        start_pocsuite()
        result = get_results()

        return result
 def verify_result(self):
     config = {
         'url': ['https://www.baidu.com/'],
         'poc': [os.path.join(paths.POCSUITE_ROOT_PATH, "../tests/login_demo.py")],
         'username': "******",
         'password': '******',
         'verbose': 0,
         "timeout": 10,
     }
     init_pocsuite(config)
     start_pocsuite()
     result = get_results().pop()
     self.assertTrue(result.status == 'success')
示例#3
0
def run_pocsuite():
    # config 配置可参见命令行参数, 用于初始化 pocsuite3.lib.core.data.conf
    config = {
        'url': '123.207.176.60',
        'poc': 'ssh_burst',
        'mode':'attack',
    }

    init_pocsuite(config)
    start_pocsuite()
    result = get_results()
    print(result)
    print(1)
 def test_cookie(self):
     config = {
         'url': ['http://httpbin.org/post'],
         'poc': [os.path.join(paths.POCSUITE_ROOT_PATH, "../tests/login_demo.py")],
         'username': "******",
         'password': '******',
         'cookie': 'test=1',
         'verbose': 0,
         "timeout": 10,
     }
     init_pocsuite(config)
     start_pocsuite()
     result = get_results().pop()
     self.assertTrue(result.status == 'success')
示例#5
0
def scanPoc(url, currdir, poc, tid):
    config = {
        'url': url,
        'poc': os.path.join(currdir, poc + '.py'),
    }

    # print(config['poc'])
    # print(os.path.dirname(os.path.dirname(__file__)))
    # config字典的配置和cli命令行参数配置一模一样
    init_pocsuite(config)
    start_pocsuite()
    result = get_results().pop()
    if result['status'] == 'success':
        saveVul(result, tid, poc)
示例#6
0
 def verify(self, url, poc):
     config = self.config
     config.update({'url': url, 'poc': poc})
     init_pocsuite(config)
     start_pocsuite()
     r = get_results()
     results = []
     for item in r:
         result = ({
             'status': item['status'],
             'target': item['target'],
             'poc_name': item['poc_name'],
             'created': item['created'],
         })
         results.append(result)
     return results
示例#7
0
 def test_socks5(self):
     proxy = "socks5://127.0.0.1:1080"
     proxy_cred = "username:password"
     config = {
         'url': ['https://www.baidu.com/'],
         'poc':
         [os.path.join(paths.POCSUITE_ROOT_PATH, "../tests/login_demo.py")],
         'username':
         "******",
         'password':
         '******',
         'verbose':
         0,
         "timeout":
         30,
         "proxy":
         proxy,
         "proxy_cred":
         proxy_cred
     }
     init_pocsuite(config)
     start_pocsuite()
     result = get_results().pop()
     self.assertTrue(result.status == 'success')
示例#8
0
 def test_import_run(self):
     start_pocsuite()
     self.verify_result()