You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2024-09-02-Cyberspace-2024.md
+63-25Lines changed: 63 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
2
title: CyberSpace CTF 2024 - WEB
3
-
date: 2024-09-03 12:03 +0700
3
+
date: 2024-09-03 20:03 +0700
4
4
tags: [ctf, web]
5
5
categories: [CTF Writeups]
6
6
author: Dat2Phit
7
7
img_path: /assets/img/CyberSpace-2024
8
8
image: banner.png
9
9
---
10
10
11
-
I played [CyberSpace 2024](https://ctftime.org/event/2428) this year with the team [epic merger](https://ctftime.org/team/349896) and got 5th place. We cleared the web category. Here's the writeups for the challenges that I've solve and my note on my teammate's solution for the challenges that I wasn't able to solve.
11
+
I played [CyberSpace 2024](https://ctftime.org/event/2428) this year with the team [epic merger](https://ctftime.org/team/349896) and got 5th place. We cleared the web category (including the sponsor challenge). Here's the writeups for the challenges that I've solve and my note on my teammate's solution for the challenges that I wasn't able to solve.
12
12
13
13
## ZipZone
14
-
**Solver:** 173 <br>
14
+
**Solvers:** 173 <br>
15
15
**Author:** rex
16
16
17
17
This was a beginner web challenge, the idea was to use the fact that we can zip a [symlink](https://en.wikipedia.org/wiki/Symbolic_link) and when upzipped, we can read that symlink which can point to any files on the system
@@ -65,7 +65,7 @@ After that just upload the symlink.zip to the site and read the flag.
65
65
**Flag:**`CSCTF{5yml1nk5_4r3_w31rd}`
66
66
67
67
## Feature Unlocked
68
-
**Solver:** 184 <br>
68
+
**Solvers:** 184 <br>
69
69
**Author:** cryptocat
70
70
71
71
When reading the source we can see that we need to exploit a command injection at the endpoint `/feature`
I solved this one before [`Trendz`](#trendz) because I wasn't able to find the intended solution and solved it the unintended way, but eventually I did find the intended solution when trying to find the binary for the fourth chall (Trendzzzz which is a rev challenge).
@@ -460,7 +460,7 @@ Yep it was there all along, we can do path traversal to get the challenge binary
460
460
To solve the first challenge, we just need to craft a admin session token with the `jwt.secret` and go to `/admin/dashboard` to get the secret post id and get the flag.
461
461
462
462
## notekeeper
463
-
**Solver:** 19 <br>
463
+
**Solvers:** 19 <br>
464
464
**Author:** 0xM4hm0ud
465
465
466
466
This challenge had me shoveling a lot because of the `X-Forwarded-For` header. The idea of the challenge was to spoof our ip to access the `/admin` route of the app which can be exploited with LFI, after that we need to find a way to login as `admin` and read the flag.
@@ -560,7 +560,7 @@ To get the flag, just go to `/flag` as with the admin cookie we just crafted and
560
560
**Flag:**`CSCTF{Y0u_G0t_1t_G00d_J0b}`
561
561
562
562
## Snippets
563
-
**Solver:** 11 <br>
563
+
**Solvers:** 11 <br>
564
564
**Author:** bawolff
565
565
566
566
### Unintended
@@ -682,15 +682,15 @@ The browser will just "merge" the two sets of `script` tags together. Which resu
682
682
...
683
683
<inputtype="text"value="--></script>
684
684
```
685
-
Even the syntax highlighting doesn't know what's going on lol. The script that's actually ran is this
685
+
Even the syntax highlighter doesn't know what's going on lol. The script that's actually ran is this
686
686
```javascript
687
687
console.log("<!--<script>");
688
688
</script>
689
689
...
690
690
<inputtype="text"value="-->
691
691
```
692
-
Which is invalid javascript and will throw an error. But we can workaround it with some clever techniques as seen in the article.
693
-
In the case of this challenge, if we input the author's payload, we'll get something like:
692
+
Which is invalid javascript and will throw an error. But we can work around it with some clever tricks as seen in the article.
693
+
In the case of this challenge, if we put in the author's payload, we'll get something like:
694
694
```html
695
695
<!DOCTYPE html>
696
696
<html>
@@ -740,7 +740,7 @@ Then pop goes the alert.
740
740
## Teammate's solves
741
741
742
742
### Quiz
743
-
**Solver:** 9 <br>
743
+
**Solvers:** 9 <br>
744
744
**Author:** GabeG888
745
745
746
746
This challenge was solved by [Masamune](https://discord.com/users/538608747153588224) after one of our teammmates gave an idea
@@ -842,10 +842,10 @@ while True:
842
842
**Flag:**`CSCTF{3rr0r5_c4n_b3_0r4c135}`
843
843
844
844
### Twig Playground
845
-
**Solver:** 7 <br>
845
+
**Solvers:** 7 <br>
846
846
**Author:** 0xM4hm0ud
847
847
848
-
This challenge was solved by [jeser](https://discord.com/users/293440719857909760) while I was asleep, when I woke up and saw his payload, I was overwhelmed lol. But here's my analysis of the challenge.
848
+
This challenge was solved by [jeser](https://discord.com/users/293440719857909760) while I was sleeping, when I woke up and saw his payload, I was overwhelmed lol. But here's my analysis of the challenge.
849
849
850
850
Here's his final payload for the challenge:
851
851
```
@@ -861,8 +861,8 @@ Here's his final payload for the challenge:
861
861
{{ {rce}|find(syste~m) }}{% endraw %}
862
862
```
863
863
864
-
Let's analyze the problem before going into the payload
865
-
This is a Twig SSTI challenge, our goal is to bypass the blacklist and achieve RCE
864
+
Let's analyze the problem before going into the payload.
865
+
This is a Twig SSTI challenge, our goal is to bypass the blacklist and achieve RCE.
@@ -889,25 +889,25 @@ So we got ` ` and `/` now, let's assign them to a variable first.
889
889
Next we need to find a way to get `system`.
890
890
To get system, we can actually do the same as `` and `/` but it'll be to tedious. Instead, we can do something like this: `{syste:1}|keys|join()`. The `keys` filter will extract all the keys in an object and put it into an array, in this case, we'll get `syste`.
891
891
892
-
For the character `m` we can do this `{m:1}|keys|join()`
892
+
For the character `m` we can do this `{m:1}|keys|join()`.
893
893
894
-
In order to join them together, Twig has a very convenient operator which is `~` that is not in the blacklist
894
+
In order to join them together, Twig has a very convenient operator which is `~` that is not in the blacklist.
This challenge was solved by [LyC0nTriX](https://discord.com/users/1116855799659102309) in the last 5 minutes of the competition. This was more of a misc-guessing challenge more than a web challenge but it has a web tag so I'll include it here as well.
974
+
975
+
The challenge gave us a picture with the following hints
976
+

977
+
978
+
> Hint: There are 2 important pieces of information that one can get from the discord screenshot. One is the fact that the mention of a VPN, hints to the IP History page.
979
+
980
+
> Hint 2: Think about how discord knows to display such a good looking embed and the technology used in the site.
981
+
982
+
Hint 1 told us to go to the IP History page but we can't find anything useful there after a while.
983
+
984
+
According the hint 2, it's related to how discord fetch the embed and display it. So I think if we can replicate what discord does to get the embed, we'll get the flag.
985
+
986
+
So I'll spin up a quick http server that can log headers information and send the server address to a random channel. This is what I receive after that.
987
+
988
+

989
+
990
+
As you can see, discord will send a request to that address with the user-agent: `Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)`.
991
+
992
+
So let's try to request `cybersharing.net` ourselves with that header and see what will be returned.
993
+
We'll send a curl request with the header `User-Agent: Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)` to [https://cybersharing.net/history](https://cybersharing.net/history) since the first hint pointed to that.
0 commit comments