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
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.
11
+
I played [CyberSpace 2024](https://ctftime.org/event/2428){:target="_blank"} this year with the team [epic merger](https://ctftime.org/team/349896){:target="_blank"} 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
14
**Solvers:** 173 <br>
15
15
**Author:** rex
16
16
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
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){:target="_blank"} and when upzipped, we can read that symlink which can point to any files on the system
18
18
19
19
Let's look at the code:
20
20
```python
@@ -217,7 +217,7 @@ I will modify it to send a date that is 10 days into the future.
217
217
218
218
After that use ngrok to expose the port, and provide the address to `/release?debug=true` then it will give us the `access_granted` token.
219
219
220
-
Finally, it's just some basic [command injection](https://book.hacktricks.xyz/pentesting-web/command-injection) at `/feature`.
220
+
Finally, it's just some basic [command injection](https://book.hacktricks.xyz/pentesting-web/command-injection){:target="_blank"} at `/feature`.
Yep, definitely a [TOCTOU](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use) problem.
289
+
Yep, definitely a [TOCTOU](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use){:target="_blank"} problem.
290
290
291
291
We can see that the `CreatePost` function will call `CheckNoOfPosts` first then after a `while`, it will call `InsertPost`. In that time frame, we can send a bunch of request to create post at the same time and it will go past the 10 notes limit.
292
292
@@ -372,7 +372,7 @@ Apparently the application use htmx for the front-end, so let's hit the document
372
372
After reading the document for those attribute, we can find a very suspicious attribute `hx-vals`
That's litterally a free XSS, so we can do something like this and it will pop an alert.
378
378
```html
@@ -455,7 +455,7 @@ server {
455
455
}
456
456
```
457
457
{: file="nginx.conf" }
458
-
Yep it was there all along, we can do path traversal to get the challenge binary with `/static../chall` and the admin's jwt with `/static../jwt.secret`. More on nginx alias misconfiguration [here](https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/nginx#alias-lfi-misconfiguration)
458
+
Yep it was there all along, we can do path traversal to get the challenge binary with `/static../chall` and the admin's jwt with `/static../jwt.secret`. More on nginx alias misconfiguration [here](https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/nginx#alias-lfi-misconfiguration){:target="_blank"}
459
459
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
@@ -511,7 +511,7 @@ on "download" do
511
511
```
512
512
{: file="app/server.rb" }
513
513
514
-
After reading the [rack](https://github.com/rack/rack/blob/main/lib/rack/request.rb#L414) source code, we can see that we can easily spoof our ip with `X-Forwarded-For` header since the line 418-420 is removed when building the docker image.
514
+
After reading the [rack](https://github.com/rack/rack/blob/main/lib/rack/request.rb#L414){:target="_blank"} source code, we can see that we can easily spoof our ip with `X-Forwarded-For` header since the line 418-420 is removed when building the docker image.
@@ -528,11 +528,11 @@ After reading the [rack](https://github.com/rack/rack/blob/main/lib/rack/request
528
528
When try on local, using the `X-Forwarded-For` will indeed spoof our ip as 127.0.0.1, but the remote is different from local because it's deployed behind a load balancer, and that load balance will modify our `X-Forwarded-For` header before sending it to the real app.
After hours of playing around with the `X-Forwarded-For` and other header without any result. One of my teammates - [Masamune](https://discord.com/users/538608747153588224). Found that this header will work: `Forwarded: for=127.0.0.1;`
533
+
After hours of playing around with the `X-Forwarded-For` and other header without any result. One of my teammates - [Masamune](https://discord.com/users/538608747153588224){:target="_blank"}. Found that this header will work: `Forwarded: for=127.0.0.1;`
534
534
535
-
Based on the document: [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded), `The alternative and de-facto standard versions of this header are the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers.`
535
+
Based on the document: [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded){:target="_blank"}, `The alternative and de-facto standard versions of this header are the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers.`
536
536
537
537
So that means that `X-Forwarded-For` is just another version of `Forwarded: for=<ip>`. That's a new knowledge for me.
538
538
@@ -655,7 +655,7 @@ After the competition ended, the author revealed that the intended solution is t
That was a relatively new article, I'm still confused on why the browser will parse the script tag inside string. But I'll take note of this for future uses.
661
661
@@ -743,7 +743,7 @@ Then pop goes the alert.
743
743
**Solvers:** 9 <br>
744
744
**Author:** GabeG888
745
745
746
-
This challenge was solved by [Masamune](https://discord.com/users/538608747153588224) after one of our teammmates gave an idea
746
+
This challenge was solved by [Masamune](https://discord.com/users/538608747153588224){:target="_blank"} after one of our teammmates gave an idea
747
747
748
748

749
749
@@ -845,7 +845,7 @@ while True:
845
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 sleeping, 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){:target="_blank"} 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
```
@@ -871,7 +871,7 @@ And the flag file name is randomly generated so we have to find out the flag fil
871
871
So we need to do `system('ls /')` first, but how?
872
872
The character `/` is in the blacklist and the space character will need quotes, but it's also in the blacklist.
873
873
874
-
One way we can get those character is via [`dump()`](https://twig.symfony.com/doc/3.x/functions/dump.html) function and [`nl2br()`](https://twig.symfony.com/doc/3.x/filters/nl2br.html) filter, which return alot of character we can use.
874
+
One way we can get those character is via [`dump()`](https://twig.symfony.com/doc/3.x/functions/dump.html){:target="_blank"} function and [`nl2br()`](https://twig.symfony.com/doc/3.x/filters/nl2br.html){:target="_blank"} filter, which return alot of character we can use.
875
875
876
876
If we send the payload like: `{% raw %}{{dump()|nl2br()}}{% endraw %}` we'll get the following output
877
877
```
@@ -894,7 +894,7 @@ For the character `m` we can do this `{m:1}|keys|join()`.
894
894
In order to join them together, Twig has a very convenient operator which is `~` that is not in the blacklist.
@@ -934,7 +934,7 @@ Now we know that the flag file name is `flag-edbfcbcaef`. So we'll use the same
934
934
935
935
But there's a new character which we can't use the above technique for, it's the dash character `-`.
936
936
937
-
So we'll need to find another way to get it. Another way to get a lot of characters is via the global [`_charset`](https://twig.symfony.com/doc/3.x/templates.html#global-variables) variable.
937
+
So we'll need to find another way to get it. Another way to get a lot of characters is via the global [`_charset`](https://twig.symfony.com/doc/3.x/templates.html#global-variables){:target="_blank"} variable.
938
938
939
939
If we send this `{% raw %}{{_charset}}{% endraw %}` to the server it will return `UTF-8`. There's the dash character that we need. So just extract it with `slice()` and `join()` like the others.
940
940
```
@@ -970,7 +970,7 @@ All that's left is to chain them together to get the final payload, send them to
970
970
**Solvers:** 6 <br>
971
971
**Author:** Cybersharing
972
972
973
-
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.
973
+
This challenge was solved by [LyC0nTriX](https://discord.com/users/1116855799659102309){:target="_blank"} 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
974
975
975
The challenge gave us a picture with the following hints
976
976

@@ -990,7 +990,7 @@ So I'll spin up a quick http server that can log headers information and send th
990
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
991
992
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.
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){:target="_blank"} since the first hint pointed to that.
@@ -999,7 +999,7 @@ It'll return a bunch of html code, but if we look closely or use `grep` we can s
999
999
1000
1000

1001
1001
1002
-
Here's the link: [https://cybersharing.net/s/13f17b167f2229809a95fb9d8c725449](https://cybersharing.net/s/13f17b167f2229809a95fb9d8c725449)
1002
+
Here's the link: [https://cybersharing.net/s/13f17b167f2229809a95fb9d8c725449](https://cybersharing.net/s/13f17b167f2229809a95fb9d8c725449){:target="_blank"}
0 commit comments