Study for the Ethical Hacking Essentials Test. Explore interactive flashcards and multiple-choice questions with hints and explanations. Prepare thoroughly and boost your exam readiness!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What countermeasure assists in defending against SQL injection attacks?

  1. Run services with full rights

  2. Run a database service account with minimal rights

  3. Utilize a VPN

  4. Regularly change database passwords

The correct answer is: Run a database service account with minimal rights

Running a database service account with minimal rights is an effective countermeasure against SQL injection attacks because it limits the potential damage an attacker can cause if they successfully exploit a vulnerability. When a database service operates under a set of minimal privileges, even if an attacker injects malicious SQL code, their access is restricted, preventing them from executing harmful operations such as deleting tables or accessing sensitive data. By employing the principle of least privilege, the service account only has the necessary rights to perform its required tasks. This reduces the attack surface, making it more difficult for malicious actors to gain escalated access to the database's resources. In contrast, running services with full rights exposes the system to greater risk. A VPN provides secure access over the internet, but it does not directly mitigate the risk associated with SQL injection. Regularly changing database passwords can enhance security but does not address the fundamental weaknesses in application code that allow SQL injection to occur in the first place. Therefore, utilizing a database service account with minimal rights stands out as a proactive defense mechanism against potential SQL injection attacks.