monkey/chaos_monkey/exploit/__init__.py

44 lines
1.3 KiB
Python
Raw Normal View History

2015-08-30 15:27:35 +08:00
from abc import ABCMeta, abstractmethod
__author__ = 'itamar'
2015-08-30 15:27:35 +08:00
class HostExploiter(object):
__metaclass__ = ABCMeta
2017-10-16 15:58:11 +08:00
_TARGET_OS_TYPE = []
def __init__(self, host):
2017-10-16 15:58:11 +08:00
self._exploit_info = {}
self._exploit_attempts = []
self.host = host
def is_os_supported(self):
2017-10-16 15:58:11 +08:00
return self.host.os.get('type') in self._TARGET_OS_TYPE
def send_exploit_telemetry(self, result):
from control import ControlClient
ControlClient.send_telemetry(
'exploit',
{'result': result, 'machine': self.host.__dict__, 'exploiter': self.__class__.__name__,
'info': self._exploit_info, 'attempts': self._exploit_attempts})
def report_login_attempt(self, result, user, password, lm_hash='', ntlm_hash=''):
self._exploit_attempts.append({'result': result, 'user': user, 'password': password,
'lm_hash': lm_hash, 'ntlm_hash': ntlm_hash})
2015-08-30 15:27:35 +08:00
@abstractmethod
def exploit_host(self):
2015-08-30 15:27:35 +08:00
raise NotImplementedError()
2015-11-30 20:11:19 +08:00
2017-09-26 20:43:46 +08:00
2015-11-30 20:11:19 +08:00
from win_ms08_067 import Ms08_067_Exploiter
from wmiexec import WmiExploiter
from smbexec import SmbExploiter
from rdpgrinder import RdpExploiter
from sshexec import SSHExploiter
from shellshock import ShellShockExploiter
2017-08-31 22:50:55 +08:00
from sambacry import SambaCryExploiter
2017-09-26 20:43:46 +08:00
from elasticgroovy import ElasticGroovyExploiter