forked from p15670423/monkey
Manual fixes of long line refactorings gone wrong
This commit is contained in:
parent
73da6fdc40
commit
56e754eddd
|
@ -81,10 +81,7 @@ PRINCIPLE_DISASTER_RECOVERY = "data_backup"
|
|||
PRINCIPLE_SECURE_AUTHENTICATION = "secure_authentication"
|
||||
PRINCIPLE_MONITORING_AND_LOGGING = "monitoring_and_logging"
|
||||
PRINCIPLES = {
|
||||
PRINCIPLE_SEGMENTATION: "Apply segmentation and micro-segmentation inside your "
|
||||
""
|
||||
""
|
||||
"network.",
|
||||
PRINCIPLE_SEGMENTATION: "Apply segmentation and micro-segmentation inside your network.",
|
||||
PRINCIPLE_ANALYZE_NETWORK_TRAFFIC: "Analyze network traffic for malicious activity.",
|
||||
PRINCIPLE_USER_BEHAVIOUR: "Adopt security user behavior analytics.",
|
||||
PRINCIPLE_ENDPOINT_SECURITY: "Use anti-virus and other traditional endpoint "
|
||||
|
|
|
@ -156,8 +156,7 @@ class ControlClient(object):
|
|||
try:
|
||||
telemetry = {"monkey_guid": GUID, "telem_category": telem_category, "data": json_data}
|
||||
requests.post(
|
||||
"https://%s/api/telemetry" % (WormConfiguration.current_server,),
|
||||
# noqa: DUO123
|
||||
"https://%s/api/telemetry" % (WormConfiguration.current_server,), # noqa: DUO123
|
||||
data=json.dumps(telemetry),
|
||||
headers={"content-type": "application/json"},
|
||||
verify=False,
|
||||
|
@ -372,8 +371,7 @@ class ControlClient(object):
|
|||
def get_pba_file(filename):
|
||||
try:
|
||||
return requests.get(
|
||||
PBA_FILE_DOWNLOAD % (WormConfiguration.current_server, filename),
|
||||
# noqa: DUO123
|
||||
PBA_FILE_DOWNLOAD % (WormConfiguration.current_server, filename), # noqa: DUO123
|
||||
verify=False,
|
||||
proxies=ControlClient.proxies,
|
||||
timeout=LONG_REQUEST_TIMEOUT,
|
||||
|
|
|
@ -197,8 +197,8 @@ class ZerologonExploiter(HostExploiter):
|
|||
def get_all_user_creds(self) -> List[Tuple[str, Dict]]:
|
||||
try:
|
||||
options = OptionsForSecretsdump(
|
||||
target=f"{self.dc_name}$@{self.dc_ip}",
|
||||
# format for DC account - "NetBIOSName$@0.0.0.0"
|
||||
target=f"{self.dc_name}$@{self.dc_ip}",
|
||||
target_ip=self.dc_ip,
|
||||
dc_ip=self.dc_ip,
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
def get_linux_trap_commands():
|
||||
return [
|
||||
"trap 'echo \"Successfully used trap command\"' INT && kill -2 $$ ;",
|
||||
# trap and send SIGINT signal
|
||||
"trap 'echo \"Successfully used trap command\"' INT && kill -2 $$ ;",
|
||||
"trap - INT", # untrap SIGINT
|
||||
]
|
||||
|
|
|
@ -14,8 +14,8 @@ def get_linux_commands_to_add_user(username):
|
|||
"-M", # Do not create homedir
|
||||
"--expiredate", # The date on which the user account will be disabled.
|
||||
datetime.datetime.today().strftime("%Y-%m-%d"),
|
||||
"--inactive",
|
||||
# The number of days after a password expires until the account is permanently disabled.
|
||||
"--inactive",
|
||||
"0", # A value of 0 disables the account as soon as the password has expired
|
||||
"-c", # Comment
|
||||
"MONKEY_USER", # Comment
|
||||
|
|
|
@ -53,8 +53,8 @@ class AutoNewWindowsUser(AutoNewUser):
|
|||
self.username,
|
||||
".", # Use current domain.
|
||||
self.password,
|
||||
win32con.LOGON32_LOGON_INTERACTIVE,
|
||||
# Logon type - interactive (normal user), since we're using a shell.
|
||||
win32con.LOGON32_LOGON_INTERACTIVE,
|
||||
win32con.LOGON32_PROVIDER_DEFAULT,
|
||||
) # Which logon provider to use - whatever Windows offers.
|
||||
except Exception as err:
|
||||
|
|
|
@ -149,8 +149,8 @@ class Monkey(Document):
|
|||
return {"ips": self.ip_addresses, "hostname": self.hostname}
|
||||
|
||||
@ring.lru(
|
||||
expire=1
|
||||
# data has TTL of 1 second. This is useful for rapid calls for report generation.
|
||||
expire=1
|
||||
)
|
||||
@staticmethod
|
||||
def is_monkey(object_id):
|
||||
|
|
|
@ -37,8 +37,7 @@ class DisplayedEdgeService:
|
|||
displayed_edge["services"] = services
|
||||
displayed_edge["os"] = os
|
||||
# we need to deepcopy all mutable edge properties, because weak-reference link is made
|
||||
# otherwise,
|
||||
# which is destroyed after method is exited and causes an error later.
|
||||
# otherwise, which is destroyed after method is exited and causes an error later.
|
||||
displayed_edge["exploits"] = deepcopy(edge.exploits)
|
||||
displayed_edge["_label"] = edge.get_label()
|
||||
return displayed_edge
|
||||
|
|
Loading…
Reference in New Issue