# Persistence

## Windows Persistence

### Metasploit persistence script

```bash
exploit/windows/local/registry_persistence
exploit/windows/local/persistence
run persistence -h
run scheduleme
run schtaskabuse
```

### Manual persistence

Add a user

```powerquery
net user adot8 Password1 /add
net localgroup Administrators adot8 /add
net localgroup "Remote Management Users" adot8 /add
```

## Linux Persistence

Copy and save a copy of the ssh key

```
cat ~/.ssh/id_rsa
```

```
vim copy_id_rsa
chmod 600 copy_id_rsa
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pnpt.adot8.com/post-exploitation/persistence.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
