forked from p34709852/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)
|
super(CommunicateAsNewUser, self).__init__(name=POST_BREACH_COMMUNICATE_AS_NEW_USER)
|
||||||
|
|
||||||
def run(self):
|
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():
|
if is_windows_os():
|
||||||
self.communicate_as_new_user_windows(username)
|
self.communicate_as_new_user_windows(username)
|
||||||
else:
|
else:
|
||||||
self.communicate_as_new_user_linux(username)
|
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):
|
def communicate_as_new_user_linux(self, username):
|
||||||
try:
|
try:
|
||||||
# add user + ping
|
# add user + ping
|
||||||
|
|
Loading…
Reference in New Issue