@@ -206,32 +206,32 @@ There are some interesting directories found with dirsearch. We should add them
206206
207207Let' s start Burp Suite in the back ground and navigate to the website.
208208
209- {: width="700" height="400" }
209+ {: width="700" height="400" }
210210
211211
212212While we are using Burp in the background we should visit as much as possible pages to gather information about the website. Let' s start at the register page.
213213
214- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520200800.png){: width=" 700" height=" 400" }
214+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520200800.png){: width=" 700" height=" 400" }
215215
216216
217217A invite code is needed to register. This is an old website of Hack The Box. They hit this challenge before you could join. This is something I can remember. We should check Burp Suite and find the JavaScript file that could help us.
218218
219- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520201712.png){: width=" 700" height=" 400" }
219+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520201712.png){: width=" 700" height=" 400" }
220220
221221
222222The JavaScript content gives us information what method we can use. This can be done in the console in the web browser.
223223
224- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202105.png){: width=" 700" height=" 400" }
224+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202105.png){: width=" 700" height=" 400" }
225225
226226
227227We got a encrypted (ROT13) message. This can be decrypted with cyberchef.
228228
229- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202251.png){: width=" 700" height=" 400" }
229+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202251.png){: width=" 700" height=" 400" }
230230
231231
232232It looks like we have to send a POST request to an API. We can use Burp easily since we captured already a lot of requests.
233233
234- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202525.png){: width=" 700" height=" 400" }
234+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202525.png){: width=" 700" height=" 400" }
235235
236236
237237A base64 code is returned. We can decode the base64 code in our terminal.
@@ -242,32 +242,32 @@ A base64 code is returned. We can decode the base64 code in our terminal.
242242` ` `
243243Now we got a invite code. This should be used in the invite endpoint.
244244
245- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202628.png){: width=" 700" height=" 400" }
245+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202628.png){: width=" 700" height=" 400" }
246246
247247
248248Just one more step before we can logon. We have to create an account for HTB.
249249
250- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202654.png){: width=" 700" height=" 400" }
250+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202654.png){: width=" 700" height=" 400" }
251251
252252
253253Since our account is created, we can try to logon.
254254
255- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202724.png){: width=" 700" height=" 400" }
255+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202724.png){: width=" 700" height=" 400" }
256256
257257
258258The famous dashboard from the past is shown to us. There are so much menu items. Where should we start is the question popping in my mind. Lucky for us, most of the hyperlinks are not working.
259259
260- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520202736.png){: width=" 700" height=" 400" }
260+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520202736.png){: width=" 700" height=" 400" }
261261
262262
263263One of the hyperlinks is working and showing us the page ` Access` .
264264
265- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520203207.png){: width=" 700" height=" 400" }
265+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520203207.png){: width=" 700" height=" 400" }
266266
267267
268268We could download the VPN file. But not sure what we should look for we should check Burp again. We can see several API things. Let' s try to send a GET request to `/api/v1` to see how the response is.
269269
270- {: width="700" height="400" }
270+ {: width="700" height="400" }
271271
272272
273273A lot of endpoints are shown. Even the HTTP Method is shown in front.
@@ -279,27 +279,27 @@ One of the API endpoint looks interesting. It is something about updating user s
279279
280280Let' s just sent a PUT request to this endpoint to see how the system reacts.
281281
282- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520203902.png){: width=" 700" height=" 400" }
282+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520203902.png){: width=" 700" height=" 400" }
283283
284284
285285It looks like we did not sent any Content-Type to the endpoint. We should add the following header: ` Content-Type: application/json` and try to sent it again.
286286
287- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520203947.png){: width=" 700" height=" 400" }
287+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520203947.png){: width=" 700" height=" 400" }
288288
289289
290290This time we are missing a parameter (email). We should add our email address and parameter in json format and send the request again.
291291
292- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520204059.png){: width=" 700" height=" 400" }
292+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520204059.png){: width=" 700" height=" 400" }
293293
294294
295295It expects the ` is_admin` parameter. We did not know this and did not send it. This field is probably a Boolean. So we have to add it with the value ` true` .
296296
297- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520204148.png){: width=" 700" height=" 400" }
297+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520204148.png){: width=" 700" height=" 400" }
298298
299299
300300Well true, was not correct. It expects a ` 1` or a ` 0` . We should use ` 1` to set the value to ` true` . After changing this we can send the request again.
301301
302- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520204210.png){: width=" 700" height=" 400" }
302+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520204210.png){: width=" 700" height=" 400" }
303303
304304
305305We got a success message! Now we can check if we are indeed an admin with the following API endpoint.
@@ -310,7 +310,7 @@ We got a success message! Now we can check if we are indeed an admin with the fo
310310
311311Let' s send the request with Burp.
312312
313- {: width="700" height="400" }
313+ {: width="700" height="400" }
314314
315315
316316So we have admin privileges now. We should probably now look for the generate VPN for another user.
@@ -321,18 +321,18 @@ So we have admin privileges now. We should probably now look for the generate VP
321321
322322Let' s just send a an empty request to the API, to see how it will respond.
323323
324- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520205313.png){: width=" 700" height=" 400" }
324+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520205313.png){: width=" 700" height=" 400" }
325325
326326
327327We should have sent the request with the field ` username` . So let' s add it and sent it again.
328328
329- {: width="700" height="400" }
329+ {: width="700" height="400" }
330330
331331
332332We got a response, but it looks like there are more details then it should be. Perhaps we can run system command via the API. Let' s try it with ` ; id; whoami # ` to see who we are.
333333
334334
335- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520205450.png){: width=" 700" height=" 400" }
335+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520205450.png){: width=" 700" height=" 400" }
336336
337337
338338It looks like we are running commands as ` www-data` . If we can run system command we might be able to start a reverse shell.
@@ -353,7 +353,7 @@ The reverse shell payload should look like this.
353353```
354354Now we can send the request with Burp Suite Repeater.
355355
356- {: width="700" height="400" }
356+ {: width="700" height="400" }
357357
358358
359359Let' s check our netcat listener.
@@ -537,7 +537,7 @@ Linux 5.15.70-051570-generic x86_64
537537```
538538
539539Let' s use out Google Fu to find some information about this vulnerability
540- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520212130.png){: width=" 700" height=" 400" }
540+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520212130.png){: width=" 700" height=" 400" }
541541
542542
543543There is a Github page with an exploit.
@@ -691,4 +691,4 @@ root@2million:/root# cat thank_you.json
691691```
692692Let' s use cyberchef to read the thank you message.
693693
694- ! [Image](/assets/img/WriteUp /HTB/TwoMillion/Pasted image 20240520214427.png){: width=" 700" height=" 400" }
694+ ! [Image](/assets/img/Writeup /HTB/TwoMillion/Pasted image 20240520214427.png){: width=" 700" height=" 400" }
0 commit comments