An incident response team discovers that an attacker uploaded a malicious script disguised as an image file to a public web application's uploads directory. The web server process subsequently executed the script, providing the attacker with an interactive remote command shell. Investigation reveals that the file upload folder resides on a standard file system volume where the web daemon user account has both write and execute permissions. Which of the following host hardening practices is the MOST effective mitigation strategy to prevent web shell execution from this directory?
- ADeploy an inline network intrusion prevention system to inspect inbound HTTP POST requests for script execution syntax.
- Mount the upload directory on a dedicated partition configured with noexec flags and restrict script engine execution rights for the web daemon.Answer
- CDeploy production honeypots within the web server subnet to capture and neutralize malicious file upload payloads before they reach storage.
- DConfigure perimeter firewalls to restrict inbound HTTP access to trusted client IP address ranges for the application upload endpoint.
Answer
Mounting the upload storage directory with no-execute flags and restricting web service account permissions is the most effective host hardening control.
The correct response highlights the practice of mounting user-writable directories (such as upload folders) with no-execute flags and restricting web service daemon execution rights. This directly mitigates web shell threats by ensuring that even if a file is uploaded, the operating system kernel and web application server will refuse to execute it as code.
Step-by-Step Solution
Key Concept
Host Hardening and Directory Execution Restriction
Estimated Time:1m 30s