Skip to content

Commit 7526dce

Browse files
committed
h1 thermostat
1 parent 5b97de9 commit 7526dce

File tree

9 files changed

+90
-12
lines changed

9 files changed

+90
-12
lines changed

README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66

77
## 0x01 CTF
88

9-
| Difficulty (Points) | Name | Skills | Completion |
10-
| ------------------- | ------------------------------------------ | ------ | ---------- |
11-
| Trivial (1 / flag) | [A little something to get you started][2] | Web | 1 / 1 |
12-
| Easy (2 / flag) | [Micro-CMS v1][3] | Web | 4 / 4 |
13-
| Moderate (3 / flag) | [Micro-CMS v2][5] | Web | 3 / 3 |
14-
| Moderate (6 / flag) | [Photo Gallery][10] | Web | 3 / 3 |
15-
| Moderate (5 / flag) | [Cody's First Blog][8] | Web | 3 / 3 |
16-
| Easy (4 / flag) | [Postbook][6] | Web | 7 / 7 |
17-
| Moderate (5 / flag) | [Ticketastic: Live Instance][9] | Web | 2 / 2 |
18-
| Easy (3 / flag) | [Petshop Pro][7] | Web | 3 / 3 |
19-
| Moderate (5 / flag) | [TempImage][4] | Web | 2 / 2 |
9+
| Difficulty (Points) | Name | Skills | Completion |
10+
| ------------------- | ------------------------------------------ | ------- | ---------- |
11+
| Trivial (1 / flag) | [A little something to get you started][2] | Web | 1 / 1 |
12+
| Easy (2 / flag) | [Micro-CMS v1][3] | Web | 4 / 4 |
13+
| Moderate (3 / flag) | [Micro-CMS v2][5] | Web | 3 / 3 |
14+
| Moderate (6 / flag) | [Photo Gallery][10] | Web | 3 / 3 |
15+
| Moderate (5 / flag) | [Cody's First Blog][8] | Web | 3 / 3 |
16+
| Easy (4 / flag) | [Postbook][6] | Web | 7 / 7 |
17+
| Moderate (5 / flag) | [Ticketastic: Live Instance][9] | Web | 2 / 2 |
18+
| Easy (3 / flag) | [Petshop Pro][7] | Web | 3 / 3 |
19+
| Moderate (5 / flag) | [TempImage][4] | Web | 2 / 2 |
20+
| Easy (2 / flag) | [H1 Thermostat][11] | Android | 2 / 2 |
2021

2122
[1]: https://ctf.hacker101.com/ctf
2223
[2]: ./a_little_something_to_get_you_started
@@ -27,4 +28,5 @@
2728
[7]: ./petshop_pro
2829
[8]: ./codys_first_blog
2930
[9]: ./ticketastic_live_instance
30-
[10]: ./photo_gallery
31+
[10]: ./photo_gallery
32+
[11]: ./h1_thermostat

h1_thermostat/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# H1 Thermostat
2+
3+
## [Flag0](./flag0) -- Found
4+
5+
- Communication is key
6+
- Have you looked at what the app is sending to the server?
7+
8+
## [Flag1](./flag1) -- Found
9+
10+
- Doesn't the MAC seem interesting?
11+
- Access to the source code would help
12+
- Check out the [Android Quickstart][1] video from Hacker101
13+
14+
[1]: https://www.hacker101.com/sessions/android_quickstart

h1_thermostat/flag0/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# H1 Thermostat - FLAG0
2+
3+
## 0x00 Configure Proxy
4+
5+
Set Android Emulator use the Burp proxy.
6+
7+
![](./imgs/proxy.jpg)
8+
9+
## 0x01 Install APK
10+
11+
Just drug apk to install it into Android Emulator. And start the app.
12+
13+
Here comes the first FLAG in the POST request.
14+
15+
![](./imgs/flag.jpg)

h1_thermostat/flag0/imgs/flag.jpg

19.5 KB
Loading

h1_thermostat/flag0/imgs/proxy.jpg

29.7 KB
Loading

h1_thermostat/flag1/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# H1 Thermostat - FLAG1
2+
3+
## 0x00 Params
4+
5+
There are different messages sending through. We can decode them with [base64][1].
6+
7+
| encoded | readable |
8+
| ------------------------------------------------ | ------------------------------------ |
9+
| eyJjbWQiOiJnZXRUZW1wIn0 | {"cmd":"getTemp"} |
10+
| eyJ0ZW1wZXJhdHVyZSI6IDc3LCAic3VjY2VzcyI6IHRydWV9 | {"temperature": 77, "success": true} |
11+
| eyJjbWQiOiJzZXRUZW1wIiwidGVtcCI6Nzd9 | {"cmd":"setTemp","temp":77} |
12+
| eyJjbWQiOiJzZXRUZW1wIiwidGVtcCI6NzB9 | {"cmd":"setTemp","temp":70} |
13+
| eyJzdWNjZXNzIjogdHJ1ZX0= | {"success": true} |
14+
15+
As the app shows current temperature is 73 and target 70.
16+
17+
![](./imgs/app.jpg)
18+
19+
Tried to manually change the temperature by encode
20+
21+
```javascript
22+
//eyJjbWQiOiJzZXRUZW1wIiwidGVtcCI6NzN9
23+
base64({"cmd":"setTemp","temp":73})
24+
```
25+
26+
But got an error as following
27+
28+
```json
29+
//eyJzdWNjZXNzIjogZmFsc2UsICJlcnJvciI6ICJNQUMgZmFpbHVyZSJ9
30+
{"success": false, "error": "MAC failure"}
31+
```
32+
33+
## 0x01 Check Source
34+
35+
Something wrong with that MAC. Need go back to check the source for some help.
36+
37+
![](./imgs/src.jpg)
38+
39+
```
40+
classes.dex -> com -> hacker101 -> level11 -> PlayloadRequest
41+
```
42+
43+
Both flags can be found here.
44+
45+
![](./imgs/flag.jpg)
46+
47+
[1]: https://www.base64decode.org/

h1_thermostat/flag1/imgs/app.jpg

10.8 KB
Loading

h1_thermostat/flag1/imgs/flag.jpg

41.3 KB
Loading

h1_thermostat/flag1/imgs/src.jpg

25.1 KB
Loading

0 commit comments

Comments
 (0)