@@ -26,12 +26,12 @@ Lets start the machine and wait for 2-3 minutes, let the machine get fully funct
2626
2727As usual running a full port scan for identifying potential entry points.
2828` nmap -p- -T4 MACHINE-IP -vv `
29- ![ Nmap scan results] ( /_posts/attachments/Pasted%20image%2020250816001828 .png )
29+ ![ Nmap scan results] (/_ posts/attachments/Pasted image 20250816001828 .png)
3030
3131Meanwhile lets try connecting to the port 1337
3232` nc MACHINE-IP 1337 `
3333Lets try the username provided ` smokey `
34- ![ Testing with username smokey] ( /_posts/attachments/Pasted%20image%2020250816002133 .png )
34+ ![ Testing with username smokey] (/_ posts/attachments/Pasted image 20250816002133 .png)
3535Alright!
3636
3737So, I guess we can try brute-forcing a wordlist of usernames, but we cannot use ffuf...
@@ -72,28 +72,28 @@ for user in usernames:
7272I tried few wordlists but didn't find anything.
7373
7474Got back to the nmap scan and LOL!, its gonna take forever so its not the way in for sure!
75- ![ Nmap scan taking too long] ( /_posts/attachments/Pasted%20image%2020250816003201 .png )
75+ ![ Nmap scan taking too long] (/_ posts/attachments/Pasted image 20250816003201 .png)
7676
7777What else can we do? Found no ` http ` pages, where can we even use the credentials we've got earlier?
7878Lets try to change the approach.
7979
8080Lets try putting in some random input, my mind is getting a little idea of where it is going _ maybe_ .
81- ![ Testing random input] ( /_posts/attachments/Pasted%20image%2020250816003925 .png )
81+ ![ Testing random input] (/_ posts/attachments/Pasted image 20250816003925 .png)
8282Its more of an Injection vulnerability I see
8383Its been a long I have not dealt with a SQLi, now quickly digging through my notes for revising required methods.
8484
8585From the responses below
86- ![ SQL injection response] ( /_posts/attachments/Pasted%20image%2020250816004841 .png )
86+ ![ SQL injection response] (/_ posts/attachments/Pasted image 20250816004841 .png)
8787I can imagine of a SQL query
8888` select pass from users where user='<input>' limit 30 `
8989
9090Now we'll try creating some SQL payloads based on the payloads I already have in my notes.
9191` 'union select 1' `
92- ![ Union select blocked] ( /_posts/attachments/Pasted%20image%2020250816005530 .png )
92+ ![ Union select blocked] (/_ posts/attachments/Pasted image 20250816005530 .png)
9393Okhayy!
9494They might be blocking some keywords most probably as an easy way out.
9595Here might be a logic error lets try ` 'UnIOn sElecT 1' `
96- ![ Bypassing keyword filter] ( /_posts/attachments/Pasted%20image%2020250816005739 .png )
96+ ![ Bypassing keyword filter] (/_ posts/attachments/Pasted image 20250816005739 .png)
9797as a developer I would also blacklist these keywords as its an easy fix(not a fix really). Laziness is a problem frr.
9898I love these kinda logic based errors!
9999
@@ -106,35 +106,35 @@ Refer this https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%2
106106This one worked
107107` 'Union Select sqlite_version()' `
108108Its sqlite database version: 3.31.1
109- ![ SQLite version] ( /_posts/attachments/Pasted%20image%2020250816010644 .png )
109+ ![ SQLite version] (/_ posts/attachments/Pasted image 20250816010644 .png)
110110
111111Using 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- ![ Database schema] ( /_posts/attachments/Pasted%20image%2020250816010906 .png )
114+ ![ Database schema] (/_ posts/attachments/Pasted image 20250816010906 .png)
115115
116116Now we know the table name, column names.
117117Enough to craft useful payloads.
118118
119119> 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- ![ Admin username] ( /_posts/attachments/Pasted%20image%2020250816011619 .png )
122+ ![ Admin username] (/_ posts/attachments/Pasted image 20250816011619 .png)
123123If needed we could've dumped all but in this case we don't need the whole database.
124124
125- ![ Question 1 answer] ( /_posts/attachments/Pasted%20image%2020250816011809 .png )
125+ ![ Question 1 answer] (/_ posts/attachments/Pasted image 20250816011809 .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- ![ Admin password] ( /_posts/attachments/Pasted%20image%2020250816012001 .png )
129+ ![ Admin password] (/_ posts/attachments/Pasted image 20250816012001 .png)
130130
131- ![ Question 2 answer] ( /_posts/attachments/Pasted%20image%2020250816012439 .png )
131+ ![ Question 2 answer] (/_ posts/attachments/Pasted image 20250816012439 .png)
132132
133133` Q3 What is the flag? `
134134Till 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.
135135Little modifications to the previous payload will get you the flag.
136136
137- ![ Question 3 flag] ( /_posts/attachments/Pasted%20image%2020250816012516 .png )
137+ ![ Question 3 flag] (/_ posts/attachments/Pasted image 20250816012516 .png)
138138
139139
140140
0 commit comments