mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-13 04:36:58 +00:00
Intending
This commit is contained in:
@@ -67,6 +67,7 @@ def interactive_set_config():
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def parse_docs(hunter, docs):
|
||||
"""returns tuple of (name, docs)"""
|
||||
if not docs:
|
||||
@@ -75,7 +76,8 @@ def parse_docs(hunter, docs):
|
||||
for i, line in enumerate(docs):
|
||||
docs[i] = line.strip()
|
||||
return docs[0], ' '.join(docs[1:]) if len(docs[1:]) else "<no documentation>"
|
||||
|
||||
|
||||
|
||||
def list_hunters():
|
||||
print("\nPassive Hunters:\n----------------")
|
||||
for i, (hunter, docs) in enumerate(handler.passive_hunters.items()):
|
||||
@@ -87,11 +89,14 @@ def list_hunters():
|
||||
for i, (hunter, docs) in enumerate(handler.active_hunters.items()):
|
||||
name, docs = parse_docs(hunter, docs)
|
||||
print("* {}\n {}\n".format( name, docs))
|
||||
|
||||
|
||||
|
||||
tlock3 = threading.Lock
|
||||
tlock3.acquire()
|
||||
hunt_started = False
|
||||
tlock3.release()
|
||||
|
||||
|
||||
def main():
|
||||
global hunt_started
|
||||
scan_options = [
|
||||
|
||||
@@ -3,6 +3,7 @@ import requests
|
||||
import json
|
||||
import threading
|
||||
|
||||
|
||||
class Event(object):
|
||||
def __init__(self):
|
||||
self.previous = None
|
||||
@@ -24,8 +25,11 @@ class Event(object):
|
||||
previous = previous.previous
|
||||
return history
|
||||
|
||||
|
||||
""" Event Types """
|
||||
# TODO: make proof an abstract method.
|
||||
|
||||
|
||||
class Service(object):
|
||||
def __init__(self, name, path="", secure=True):
|
||||
self.name = name
|
||||
@@ -42,6 +46,7 @@ class Service(object):
|
||||
def explain(self):
|
||||
return self.__doc__
|
||||
|
||||
|
||||
class Vulnerability(object):
|
||||
def __init__(self, component, name, category=None):
|
||||
self.component = component
|
||||
@@ -63,6 +68,8 @@ class Vulnerability(object):
|
||||
|
||||
event_id_count = 0
|
||||
""" Discovery/Hunting Events """
|
||||
|
||||
|
||||
class NewHostEvent(Event):
|
||||
def __init__(self, host, cloud=None):
|
||||
global event_id_count
|
||||
@@ -74,6 +81,7 @@ class NewHostEvent(Event):
|
||||
def __str__(self):
|
||||
return str(self.host)
|
||||
|
||||
|
||||
class OpenPortEvent(Event):
|
||||
def __init__(self, port):
|
||||
self.port = port
|
||||
@@ -81,8 +89,10 @@ class OpenPortEvent(Event):
|
||||
def __str__(self):
|
||||
return str(self.port)
|
||||
|
||||
|
||||
class HuntFinished(Event):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class HuntStarted(Event):
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user