Challenge Web & API Security +50 XP

Ping Pwn

Start the machine, hack the system, and find the hidden flags to complete this challenge and earn XP!

71% solve it 157 hackers played 1 flag Updated Oct 20, 2026 First blood iamwei
Command InjectionWeb ExploitationService DiscoveryNetwork Security
Start Your Challenge

Launch your dedicated machine to begin hacking

  1. 1Create a free account, then click "Start Lab"You'll get your own private machine with an IP address
  2. 2Explore the targetOpen the IP in your browser and look for vulnerabilities
  3. 3Find and submit flagsFlags are secret text strings hidden in the system - paste them below to score
  • ~1-2 min setup
  • Private instance
  • 30 min per session. Restart it for free, as often as you like.

Command injection is one of the most critical web application vulnerabilities, allowing attackers to execute arbitrary operating system commands on a server through a vulnerable application. This attack occurs when an application passes unsafe user-supplied data to a system shell, and it remains one of the top threats identified by OWASP. A thorough command injection tutorial is essential for any aspiring security professional.

How Command Injection Works

Web applications sometimes need to interact with the underlying operating system - for example, to ping a host, look up DNS records, or process files. When developers use functions like system(), exec(), or os.popen() with user-controlled input, they create an opportunity for command injection. Attackers exploit this by appending shell metacharacters such as semicolons (;), pipes (|), ampersands (&), or backticks (`) to inject additional commands that the server executes alongside the intended operation.

Common Attack Vectors

A typical command injection tutorial scenario involves a network diagnostic tool that lets users ping an IP address. If the application constructs the command by concatenating user input directly into a shell command string, an attacker can input something like 127.0.0.1; cat /etc/passwd to execute an additional command. More sophisticated attacks use encoding tricks, newline characters, or nested command substitution to bypass basic input filters. The severity ranges from information disclosure to complete server compromise.

Real-World Impact and Defense

Command injection vulnerabilities have been discovered in major enterprise applications, network devices, IoT firmware, and cloud management platforms. Notable incidents include attacks against web-connected printers, router administration panels, and server monitoring tools. Proper defense involves never passing user input directly to shell commands, using parameterized APIs instead of shell execution, implementing strict input validation with allowlists, and applying the principle of least privilege to application service accounts.

What You Will Learn

  • Understand how command injection vulnerabilities arise in web applications
  • Learn common shell metacharacters used to chain and inject commands
  • Practice systematic security assessment and reconnaissance techniques
  • Identify unsafe patterns in application code that lead to OS command execution
  • Study defensive measures including input validation and parameterized APIs

Prerequisites

Basic Linux command-line skills Understanding of HTTP and web applications Familiarity with network tools like ping and nmap