Skip to content

Commit 45ee595

Browse files
committed
Fix inverted logic in Docker exploit
Positive condition should be tested first, imo. Confusing otherwise. My bad, though. Credit to @fslavin-r7.
1 parent ab94bb9 commit 45ee595

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/exploits/linux/local/docker_daemon_privilege_escalation.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def initialize(info={})
3535
end
3636

3737
def check
38-
if cmd_exec('docker ps && echo true') == 'true'
38+
if cmd_exec('docker ps && echo true') =~ /true$/
39+
Exploit::CheckCode::Vulnerable
40+
else
3941
print_error("Failed to access Docker daemon.")
4042
Exploit::CheckCode::Safe
41-
else
42-
Exploit::CheckCode::Vulnerable
4343
end
4444
end
4545

0 commit comments

Comments
 (0)