Forward 9090 to your local machine
ssh -i id_ecdsa -L 9090:127.0.0.1:9090 [email protected]
|
Create malicous logs
Create this file on /tmp/malicious.log on the remote machine:
Create payload.sh
Create this file on /tmp/payload.sh on the remote machine:
Go back to your machine
Create a file named log_service.thrift with the following content:
After creating the thrift file, execute this command to generate the client code:
Then cd gen-py and create this file as client.py:
Install the required dependencies:
Run the client:
Get the flag
After running the client, /bin/bash will be set SUID and you can get root shell by executing /bin/bash -p and then cat /root/root.txt to get the flag.