My First Blog CTF Challenge Writeup
Challenge Information
- Name: My First Blog
- Points: 1
- Category: Web
- Objective: Exploit an SQL injection vulnerability to retrieve admin credentials and obtain the flag.
Solution
To solve the “My First Blog” challenge, follow these steps:
Identifying the Vulnerability:
- The challenge hints at an SQL injection vulnerability.
- Direct use of SQLmap is not possible, so manual enumeration is necessary.
Initial Enumeration:
Perform basic enumeration to identify potential SQL errors and found that it might be an SQLite database
SQL Injection Exploration:
Test for SQL injection vulnerabilities by injecting payloads into input fields or URL parameters.
Use basic UNION-based SQL injection techniques to determine the number of columns in the SQL queries.
Finding Tables:
Once the number of columns is identified, proceed with UNION-based queries to list tables.
Identify a table named
users
.
Enumerating Columns:
Enumerate the columns in the
users
table to find useful information.Identify columns such as
id
,username
,password
,email
, androle
.
Retrieving Admin Credentials:
- Extract the credentials of the admin user from the
users
table. - Use SQL injection to retrieve and view the admin credentials.
- Extract the credentials of the admin user from the
Flag Retrieval:
Submit the retrieved admin credentials as the flag in the format
FSIIECTF{XXXXXXXXXX}
.