In this challenge, you’ve discovered a web application that takes user input and executes an OS command on the server without proper validation or sanitization. The application is vulnerable to OS command injection, where user input is directly passed to the operating system’s command shell. Your goal is to exploit this vulnerability to execute arbitrary OS commands and retrieve the flag stored on the server.
You are a penetration tester hired by a company to assess the security of their web application. During your engagement, you have discovered a vulnerable endpoint in the application that processes user-supplied data without proper sanitization. The vulnerability is an OS command injection flaw in a search functionality, and your job is to exploit this vulnerability to retrieve hidden flags embedded within the server. The flags are hidden in the system logs and in environment variables.