forked from p15670423/monkey
Extracted user name creation to separate function
This commit is contained in:
parent
889c8a2378
commit
77269fb3ce
|
@ -35,12 +35,16 @@ class CommunicateAsNewUser(PBA):
|
|||
super(CommunicateAsNewUser, self).__init__(name=POST_BREACH_COMMUNICATE_AS_NEW_USER)
|
||||
|
||||
def run(self):
|
||||
username = USERNAME + ''.join(random.choice(string.ascii_lowercase) for _ in range(5))
|
||||
username = self.get_random_new_user_name()
|
||||
if is_windows_os():
|
||||
self.communicate_as_new_user_windows(username)
|
||||
else:
|
||||
self.communicate_as_new_user_linux(username)
|
||||
|
||||
@staticmethod
|
||||
def get_random_new_user_name():
|
||||
return USERNAME + "_" + ''.join(random.choice(string.ascii_lowercase) for _ in range(5))
|
||||
|
||||
def communicate_as_new_user_linux(self, username):
|
||||
try:
|
||||
# add user + ping
|
||||
|
|
Loading…
Reference in New Issue