Skip to content

Commit 9d67ce0

Browse files
committed
Add some error handling to update_payload_cache_size script
1 parent a1613d6 commit 9d67ce0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tools/modules/update_payload_cached_sizes.rb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@
2727
framework = Msf::Simple::Framework.create('DisableDatabase' => true)
2828

2929
framework.payloads.each_module do |name, mod|
30-
next if name =~ /generic/
31-
mod_inst = framework.payloads.create(name)
32-
#mod_inst.datastore.merge!(framework.datastore)
33-
next if Msf::Util::PayloadCachedSize.is_cached_size_accurate?(mod_inst)
34-
$stdout.puts "[*] Updating the CacheSize for #{mod.file_path}..."
35-
Msf::Util::PayloadCachedSize.update_module_cached_size(mod_inst)
36-
end
30+
begin
31+
next if name =~ /generic/
32+
mod_inst = framework.payloads.create(name)
33+
#mod_inst.datastore.merge!(framework.datastore)
34+
next if Msf::Util::PayloadCachedSize.is_cached_size_accurate?(mod_inst)
35+
$stdout.puts "[*] Updating the CacheSize for #{mod.file_path}..."
36+
Msf::Util::PayloadCachedSize.update_module_cached_size(mod_inst)
37+
rescue => e
38+
print_line("Caught Error while updating #{name}:\n#{e}")
39+
elog(e)
40+
next
41+
end
42+
end

0 commit comments

Comments
 (0)