Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jheysel-r7 committed Feb 28, 2024
1 parent 6589b86 commit 8ce9500
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/exploits/linux/local/runc_cwd_priv_esc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def check
return CheckCode::Safe('The docker command was not found on this system')
end

minimum_version = "1.0.0"
minimum_version = '1.0.0'
version_info = cmd_exec('runc --version')

case sys_info[:distro]
Expand All @@ -107,9 +107,9 @@ def check
elsif sys_info[:version].include? '18.04' # bionic
fixed_version = '1.1.4-0ubuntu1~18.04.2+esm1'
elsif sys_info[:version].include? '16.04' # xenial
return CheckCode::Safe("Ubuntu version not affected")
return CheckCode::Safe('Ubuntu version not affected')
elsif sys_info[:version].include? '14.04' # trusty
return CheckCode::Detected("Patch for this Ubuntu version was ignored. (end of standard support)")
return CheckCode::Detected('Patch for this Ubuntu version was ignored. (end of standard support)')
else
fixed_version = '1.1.12'
end
Expand Down Expand Up @@ -150,6 +150,7 @@ def check
if Rex::Version.new(runc_version) < Rex::Version.new(fixed_version) && Rex::Version.new(runc_version) >= Rex::Version.new(minimum_version)
return CheckCode::Appears("Version of runc detected appears to be vulnerable: #{unfiltered_version}.")
end

CheckCode::Safe("runc version #{unfiltered_version} is not vulnerable.")
end

Expand Down

0 comments on commit 8ce9500

Please sign in to comment.