- A
Parse the binary log files using mysqlbinlog to extract all statements from the relevant time period
Binary logs contain historical SQL statements including SELECT INTO OUTFILE.
- B
Analyze the general log file using grep and tail to search for SELECT INTO OUTFILE
Why wrong: The general log only contains entries from the last hour; the event occurred 3 hours ago.
- C
Examine the InnoDB redo log files to find the SELECT INTO OUTFILE command
Why wrong: Redo logs do not record SELECT statements.
- D
Enable MySQL audit logging and wait for the activity to reoccur
Why wrong: The event already happened; waiting will not recover past evidence.
Quick Answer
The correct answer is to parse the binary log files using mysqlbinlog to extract all statements from the relevant time period. This is because the MySQL binary log captures every data-changing statement—including SELECT INTO OUTFILE—as a persistent, sequential record, unlike the general log which is a rotating text file that can be truncated. In this scenario, the general log only covers the last hour, but the binary log files (binlog.000001 through binlog.000005) retain the full history of DDL and DML operations, making them the only reliable source for recovering the exfiltration command that occurred three hours ago. On the CHFI exam, this question tests your understanding of forensic artifact persistence: binary logs are append-only and survive log rotation, while general logs are often overwritten. A common trap is assuming the general log is sufficient, but binary logs are the definitive source for MySQL data exfiltration detection. Memory tip: “Binlogs don’t bin the past—they keep every write.”
CHFI Database and Application Forensics Practice Question
This CHFI practice question tests your understanding of database and application forensics. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You are investigating a suspected data exfiltration incident at a financial institution. The database is MySQL 8.0 running on Linux. The security team suspects that a user with administrative privileges exported sensitive customer records via SELECT INTO OUTFILE and then deleted the output file. The MySQL general log is enabled and located at /var/log/mysql/mysql.log. However, the log file appears to be truncated and only contains entries from the last hour. The binary log is also enabled, and the binary log files are stored in /var/lib/mysql/binlog.000001 through binlog.000005. The database is actively being used. Which of the following is the BEST course of action to recover evidence of the SELECT INTO OUTFILE command that may have occurred 3 hours ago?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"best"Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.
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
Parse the binary log files using mysqlbinlog to extract all statements from the relevant time period
The binary log records all data-changing statements (including DDL and DML) and is not truncated like the general log. Since the incident occurred 3 hours ago and the general log only covers the last hour, the binary log files (binlog.000001–000005) are the only persistent record. Using mysqlbinlog to parse these files can recover the SELECT INTO OUTFILE statement from the relevant time period, even if the output file was deleted.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Parse the binary log files using mysqlbinlog to extract all statements from the relevant time period
Why this is correct
Binary logs contain historical SQL statements including SELECT INTO OUTFILE.
Clue confirmation
The clue word "best" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Analyze the general log file using grep and tail to search for SELECT INTO OUTFILE
Why it's wrong here
The general log only contains entries from the last hour; the event occurred 3 hours ago.
- ✗
Examine the InnoDB redo log files to find the SELECT INTO OUTFILE command
Why it's wrong here
Redo logs do not record SELECT statements.
- ✗
Enable MySQL audit logging and wait for the activity to reoccur
Why it's wrong here
The event already happened; waiting will not recover past evidence.
Common exam traps
Common exam trap: answer the scenario, not the keyword
EC-Council often tests the misconception that the general log is the primary source for all SQL statements, but here the trap is that candidates overlook the binary log's persistence and time-range filtering capability, assuming only the general log can capture SELECT INTO OUTFILE.
Detailed technical explanation
How to think about this question
MySQL binary logs are sequential files that record every statement or row change (depending on binlog_format) that modifies data. The mysqlbinlog utility can convert binary log events into readable SQL, and with --start-datetime and --stop-datetime options, you can precisely filter for the 3-hour-old window. Note that SELECT INTO OUTFILE is a non-logging statement in statement-based replication (it writes to the server's filesystem, not the binary log) unless the binlog_format is set to ROW or MIXED and the statement actually modifies data; however, in MySQL 8.0 with default settings, SELECT INTO OUTFILE is not written to the binary log because it does not change database state, so this question assumes a misconfiguration or that the command was part of a transaction that also modified data, or that the binary log captured it due to a trigger or stored procedure—this nuance is a common real-world pitfall.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A junior network technician can log in to a core router but cannot reach the enable prompt or configuration mode. The AAA server is authenticating the login — but the authorisation policy only grants privilege level 1, not 15. Authentication (who you are) is working; authorisation (what you can do) is not.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Database and Application Forensics — study guide chapter
Learn the concepts, then practise the questions
- →
Database and Application Forensics practice questions
Targeted practice on this topic area only
- →
All CHFI questions
1,000 questions across all exam domains
- →
Computer Hacking Forensic Investigator CHFI study guide
Full concept coverage aligned to exam objectives
- →
CHFI practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related CHFI practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Computer Forensics Investigation Process practice questions
Practise CHFI questions linked to Computer Forensics Investigation Process.
Computer Forensics Fundamentals and Process practice questions
Practise CHFI questions linked to Computer Forensics Fundamentals and Process.
Storage Forensics and File System Analysis practice questions
Practise CHFI questions linked to Storage Forensics and File System Analysis.
Incident Response and First Responder Skills practice questions
Practise CHFI questions linked to Incident Response and First Responder Skills.
Computer Forensics Lab practice questions
Practise CHFI questions linked to Computer Forensics Lab.
Evidence Acquisition and Duplication practice questions
Practise CHFI questions linked to Evidence Acquisition and Duplication.
OS and Network Forensics practice questions
Practise CHFI questions linked to OS and Network Forensics.
OS and File System Forensics practice questions
Practise CHFI questions linked to OS and File System Forensics.
Application, Email and Cloud Forensics practice questions
Practise CHFI questions linked to Application, Email and Cloud Forensics.
Mobile and Malware Forensics practice questions
Practise CHFI questions linked to Mobile and Malware Forensics.
Network and Cloud Forensics practice questions
Practise CHFI questions linked to Network and Cloud Forensics.
Database and Application Forensics practice questions
Practise CHFI questions linked to Database and Application Forensics.
Practice this exam
Start a free CHFI practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this CHFI question test?
Database and Application Forensics — This question tests Database and Application Forensics — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Parse the binary log files using mysqlbinlog to extract all statements from the relevant time period — The binary log records all data-changing statements (including DDL and DML) and is not truncated like the general log. Since the incident occurred 3 hours ago and the general log only covers the last hour, the binary log files (binlog.000001–000005) are the only persistent record. Using mysqlbinlog to parse these files can recover the SELECT INTO OUTFILE statement from the relevant time period, even if the output file was deleted.
What should I do if I get this CHFI question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways this is tested on CHFI
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. During a database forensic investigation, an analyst recovers a MySQL binary log file (binlog.000012) from a compromised server. Which command should the analyst use to extract the actual SQL statements from this binary log in a human-readable format?
medium- A.mysqldump --binlog binlog.000012
- B.mysqlimport --binlog binlog.000012
- C.mysqlcheck --binlog binlog.000012
- ✓ D.mysqlbinlog binlog.000012
Why D: The `mysqlbinlog` utility is specifically designed to parse MySQL binary log files and output the contained SQL statements in a human-readable format. Binary logs record all data-changing operations (e.g., INSERT, UPDATE, DELETE) in a proprietary binary format, so only `mysqlbinlog` can decode them back into readable SQL for forensic analysis.
Variation 2. Refer to the exhibit. An analyst recovers this binary log entry from a MySQL server. What does the timestamp '190101 10:00:00' represent?
medium- ✓ A.The time the DELETE statement was executed on the MySQL server
- B.The time the client sent the query to the server
- C.The time the binary log file was written to disk
- D.The time the transaction was committed
Why A: In MySQL binary logs, the timestamp in the 'Query' event header (e.g., '190101 10:00:00') records the server's local time when the statement began executing. This is the time the DELETE statement was actually processed by the MySQL server, not when the client sent it or when the log was written. The binary log captures the exact moment the server starts executing the query, making option A correct.
Variation 3. During a database forensic investigation, an analyst discovers that multiple rows in a MySQL table have been deleted. The binary logs are enabled. Which approach should the analyst use to recover the deleted data?
medium- A.Restore the transaction log files from backup and mount them to recover the deleted rows.
- B.Use the 'SHOW UNDO' command to retrieve the deleted rows from undo tablespace.
- C.Query the information_schema database to retrieve deleted rows from the data dictionary.
- ✓ D.Parse the binary logs using mysqlbinlog to extract the DELETE statements and reconstruct the lost data.
Why D: MySQL binary logs record all changes to the database, including DELETE statements. The mysqlbinlog utility can parse these logs to reconstruct the exact DELETE operations, allowing the analyst to reverse-engineer the deleted rows by extracting the row data from the log events. This is the standard forensic method for recovering deleted data when binary logging is enabled.
Last reviewed: Jun 30, 2026
This CHFI 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 CHFI exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.