Objective: Establish a connection to the compromised ByteCorp Database.
We will use an online MySQL compiler to run our forensic queries. Open the link below in a new tab.
Open OneCompiler MySQL ↗Copy the SQL script below. This script reconstructs the corrupted database tables (`employees`, `departments`, `hidden_vault`).
Action: Paste this code into the OneCompiler editor, deleting any existing code there first.
-- 1. Create the Department Table
CREATE TABLE departments (
id INT PRIMARY KEY,
name VARCHAR(50),
floor INT
);
-- 2. Create the Employee Table
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(50),
role VARCHAR(50),
salary INT,
dept_id INT,
hire_date DATE
);
-- 3. Create a "Secrets" Table (The vault)
CREATE TABLE hidden_vault (
id INT PRIMARY KEY,
note VARCHAR(255),
code_fragment VARCHAR(50)
);
-- INSERT DATA
INSERT INTO departments VALUES (1, 'Engineering', 3), (2, 'HR', 1), (3, 'Cafeteria', 1);
INSERT INTO employees VALUES
(101, 'Alice Queeery', 'Engineer', 70000, 1, '2020-01-15'),
(102, 'Bob DROP TABLE', 'Intern', 0, 1, '2023-05-20'),
(103, 'Karen Select', 'Manager', 95000, 2, '2019-03-10'),
(104, 'Dave Null', 'Janitor', 40000, 3, '2015-08-01');
INSERT INTO hidden_vault VALUES
(1, 'Password Hint', 'CTF{Basic_'),
(2, 'Backup Loc', 'SQL_Is_'),
(3, 'Launch Code', 'Fun_123}');
-- Create a hidden flag in a specific row for the "Where" challenge
INSERT INTO employees VALUES (999, 'CTF_Bot', 'Spy', 1000000, 1, '2024-01-01');
-- ==========================================
-- ⬇️ WRITE YOUR SOLUTION QUERIES BELOW HERE ⬇️
-- ==========================================
-- Example:
-- SELECT * FROM employees;
In OneCompiler, the environment resets every time you click "Run".
Environment configured? Good luck, Detective.
ENTER SYSTEM (START CTF)