Agent: Modify modify shell startup files PBA to return PostBreachData

This commit is contained in:
Shreya Malviya 2022-03-28 13:56:18 +05:30 committed by vakarisz
parent 29d40f8e9d
commit 8418a5ce77
1 changed files with 4 additions and 2 deletions

View File

@ -1,11 +1,11 @@
import subprocess import subprocess
from common.common_consts.post_breach_consts import POST_BREACH_SHELL_STARTUP_FILE_MODIFICATION from common.common_consts.post_breach_consts import POST_BREACH_SHELL_STARTUP_FILE_MODIFICATION
from infection_monkey.i_puppet.i_puppet import PostBreachData
from infection_monkey.post_breach.pba import PBA from infection_monkey.post_breach.pba import PBA
from infection_monkey.post_breach.shell_startup_files.shell_startup_files_modification import ( from infection_monkey.post_breach.shell_startup_files.shell_startup_files_modification import (
get_commands_to_modify_shell_startup_files, get_commands_to_modify_shell_startup_files,
) )
from infection_monkey.telemetry.post_breach_telem import PostBreachTelem
class ModifyShellStartupFiles(PBA): class ModifyShellStartupFiles(PBA):
@ -27,7 +27,9 @@ class ModifyShellStartupFiles(PBA):
False, False,
) )
] ]
PostBreachTelem(self, results).send() # `command` is empty here since multiple commands were run and the results
# were aggregated to send the telemetry just once
return PostBreachData(self.name, "", results).send()
def modify_shell_startup_PBA_list(self): def modify_shell_startup_PBA_list(self):
return self.ShellStartupPBAGenerator().get_modify_shell_startup_pbas() return self.ShellStartupPBAGenerator().get_modify_shell_startup_pbas()