Docsity

Teel Technologies SQLite Forensic Exam, Exams of Technology

Toggle sidebar
bg1
Teel Technologies SQLite Forensic Exam
**Question 1.** Which of the following byte sequences identifies the SQLite magic header at the
beginning of every database file?
A) 0x53 0x51 0x4C 0x69
B) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x66
C) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20
D) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20 0x20
**Answer:** C
**Explanation:** The first 16 bytes of a SQLite file contain the ASCII string “SQLite format 3\000”. The
first 8 bytes are “SQLite ” (0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20).
**Question 2.** In the SQLite file header, which two‑byte field specifies the size of a database page?
A) Bytes 16‑17
B) Bytes 18‑19
C) Bytes 20‑21
D) Bytes 22‑23
**Answer:** B
**Explanation:** Bytes 16‑17 of the header store the page size as a big‑endian 16‑bit integer. Typical
values are 1024, 4096, etc.
**Question 3.** What does a value of 0xFFFFFFFF in the “File Change Counter” field of the header
indicate?
A) The database is read‑only
B) No changes have ever been made
C) The counter has overflowed
D) The database is corrupted
**Answer:** C
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58

Partial preview of the text

Download Teel Technologies SQLite Forensic Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which of the following byte sequences identifies the SQLite magic header at the beginning of every database file? A) 0x53 0x51 0x4C 0x B) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x C) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x D) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20 0x Answer: C Explanation: The first 16 bytes of a SQLite file contain the ASCII string “SQLite format 3\000”. The first 8 bytes are “SQLite ” (0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20). Question 2. In the SQLite file header, which two‑byte field specifies the size of a database page? A) Bytes 16‑ 17 B) Bytes 18‑ 19 C) Bytes 20‑ 21 D) Bytes 22‑ 23 Answer: B Explanation: Bytes 16‑17 of the header store the page size as a big‑endian 16‑bit integer. Typical values are 1024, 4096, etc. Question 3. What does a value of 0xFFFFFFFF in the “File Change Counter” field of the header indicate? A) The database is read‑only B) No changes have ever been made C) The counter has overflowed D) The database is corrupted Answer: C

Explanation: The change counter increments with each commit; when it exceeds the maximum 32 ‑bit value it wraps to 0xFFFFFFFF, signalling overflow. Question 4. Which SQLite page type stores only key/value cells and never has child pointers? A) Interior B‑tree page B) Leaf B‑tree page C) Overflow page D) Freelist page Answer: B Explanation: Leaf pages contain the actual table or index entries and have no child page numbers. Question 5. In a B‑tree index page, what does the “payload size” field of a cell represent? A) Length of the key only B) Length of the rowid only C) Combined size of the key and the rowid D) Size of the overflow data pointer Answer: C Explanation: Index cells store the key (indexed column) plus the rowid that points back to the table row; the payload size covers both. Question 6. Which SQLite version introduced the “WAL” (Write‑Ahead Logging) mode? A) 2. B) 3. C) 3. D) 3. Answer: C

Answer: A Explanation: SQLite supports “LIMIT n OFFSET m”. “LIMIT 10 OFFSET 0” returns the first ten rows. Question 10. Which operator allows pattern matching of any number of characters in a WHERE clause? A) % B) * C)? D) # Answer: A Explanation: In SQLite’s LIKE operator, ‘%’ matches zero or more characters. Question 11. Which of the following expressions evaluates to TRUE for rows where column x is either 5, 7, or 9? A) x = 5 OR 7 OR 9 B) x IN (5,7,9) C) x BETWEEN 5 AND 9 D) x LIKE ‘[5,7,9]’ Answer: B Explanation: The IN operator checks membership against a list of values. Question 12. To group rows by a column and calculate the total of another column, which clause must appear after GROUP BY? A) HAVING B) ORDER BY C) WHERE

D) LIMIT

Answer: A Explanation: HAVING filters aggregated groups and must follow GROUP BY. Question 13. Which aggregate function returns the maximum value of a numeric column? A) MAX() B) BIGGEST() C) HIGH() D) TOP() Answer: A Explanation: MAX() is the standard SQLite aggregate for the largest value. Question 14. In a relational join, which keyword specifies that all rows from the left table must appear, even if there is no matching row on the right? A) INNER B) LEFT OUTER C) CROSS D) NATURAL Answer: B Explanation: LEFT OUTER JOIN (or simply LEFT JOIN) preserves all left‑table rows. Question 15. Which join type produces a Cartesian product of two tables? A) INNER JOIN B) LEFT JOIN C) CROSS JOIN

D) 1601‑ 01 ‑ 01

Answer: B Explanation: Cocoa/Apple timestamps count seconds since 2001‑ 01 ‑01 00:00:00 UTC. Question 19. In Chrome’s “WebKit” timestamp format, the unit is: A) Seconds B) Milliseconds C) Microseconds D) Nanoseconds Answer: B Explanation: WebKit timestamps store milliseconds since 1601‑ 01 ‑01. Question 20. Which SQLite function extracts a substring starting at position 3 with length 5? A) substr(column,3,5) B) substring(column,3,5) C) mid(column,3,5) D) left(column,5) Answer: A Explanation: SQLite’s substr(X,Y,Z) returns Z characters beginning at offset Y (1‑based). Question 21. To remove leading and trailing spaces from a text column, which function is used? A) trim() B) strip() C) ltrim() only D) rtrim() only

Answer: A Explanation: trim() removes both leading and trailing whitespace. Question 22. Which CASE expression correctly maps a numeric status column (0 = Unread, 1 = Read) to text? A) CASE status WHEN 0 THEN ‘Unread’ WHEN 1 THEN ‘Read’ END B) CASE WHEN status = 0 THEN ‘Unread’ WHEN status = 1 THEN ‘Read’ END C) Both A and B are valid D) Neither A nor B are valid Answer: C Explanation: SQLite supports both simple CASE and searched CASE syntaxes. Question 23. The purpose of the -journal file in rollback mode is to: A) Store all committed transactions permanently B) Hold pages that are being written before the commit completes C) Keep a copy of the entire database for backup D) Record only schema changes Answer: B Explanation: The rollback journal contains “hot” pages that have been modified but not yet committed, enabling rollback on failure. Question 24. In WAL mode, which file contains the shared‑memory map used for coordinating readers and writers? A) database‑wal B) database‑shm C) database‑journal

C) Transaction logs from the WAL file D) Encryption keys Answer: B Explanation: Deleted rows leave their payload in freeblocks or unallocated space until overwritten. Question 28. Which of the following best describes an “overflow page” in SQLite? A) A page that contains the B‑tree root B) A page that stores large column values which do not fit on the original leaf page C) A page that holds the journal data D) A page used exclusively for freeblock tracking Answer: B Explanation: When a cell’s payload exceeds the space on its leaf page, the excess is stored on overflow pages chained together. Question 29. In Android’s sms.db, which table typically stores the actual text messages? A) messages B) sms C) conversations D) threads Answer: B Explanation: The sms table holds each SMS record; the threads table manages conversation grouping. Question 30. Which column in iOS CallHistory.db indicates whether a call was incoming, outgoing, or missed? A) direction

B) type C) flags D) status Answer: B Explanation: The type column uses numeric codes (1 = incoming, 2 = outgoing, 3 = missed). Question 31. Chromium’s History database stores URLs in which table? A) urls B) visits C) downloads D) favicons Answer: A Explanation: The urls table contains each distinct URL with metadata; the visits table links timestamps to URLs. Question 32. To retrieve the most recent 5 Chrome history entries, which ORDER BY clause is appropriate? A) ORDER BY last_visit_time ASC B) ORDER BY last_visit_time DESC C) ORDER BY url ASC D) ORDER BY title DESC Answer: B Explanation: DESC sorts from newest to oldest; combined with LIMIT 5 yields the latest entries. Question 33. Which SQLite function can be used to convert a Chromium WebKit timestamp to a readable date?

Question 36. When a row is deleted, SQLite may leave a “pointer map” entry. What does this map point to? A) The location of the deleted row’s payload in the freeblock list B) The parent page of the deleted cell C) The overflow page chain start D) The next free page number Answer: D Explanation: In WAL mode, the pointer map tracks free pages for reuse; a deleted page’s entry points to the next free page. Question 37. Which SQLite keyword is used to rename a column without altering the data? A) ALTER TABLE … RENAME COLUMN … TO … B) MODIFY COLUMN … C) CHANGE COLUMN … D) UPDATE COLUMN NAME … Answer: A Explanation: SQLite supports ALTER TABLE … RENAME COLUMN … TO … syntax. Question 38. The sqlite_sequence table is automatically created when which feature is used? A) WITHOUT ROWID tables B) AUTOINCREMENT primary key C) Triggers D) Virtual tables Answer: B Explanation: AUTOINCREMENT creates sqlite_sequence to keep track of the largest ROWID.

Question 39. Which of the following statements about SQLite’s “WITHOUT ROWID” tables is true? A) They store the primary key in the B‑tree leaf payload instead of a hidden ROWID column B) They cannot have any indexes C) They are always stored in a separate file D) They require the use of the WAL journal mode Answer: A Explanation: WITHOUT ROWID tables use the primary key as the B‑tree key, eliminating the hidden ROWID. Question 40. In forensic analysis, why is it important to examine the -shm file when a database is in WAL mode? A) It contains encrypted copies of the database pages B) It holds the lock table that reveals concurrent reader/writer activity C) It stores the entire transaction log for the last 24 hours D) It lists all deleted rows explicitly Answer: B Explanation: The - shm file includes the shared‑memory lock table, which can show whether readers were active while a write occurred. Question 41. Which SQLite function can be used to concatenate two text strings? A) concat() B) || (double pipe) operator C) join() D) plus() Answer: B Explanation: The || operator concatenates strings in SQLite.

Question 45. In SQLite, which data type affinity will store a numeric value as text if the value cannot be losslessly represented as an integer or real? A) INTEGER B) REAL C) NUMERIC D) TEXT Answer: C Explanation: NUMERIC affinity attempts to store as INTEGER or REAL; if conversion fails, it stores the original text. Question 46. Which SQLite function can be used to test whether a column contains a JSON object? A) json_valid() B) json_is_object() C) is_json() D) json_check() Answer: A Explanation: json_valid() returns 1 if the argument is well‑formed JSON. Question 47. When a B‑tree leaf page becomes empty after deletions, SQLite may perform which operation? A) Page splitting B) Page merging (coalescing) with a sibling C) Page promotion to the root D) Page reallocation to the freelist only after a checkpoint Answer: B

Explanation: SQLite merges underfull leaf pages with neighboring siblings to maintain balance. Question 48. Which pragma returns the current schema version number stored in the database header? A) PRAGMA schema_version; B) PRAGMA user_version; C) PRAGMA database_version; D) PRAGMA file_version; Answer: A Explanation: PRAGMA schema_version reports the version stored in the header, incremented by ALTER statements. Question 49. The user_version pragma is typically used by applications to: A) Store the SQLite engine version B) Record a custom version number for the application’s data model C) Indicate the number of active connections D) Track the number of WAL checkpoints performed Answer: B Explanation: Applications set PRAGMA user_version to embed their own schema version. Question 50. In a forensic timeline, why is it important to convert timestamps from the Cocoa epoch to UTC? A) Cocoa timestamps are stored in local time, causing ambiguity across time zones B) Converting to UTC normalizes data from multiple devices for correlation C) SQLite cannot compare Cocoa timestamps without conversion D) Cocoa timestamps include daylight‑saving offsets automatically

D) PRAGMA db_info; Answer: A Explanation: PRAGMA database_list returns name, file, and other info for each attached DB. Question 54. In a forensic context, why might an investigator examine the sqlite_stat1 table? A) It contains the original CREATE statements B) It holds statistics used by the query planner that can reveal typical query patterns C) It logs every INSERT operation performed on the database D) It stores the list of deleted rows Answer: B Explanation: sqlite_stat1 contains histogram data that can indicate column value distributions, useful for understanding data usage. Question 55. Which of the following best describes a “partial index” in SQLite? A) An index that only includes rows satisfying a WHERE clause B) An index that spans multiple tables C) An index that is stored on overflow pages D) An index that is automatically dropped after a checkpoint Answer: A Explanation: Partial indexes index only rows meeting a specified predicate. Question 56. To retrieve the schema definition of a table named contacts, which query is correct? A) SELECT sql FROM sqlite_master WHERE type='table' AND name='contacts'; B) PRAGMA table_schema('contacts'); C) SELECT * FROM sqlite_schema WHERE tbl_name='contacts';

D) Both A and C (SQLite 3.33+ supports sqlite_schema) Answer: D Explanation: Both sqlite_master and sqlite_schema (an alias) store the CREATE statement. Question 57. Which SQLite function can be used to compute the MD5 hash of a string? A) md5() B) hash_md5() C) There is no built‑in MD5 function; a user‑defined function is required D) crypto_md5() Answer: C Explanation: SQLite does not include MD5; you must load an extension or implement a custom function. Question 58. When a database is opened with the PRAGMA journal_mode = MEMORY, where is the rollback journal stored? A) In a temporary file on disk B) In RAM only, disappearing when the connection closes C) In the - wal file D) In the - shm file Answer: B Explanation: MEMORY mode keeps the journal in volatile memory. Question 59. Which SQLite pragma can be used to set the maximum size of the WAL file before an automatic checkpoint is forced? A) PRAGMA wal_autocheckpoint; B) PRAGMA max_wal_size;