Wildcard Exploits
Chown & Chmod - Modify execution
Case
Exploitation:
Navigate to the folder
Create a file called drf.ext
Create a file called --reference=.drf.php
When the script is executed it will read the filename specified at point 3 as a parameter and override the owner or permissions specified in the script with the one of the file pointed by the instruction (in this case drf.ext)
Tar - Arbitray command execution
Case
Exploitation:
Navigate to the folder
Create a file called --checkpoint=1
Create a file called --checkpoint-action=exec=sh <cmd or script>
On execution the command specified will be executed. Keep in mind that path separators are forbidden in filenames, as such your script should be in the same folder of the files created previously or in a path defined in your env variables
Rsync - Arbitrary command execution
Case
Exploitation:
Navigate to the target folder
Create a shell script called shell.ext (use shell.sh if the wildcard has no extension specified). Insert in the script any command you wish to execute
Create a new file called -e sh <shell file>
On execution the script created at point 2 is run
7zip - Arbitrary file read
Case (works regardless of the -- operator)
Exploitation:
Navigate to the target folder
Create a file called @list.txt
ln -s <target file> list.txt
Once the command runs the file pointed by the link list.txt will be included in the archive allowing us to read it
Last updated