Skip to content

Commit

Permalink
Land #12871, fix osx/local/persistence removal commands and payload o…
Browse files Browse the repository at this point in the history
…ptions
  • Loading branch information
timwr committed Jan 28, 2020
2 parents 1b4ce34 + 0b0d4c8 commit d4bd195
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/exploits/osx/local/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def initialize(info={})
'License' => MSF_LICENSE,
'Author' => [ "Marcin 'Icewall' Noga <marcin[at]icewall.pl>", "joev" ],
'Platform' => [ 'osx' ],
'Arch' => [ ARCH_X86, ARCH_X64 ],
'Targets' => [ [ 'Mac OS X', {} ] ],
'DefaultTarget' => 0,
'SessionTypes' => [ 'shell', 'meterpreter' ],
Expand Down Expand Up @@ -120,10 +121,11 @@ def keepalive?
# useful if you want to remove the persistence.
# prints out a list of paths to remove and commands to run.
def list_removal_paths
files = [backdoor_path, plist_path]
print_status("To remove the persistence, run:\n"+
"$ launchctl unload -w #{plist_path.shellescape}\n"+
files.map{|f| "$ rm #{f}"}.join("\n"))
removal_command = "rm -rf #{File.dirname(backdoor_path).shellescape}"
removal_command << " ; rm #{plist_path}"
removal_command << " ; launchctl remove #{File.basename(backdoor_path)}"
removal_command << " ; launchctl stop #{File.basename(backdoor_path)}"
print_status("To remove the persistence, run:\n#{removal_command}\n")
end

# path to the LaunchAgent service configuration plist
Expand Down

0 comments on commit d4bd195

Please sign in to comment.