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: 2015/CSAW_CTF_2015/LawnCareimulator_Web200_writeup.md
+3-7
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,7 @@
4
4
5
5
Lawn Care Simulator is a simple web application to show how the grass is growing. Yeah, ok. It has premium content, but it requires registration. Registration not working and there's no way to log in as we can't register any account.
After *667e217666* time of responses stopped to change, so I've decided to try only with this (I've added some random chars to get 32 characters length of the whole hash) - and it was enough:
Copy file name to clipboardexpand all lines: 2016/CSAW_CTF_2016/mfw/mfw_web125.md
+8-17
Original file line number
Diff line number
Diff line change
@@ -9,25 +9,22 @@ http://web.chal.csaw.io:8000/
9
9
10
10
We get simple website, build with PHP, Bootstrap and with Git. Url looks vulnerable for Local File Include and Directory Traversal, but couple of standards payloads returned only "Detected hacking attempt!" or "That file doesn't exist!" messages.
11
11
12
-
![Screen caption]
13
-
(assets/mfw2.png)
12
+

14
13
15
14
16
15
### Digging into .git folder
17
16
18
17
Abandoned, readable .git folder is a gold mine. Access to one in this challenge wasn't restricted in any way, I could easily navigate through all folders and files using web browser:
19
18
20
-
![Git]
21
-
(assets/mfw3.png)
19
+

22
20
23
21
But I wanted source code to find out the way to exploit LFI or Directory Traversal, so with little help of my own tool, **diggit** (https://github.com/bl4de/security-tools/tree/master/diggit) I downloaded sources:
I checked the file ```flag.php``` (I found commented link to it earlier, when I was checking HTML source of website), but it does not contain anything interesting, except comment ```//TODO``` - and that was crucial information to find the solution of this challenge, but more on this later:
33
30
@@ -148,14 +145,12 @@ If you are able to display such output, use option 'View source' in your browser
148
145
149
146
Here's an output from previous payload directly in the browser tab (interpreted as regular HTML, which is very hard to read, not what we want to see):
150
147
151
-
![command as HTML]
152
-
(assets/output1.png)
148
+

153
149
154
150
155
151
And here's how it looks like when 'View source' option is used instead:
156
152
157
-
![command as HTML]
158
-
(assets/output2.png)
153
+

159
154
160
155
--
161
156
@@ -180,8 +175,7 @@ Bingo!
180
175
181
176
182
177
183
-
![git status]
184
-
(assets/mfw7.png)
178
+

185
179
186
180
```flag.php``` was modified, but no changes were added to commit and commited, so file I've downloaded earlier didn't contain newest changes.
187
181
@@ -194,8 +188,7 @@ view-source:http://web.chal.csaw.io:8000/?page='.system("cd /var/www/html/;git d
I had a lot of fun with this challenge, even if it was relatively simple. It contains a lot of obvious vulnerabilities like (potential) LFI with Directory Traversal and (fully exploitable) RCE, but in the end the solution turned into Git and some Git commands knowledge.
0 commit comments