File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
modules/exploits/linux/http Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def check_image(image_id)
54
54
'method' => 'GET' ,
55
55
'uri' => normalize_uri ( 'images' , 'json' )
56
56
)
57
- return unless res and res . code == 200 and res . body . include? image_id
57
+ return unless res && res . code == 200 && res . body . include? ( image_id )
58
58
59
59
res
60
60
end
@@ -65,7 +65,7 @@ def pull_image(image_id)
65
65
'method' => 'POST' ,
66
66
'uri' => normalize_uri ( 'images' , 'create?fromImage=' + image_id )
67
67
)
68
- return unless res . code == 200
68
+ return unless res && res . code == 200
69
69
70
70
res
71
71
end
@@ -125,7 +125,7 @@ def check
125
125
return Exploit ::CheckCode ::Unknown
126
126
end
127
127
128
- if res and res . code == 200 and res . headers [ 'Server' ] . include? 'Docker'
128
+ if res && res . code == 200 && res . headers [ 'Server' ] . include? ( 'Docker' )
129
129
return Exploit ::CheckCode ::Vulnerable
130
130
end
131
131
@@ -181,7 +181,7 @@ def exploit
181
181
182
182
# delete container
183
183
deleted_container = false
184
- if res_wait . code == 200
184
+ if res_wait && res_wait . code == 200
185
185
vprint_status ( "The docker container has been stopped, now trying to remove it" )
186
186
del_container ( container_id )
187
187
deleted_container = true
You can’t perform that action at this time.
0 commit comments