diff --git a/modules/vulnerabilities/unix/local/sudobypass/files/sudo_1.8.10p3-1+deb8u5_amd64.deb b/modules/vulnerabilities/unix/local/sudobypass/files/sudo_1.8.10p3-1+deb8u5_amd64.deb new file mode 100644 index 000000000..e67a696da Binary files /dev/null and b/modules/vulnerabilities/unix/local/sudobypass/files/sudo_1.8.10p3-1+deb8u5_amd64.deb differ diff --git a/modules/vulnerabilities/unix/local/sudobypass/manifests/install.pp b/modules/vulnerabilities/unix/local/sudobypass/manifests/install.pp new file mode 100644 index 000000000..bdfef5f92 --- /dev/null +++ b/modules/vulnerabilities/unix/local/sudobypass/manifests/install.pp @@ -0,0 +1,29 @@ +class sudobypass::install { + Exec { path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'] } + + $secgen_parameters = secgen_functions::get_parameters($::base64_inputs_file) + $leaked_filenames = $secgen_parameters['leaked_filenames'] + $strings_to_leak = $secgen_parameters['strings_to_leak'] + + exec { 'open-sudo-bypass': + command => "echo 'ALL ALL=(ALL,!root) /bin/bash' >> /etc/sudoers" + } + -> file { '/tmp/sudo_1.8.10p3-1+deb8u5_amd64.deb': + ensure => file, + source => 'puppet:///modules/sudobypass/sudo_1.8.10p3-1+deb8u5_amd64.deb', + } + -> package { 'downgrade sudo': + ensure => installed, + provider => dpkg, + source => '/tmp/sudo_1.8.10p3-1+deb8u5_amd64.deb' + } + + # Leak a file containing a string/flag to /root/ + ::secgen_functions::leak_files { 'sudoedit-file-leak': + storage_directory => '/root', + leaked_filenames => $leaked_filenames, + strings_to_leak => $strings_to_leak, + leaked_from => "sudoedit", + mode => '0600' + } +} diff --git a/modules/vulnerabilities/unix/local/sudobypass/secgen_metadata.xml b/modules/vulnerabilities/unix/local/sudobypass/secgen_metadata.xml new file mode 100644 index 000000000..d542b48e2 --- /dev/null +++ b/modules/vulnerabilities/unix/local/sudobypass/secgen_metadata.xml @@ -0,0 +1,77 @@ + + + + Sudo Bypass + James Davis + MIT + In Sudo before 1.8.28, an attacker with access to a Runas ALL sudoer account can + bypass certain policy blacklists and session PAM modules, and can cause incorrect logging, + by invoking sudo with a crafted user ID. For example, this allows bypass of !root + configuration, and USER= logging, for a "sudo -u \#$((0xffffffff))" command. + + + local_priv_escal + root_rwx + local + linux + medium + + strings_to_leak + leaked_filenames + + + + + + + + + + + + + + + tiaspbiqe2r + + + + .*Stretch.* + + + .*Kali.* + + + .*Windows.* + + + .*Ubuntu.* + + + CVE-2019-14287 + 8 + AV:N/AC:L/Au:N/C:C/I:C/A:C + https://www.exploit-db.com/exploits/47502 + Sudo + Misc + + + EXPLOITATION + EXPLOITATION FRAMEWORKS + + + CVEs and CWEs + + + PENETRATION TESTING - SOFTWARE TOOLS + PENETRATION TESTING - ACTIVE PENETRATION + + + kill chains + + + cyber kill chain + + \ No newline at end of file diff --git a/modules/vulnerabilities/unix/local/sudobypass/sudobypass.pp b/modules/vulnerabilities/unix/local/sudobypass/sudobypass.pp new file mode 100644 index 000000000..45f059790 --- /dev/null +++ b/modules/vulnerabilities/unix/local/sudobypass/sudobypass.pp @@ -0,0 +1 @@ +include sudobypass::install