GSLC · Question #256
John works as a professional Ethical Hacker. He has been assigned a project to test the security server. The output of the scanning test is as follows: C:\whisker.pl -h target_IP_address - = - = = Hos
The correct answer is A. The countermeasure to 'printenv' vulnerability is to remove the CGI script. C. This vulnerability helps in a cross site scripting attack. D. With the help of 'printenv' vulnerability, an attacker can input specially crafted links and/or other. The Apache 'printenv' CGI script exposes server environment variables and can be abused for cross-site scripting and malicious link injection, making removal the primary remediation.
Question
John works as a professional Ethical Hacker. He has been assigned a project to test the security server. The output of the scanning test is as follows:
C:\whisker.pl -h target_IP_address
- = - =
= Host: target_IP_address = Server: Apache/1.3.12 (Win32) ApacheJServ/1.1 mod_ssl/2.6.4 OpenSSL/0.9.5a mod_perl/1.22 + 200 OK: HEAD /cgi-bin/printenv John recognizes /cgi-bin/printenv vulnerability ('Printenv' vulnerability) in the We_are_secure server. Which of the following statements about 'Printenv' vulnerability are true? Each correct answer represents a complete solution. Choose all that apply.
Options
- AThe countermeasure to 'printenv' vulnerability is to remove the CGI script.
- B'Printenv' vulnerability maintains a log file of user activities on the Website, which may be useful for the
- CThis vulnerability helps in a cross site scripting attack.
- DWith the help of 'printenv' vulnerability, an attacker can input specially crafted links and/or other
How the community answered
(37 responses)- A84% (31)
- B16% (6)
Why each option
The Apache 'printenv' CGI script exposes server environment variables and can be abused for cross-site scripting and malicious link injection, making removal the primary remediation.
Since printenv is an example CGI script included with Apache for demonstration purposes and serves no production function, removing it from the cgi-bin directory eliminates the attack surface entirely and is the recommended remediation. Leaving demonstration CGI scripts in production environments is a well-known misconfiguration vulnerability.
The printenv script does not maintain or generate log files of user activity - it simply outputs current environment variables and query parameters to the browser response, so this statement is factually incorrect.
Because printenv echoes user-supplied query string parameters and environment variables directly into its HTML output without sanitization, an attacker can inject malicious scripts via the URL, enabling reflected cross-site scripting attacks against users who click crafted links.
An attacker can craft URLs with malicious input in the query string that printenv reflects back in the response, allowing injection of arbitrary HTML or script content into the page rendered by a victim's browser.
Concept tested: Apache printenv CGI misconfiguration and XSS vulnerability
Source: https://httpd.apache.org/docs/2.4/cgi-bin/
Topics
Community Discussion
No community discussion yet for this question.