Jigsaw

Challenge:

We've slowly been piecing together the name of one of DEADFACE's future victims. Here's the information we have:

  • The first two characters of the user's last name begin with K, R, or I.
  • Followed by any character except newline, then three letters
  • Immediately followed by the last letter E-N

Submit the username as the flag: flag{username}
Use the file from Address Book.
Max attempts: 10

Solution:

Again using the database I had created in the Address Book challenge I viewed the columns from the users table to refresh my memory:

mysql> SHOW COLUMNS IN users;
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
+----------+-------------+------+-----+---------+----------------+
| user_id  | int         | NO   | PRI | NULL    | auto_increment |
| username | varchar(52) | NO   | UNI | NULL    |                |
| first    | varchar(52) | NO   |     | NULL    |                |
| last     | varchar(52) | NO   |     | NULL    |                |
| middle   | varchar(24) | YES  |     | NULL    |                |
| email    | varchar(52) | NO   | UNI | NULL    |                |
| street   | varchar(52) | NO   |     | NULL    |                |
| city     | varchar(52) | NO   |     | NULL    |                |
| state_id | int         | NO   | MUL | NULL    |                |
| zip      | varchar(10) | NO   |     | NULL    |                |
| gender   | varchar(8)  | NO   |     | NULL    |                |
| dob      | date        | NO   |     | NULL    |                |
+----------+-------------+------+-----+---------+----------------+

This is a pretty simple SQL query using a regular Expression search against the field named last. Here's a breakdown of my RegExp based on the challenge description:

Requirement RegExp Match
first two characters of the user's last name begin with K, R, or I ^[KRI]{2}
Followed by any character except newline, then three letters .[A-Z]{3}
Immediately followed by the last letter E-N [E-N]$
mysql> select username from users WHERE last REGEXP '^[KRI]{2}.[A-Z]{3}[E-N]$';
+----------------+
| username       |
+----------------+
| image.wa1k3624 |
+----------------+

The completed flag is flag{image.wa1k3624}.

Published:

Updated:

Leave a comment