OWASP Top 10 - looking glass

CHALLENGE DESCRIPTION

We’ve built the most secure networking tool in the market, come and check it out!

Introduction to Command Injection

Command injection is a security vulnerability that arises when an application does not properly validate user inputs before executing them as commands. Attackers can exploit this vulnerability to inject malicious commands, leading to unauthorized execution of arbitrary code.

Analysis

On this first challenge we start with a webpage that allow us to use the ping command.

Exploit

We’ll leverage the semicolon (;) to inject additional commands and exploit the system.

1
ping 127.0.0.1;id

Sometimes, the server’s response might be delayed due to multiple ICMP requests. To counter this, the attacker can utilize the -c flag to limit the number of ICMP requests sent:

1
ping -c 1 127.0.0.1;id

The -c 1 argument instructs the ping command to send only one ICMP request.

Now ou are able to replace the command id by the command ls to display the location of the flag and cat to display it.