Agent: Enable Hadoop exploiter to run

This commit is contained in:
Ilija Lazoroski 2022-02-23 17:13:25 +01:00 committed by Shreya Malviya
parent 1223e2acf3
commit 34953f1c88
3 changed files with 6 additions and 5 deletions

View File

@ -33,8 +33,8 @@ class HadoopExploiter(WebRCE):
# Random string's length that's used for creating unique app name
RAN_STR_LEN = 6
def __init__(self, host):
super(HadoopExploiter, self).__init__(host)
def __init__(self):
super(HadoopExploiter, self).__init__()
def _exploit_host(self):
# Try to get exploitable url

View File

@ -32,13 +32,12 @@ POWERSHELL_NOT_FOUND = "powershell is not recognized"
class WebRCE(HostExploiter):
def __init__(self, host, monkey_target_paths=None):
def __init__(self, monkey_target_paths=None):
"""
:param host: Host that we'll attack
:param monkey_target_paths: Where to upload the monkey at the target host system.
Dict in format {'linux': '/tmp/monkey.sh', 'win32': './monkey32.exe', 'win64':... }
"""
super(WebRCE, self).__init__(host)
super(WebRCE, self).__init__()
if monkey_target_paths:
self.monkey_target_paths = monkey_target_paths
else:

View File

@ -17,6 +17,7 @@ from infection_monkey.credential_collectors import (
SSHCredentialCollector,
)
from infection_monkey.exploit import ExploiterWrapper
from infection_monkey.exploit.hadoop import HadoopExploiter
from infection_monkey.exploit.sshexec import SSHExploiter
from infection_monkey.i_puppet import IPuppet, PluginType
from infection_monkey.master import AutomatedMaster
@ -222,6 +223,7 @@ class InfectionMonkey:
exploit_wrapper.wrap(SSHExploiter),
PluginType.EXPLOITER,
)
puppet.load_plugin("HadoopExploiter", HadoopExploiter(), PluginType.EXPLOITER)
puppet.load_plugin("ransomware", RansomwarePayload(), PluginType.PAYLOAD)