GCIH Web App Injection Attacks Practice Question
During incident response at a financial firm, an analyst discovers that a web application's login form is vulnerable to SQL injection. The backend is Microsoft SQL Server, and the application account has sysadmin rights. The attacker's payloads include ; EXEC xp_cmdshell 'whoami' -- and responses show the web server's service account name. Which immediate containment action best limits further damage while preserving evidence?
⚠ Common exam trap
The trap here is treating a full server shutdown as containment, when it actually destroys volatile evidence and does not address the root capability.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Disable the xp_cmdshell extended stored procedure and revoke sysadmin from the application's database login, after capturing relevant logs and database state.
The attacker leveraged sysadmin rights to run xp_cmdshell, achieving OS command execution through SQL injection. The most effective containment is to remove that capability by disabling xp_cmdshell and revoking sysadmin from the application login, while first preserving logs and database state. This stops the specific attack path without destroying evidence, unlike a full shutdown or restore.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Immediately shut down the database server and restore it from the most recent backup.
Why it's wrong here
Shutting down and restoring destroys volatile evidence such as active sessions, memory-resident artifacts, and transaction logs that could reveal the full scope of compromise. It also causes unnecessary downtime. Containment should be targeted; a full restore is a recovery action, not containment, and should follow proper forensic preservation and root-cause remediation.
- ✗
Enable full SQL query logging and wait for the next attack to gather more indicators before taking action.
Why it's wrong here
Waiting allows the attacker to maintain or expand access, potentially exfiltrating data or deploying persistence. While logging is valuable, it is not containment. The immediate priority is to cut off the exploited capability, then continue monitoring with enhanced logging in place. Delaying action after confirmed command execution is an unacceptable risk.
- ✗
Block the attacker's source IP address at the perimeter firewall and continue monitoring.
Why it's wrong here
IP blocking may slow a specific actor but does not remove the vulnerability or the dangerous sysadmin rights. Attackers can pivot through proxies or use other IPs. The observed command execution via xp_cmdshell means the database can already run OS commands; leaving that capability intact is a critical risk that IP filtering alone does not mitigate.
- ✓
Disable the xp_cmdshell extended stored procedure and revoke sysadmin from the application's database login, after capturing relevant logs and database state.
Why this is correct
Removing sysadmin rights and disabling xp_cmdshell directly stops the observed command-execution path while preserving logs and database state for forensics. This containment is surgical: it addresses the exploited capability without destroying evidence. Capturing logs and state first ensures the analyst retains indicators such as the injected queries and any files created by whoami or subsequent commands.
About these practice questions
Courseiva writes every GCIH question from scratch — 322 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official GIAC exam blueprint
This GCIH practice question is part of Courseiva's free GIAC certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GCIH exam.