Courseiva

CEH Web Application and Injection Attacks Practice Question

A penetration tester is using SQLMap to automate exploitation of a SQL injection vulnerability found in a login form. The tester wants to retrieve the names of all databases on the backend MySQL server. Which SQLMap flag should be used?

⚠ Common exam trap

The trap is the close naming between --dbs, --current-db, --tables, and --schema — candidates who have not actually run SQLMap confuse 'list all databases' with 'list tables' or 'show current database', and the exam deliberately places all four as plausible-sounding enumeration flags.

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

✓

--dbs

The --dbs flag in SQLMap instructs the tool to enumerate all databases on the target DBMS. This is the standard first step after confirming an injection point, and it directly answers the tester's goal of retrieving database names. It works against MySQL, MSSQL, Oracle, PostgreSQL, and others.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    --dbs

    Why this is correct

    The --dbs option is the correct command-line switch in sqlmap for enumerating and displaying the names of all available databases on the target database management system (DBMS) server. It leverages identified SQL injection vulnerabilities to extract this high-level structural information, providing a foundational understanding of the server's data organization. This is a crucial initial step in reconnaissance for a penetration tester, revealing the scope of potential data stores.

  • ✗

    --current-db

    Why it's wrong here

    The --current-db option in sqlmap is specifically used to retrieve the name of the database that the web application is currently connected to and interacting with. It does not enumerate or list all other databases present on the server, thus failing to provide a comprehensive overview of the entire DBMS landscape. This command focuses on the immediate context of the application's connection rather than broader discovery of all available databases.

  • ✗

    --schema

    Why it's wrong here

    The --schema option is employed to dump the entire database schema, which includes not only database names but also detailed information about tables, columns, their data types, and relationships within the specified database(s). This command provides a much more granular and extensive output than merely listing database names, making it too broad for the specific task of just listing databases. It's typically used for deeper enumeration after initial database discovery.

  • ✗

    --tables

    Why it's wrong here

    The --tables option is used to enumerate and list all tables that exist within a *specific* database, which must typically be identified beforehand using other commands like --dbs. This command operates at a lower level of granularity than listing databases, focusing on the contents of an already selected database rather than discovering the top-level database containers themselves. It requires prior knowledge or discovery of a database name to function effectively.

Visual reference

Source Router + ACL permit 10.0.0.0/8 deny any Server 10.0.0.5 ✓ 192.168.1.1 ✗ dropped ACLs evaluate top-down; first match wins — implicit deny all at end

About these practice questions

One of 913 original CEH practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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 EC-Council exam blueprint

This CEH practice question is part of Courseiva's free EC-Council 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 CEH exam.