Make setuid/setgid and trap PBAs not crash on windows

This commit is contained in:
Shreya 2020-07-20 20:09:19 +05:30
parent 55a46baced
commit 28e0a6ec97
2 changed files with 6 additions and 8 deletions

View File

@ -7,7 +7,6 @@ from infection_monkey.utils.environment import is_windows_os
class ChangeSetuidSetgid(PBA): class ChangeSetuidSetgid(PBA):
def __init__(self): def __init__(self):
if not is_windows_os():
linux_cmds = get_commands_to_change_setuid_setgid() linux_cmds = get_commands_to_change_setuid_setgid()
super(ChangeSetuidSetgid, self).__init__(POST_BREACH_SETUID_SETGID, super(ChangeSetuidSetgid, self).__init__(POST_BREACH_SETUID_SETGID,
linux_cmd=' '.join(linux_cmds)) linux_cmd=' '.join(linux_cmds))

View File

@ -7,7 +7,6 @@ from infection_monkey.utils.environment import is_windows_os
class TrapCommand(PBA): class TrapCommand(PBA):
def __init__(self): def __init__(self):
if not is_windows_os():
linux_cmds = get_trap_commands() linux_cmds = get_trap_commands()
super(TrapCommand, self).__init__(POST_BREACH_TRAP_COMMAND, super(TrapCommand, self).__init__(POST_BREACH_TRAP_COMMAND,
linux_cmd=linux_cmds) linux_cmd=linux_cmds)