Menu

tryhackme-write_up-light-
📰

tryhackme-write_up-light-

DEV Community: infosec·Maiver·10 days ago
#H2WWvQNp
#devtoinfosec#devto#dev#password#name
Long article (349 words) — no AI summary yet.
Reading 0:00
15s threshold

In this CTF, we explore a database application called "Light" reachable via a TCP socket. The main challenge is to perform an SQL Injection to retrieve the administrator's credentials and the flag.

Connection

First, we establish a TCP socket connection to the target service on port 1337: nc MACHINE_IP 1337

Once connected, we interact with the login prompt.

Step 1: SQL Injection Discovery

we write smokey the example in the THM and then after we see the password , We try to see if the application is vulnerable to SQL Injection by inputting a single quote ': Please enter your username: ' UniOn SeLeCt 1 ' Password: 1

This confirmed that we can execute SQL queries.

Step 2: Database Enumeration

We need to find the database tables. We use sqlite_master to retrieve the database schema: Please enter your username: ' UniOn SeLeCt group_concat(name) FROM sqlite_master ' Password: usertable,admintable

Explanation:

. UniOn SeLeCt: We use mixed casing to bypass potential input filters.

.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.