312-39 practice question 3 of 35
Which of the following attack can be eradicated by disabling of "allow_url_fopen and allow_url_include" in the php.ini file?
Full set: 100 questionsDisabling the allowurlfopen and allowurlinclude directives in the php.ini configuration file is a critical security measure against Remote File Inclusion (RFI) attacks. RFI is a specific type of File Injection vulnerability where an attacker causes the web application to fetch and execute a malicious file from a remote URL. By setting these directives to Off, PHP is prevented from treating URLs as files for inclusion or file-opening operations, thus directly mitigating the RFI threat vector.
B. URL Injection Attacks: This is a broader term. These settings specifically prevent file inclusion from URLs, not all forms of URL manipulation or redirection attacks.
C. LDAP Injection Attacks: This attack targets applications querying LDAP directories. It is unrelated to PHP's file handling capabilities and is mitigated by input validation.
D. Command Injection Attacks: This involves executing OS commands through a vulnerable application. It is a separate vulnerability class not directly prevented by these specific PHP directives.
1. PHP. (n.d.). Description of core php.ini directives. PHP: The PHP Documentation. Retrieved from https://www.php.net/manual/en/ini.core.php. See descriptions for allowurlfopen and allowurlinclude.
2. OWASP Foundation. (n.d.). File Inclusion. OWASP Cheat Sheet Series. Retrieved from https://cheatsheetseries.owasp.org/cheatsheets/FileInclusionCheatSheet.html. (Note: While OWASP is a non-profit, its publications are widely adopted as de facto standards and referenced in academic and official contexts for cybersecurity principles). Section "Remote File Inclusion (RFI)" explains the vulnerability mitigated by these settings.
Question breakdown
Key idea: Disabling allow_url_fopen and allow_url_include stops PHP from opening or including remote files, which mitigates remote file inclusion (file injection) attacks.
How to reach the answer
- The clue is the two php.ini directives, both of which govern how PHP treats URLs as files.
- allow_url_include lets include and require pull in remote code, which is the core of remote file inclusion.
- Turning both off prevents attacker-supplied URLs from being loaded as executable files.
- LDAP and command injection are unrelated to file-opening settings, and 'URL injection' is not the category these directives address.
Each option
Common trap: The 'url' in the directive names tempts candidates to choose URL Injection Attacks.
In practice: PHP hardening baselines set allow_url_include=Off, and often allow_url_fopen=Off, to block remote file inclusion web shells. Analysts check for these settings after RFI alerts.
Remember: allow_url_fopen and allow_url_include settings relate to file inclusion/injection attacks.
Drafted with AI assistance and checked against the answer key.
Keep practicing
Take the free 312-39 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 312-39 practice questions
- Question 1What type of event is recorded when an application driver loads successfully in Windows?
- Question 2Wesley is an incident handler in a company named Maddison Tech. One day, he was learning …
- Question 4Which of the following technique protects from flooding attacks originated from the valid…
- Question 5John, SOC analyst wants to monitor the attempt of process creation activities from any of…
- Question 6Mike is an incident handler for PNP Infosystems Inc. One day, there was a ticket raised r…
- Question 7Which of the following is a set of standard guidelines for ongoing development, enhanceme…
