Body Count
Points 10
Task Description
One of our employees, Jimmie Castora, kept database backups on his computer. DEADFACE compromised his computer and leaked a portion of the database. Can you figure out how many customers are in the database? We want to get ahead of this and inform our customers of the breach.
Submit the flag as flag{#}. For example, flag{12345}.
Getting Flag
Because we was provided with the databasedump, first try was to import the dump into my mariadb-service to use SQL-Queries instead of cat
-ing or sed
-ing around 🙂
But this was a mysql 8.0 dump and because of that, we got some errors about unkown format.
So I changes that encoding to a mariadb friendly one with the following command:
sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' demonne.sql
Now we can import the dump with our prefered technique, I like to use soure
from the mysql prombt.
After that, just count the customer:
select count(cust_id) as NumberOfCustomer from customers;
Further info
I have created a picture of the database structure by using dbeaver, so it is a littlebit easier to get a better understanding for the next tasks 🙂
Ah - I just forgot the Flag:
flag{10000}