コード例 #1
0
 def __init__(self,
              iterTarget,
              pocPath,
              poolModule='beethread',
              concurrency=20,
              verify=True):
     self.iterTarget = iterTarget
     self.verify = verify
     self._pocObj = Poc(path=pocPath)
     self._poolModule = poolModule
     self._workerPool = self._initWorkerPool(poolModule)(
         concurrency=concurrency)
コード例 #2
0
ファイル: scanner.py プロジェクト: 2625668714/Beehive
 def __init__(self, iterTarget, pocPath, poolModule='beethread',
              concurrency=20, verify=True):
     self.iterTarget = iterTarget
     self.verify = verify
     self._pocObj = Poc(path=pocPath)
     self._poolModule = poolModule
     self._workerPool = self._initWorkerPool(poolModule)(concurrency=concurrency)
コード例 #3
0
class Hunter(object):
    '''scanner scanning a list of targets with a particular poc.'''
    def __init__(self,
                 iterTarget,
                 pocPath,
                 poolModule='beethread',
                 concurrency=20,
                 verify=True):
        self.iterTarget = iterTarget
        self.verify = verify
        self._pocObj = Poc(path=pocPath)
        self._poolModule = poolModule
        self._workerPool = self._initWorkerPool(poolModule)(
            concurrency=concurrency)

    def _initWorkerPool(self, poolModule='beethread'):
        if poolModule is 'beethread':
            return bt.WorkerPool
        elif poolModule is 'beecoroutine':
            return bc.WorkerPool

    def _runPoc(self, target):
        # TODO: need to normalize target in Poc
        target = target.strip()
        return self._pocObj.run(target=target, verify=self.verify)

    def scan(self, timeout=None):
        self._workerPool.work(iterJobFuncArgs=self.iterTarget,
                              jobFunc=self._runPoc,
                              timeout=timeout)
        return self._workerPool.results
コード例 #4
0
ファイル: scanner.py プロジェクト: 2625668714/Beehive
class Hunter(object):
    '''scanner scanning a list of targets with a particular poc.'''
    def __init__(self, iterTarget, pocPath, poolModule='beethread',
                 concurrency=20, verify=True):
        self.iterTarget = iterTarget
        self.verify = verify
        self._pocObj = Poc(path=pocPath)
        self._poolModule = poolModule
        self._workerPool = self._initWorkerPool(poolModule)(concurrency=concurrency)

    def _initWorkerPool(self, poolModule='beethread'):
        if poolModule is 'beethread':
            return bt.WorkerPool
        elif poolModule is 'beecoroutine':
            return bc.WorkerPool

    def _runPoc(self, target):
        # TODO: need to normalize target in Poc
        target = target.strip()
        return self._pocObj.run(target=target, verify=self.verify)

    def scan(self, timeout=None):
        self._workerPool.work(iterJobFuncArgs=self.iterTarget,
                              jobFunc=self._runPoc,
                              timeout=timeout)
        return self._workerPool.results
コード例 #5
0
 def _loadPocs(self, listPocPaths):
     pocObjs = []
     for pocPath in listPocPaths:
         pocObjs.append(Poc(path=pocPath))
     return pocObjs