forked from p15670423/monkey
42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
from abc import ABCMeta, abstractmethod
|
|
|
|
__author__ = 'itamar'
|
|
|
|
|
|
class HostExploiter(object):
|
|
__metaclass__ = ABCMeta
|
|
|
|
def __init__(self, host):
|
|
self._target_os_type = []
|
|
self._exploit_info = {}
|
|
self._exploit_attempts = []
|
|
self.host = host
|
|
|
|
def is_os_supported(self):
|
|
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})
|
|
|
|
@abstractmethod
|
|
def exploit_host(self):
|
|
raise NotImplementedError()
|
|
|
|
|
|
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
|
|
from sambacry import SambaCryExploiter
|
|
from elasticgroovy import ElasticGroovyExploiter
|