Wildcards - Basics
Learnt on TryHackMe's Skynet challenge
Wildcards are symbols or set of symbols which when used in a command can represent a variety of options. For example: * => Asterisk in linux means everything. So, if I were to do " cp * /home/kali/" I would be copying everything in the current directory to /home/kali.
Wildcards are useful as they reduce human effort. Example, using * can reduce the effort of manually typing in every file in the existing directory ot be copied.
Other wildcards: ? => represents each character [] => group of characters ~ => home directory - => A hyphen used within [ ] denotes a range of characters -- => Option flag in various linux tools. Eg: cat --help Reference: https://linuxhint.com/bash_wildcard_tutorial/
IMPORTANT: When wildcards are used within a filename, it is an insecure practice of administration as the usage of wildcards can cause unforeseen errors in routines, jobs and can cause privilege escalation and exploitation too.
Last updated