Added catch all warning to remove added groups

This commit is contained in:
RadioLogic 2023-08-30 12:15:00 -04:00
parent 8497699d53
commit e026791905
No known key found for this signature in database
GPG Key ID: 81A957719EEACEDA
1 changed files with 4 additions and 0 deletions

View File

@ -302,5 +302,9 @@ class MetasploitModule < Msf::Post
append_file('/etc/sudoers', "#{datastore['USERNAME']} ALL=(ALL:ALL) NOPASSWD: ALL\n")
print_good("Added [#{datastore['USERNAME']}] to /etc/sudoers successfully")
end
rescue Msf::Exploit::Failed
print_warning("The module has failed to add the new user [#{datastore['USERNAME']}]!")
print_warning('Groups that were created need to be removed from the system manually.')
raise
end
end