File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -710,7 +710,12 @@ def is_payload_compatible?(name)
710
710
# Skip over payloads that are too big
711
711
return false if payload_space && p . cached_size && p . cached_size > payload_space
712
712
713
- pi = p . new
713
+ begin
714
+ pi = p . new
715
+ rescue ::Exception , ::LoadError => e
716
+ wlog ( "Module #{ name } failed to initialize: #{ e } " , 'core' , LEV_0 )
717
+ return false
718
+ end
714
719
715
720
# Are we compatible in terms of conventions and connections and
716
721
# what not?
Original file line number Diff line number Diff line change @@ -346,7 +346,13 @@ def dump_payloads(platform = nil, arch = nil)
346
346
framework . payloads . each_module (
347
347
'Platform' => platform ? Msf ::Module ::PlatformList . transform ( platform . split ( ',' ) ) : nil ,
348
348
'Arch' => arch ? arch . split ( ',' ) : nil ) do |name , mod |
349
- tbl << [ name , mod . new . description . split . join ( ' ' ) ]
349
+ begin
350
+ mod_info = mod . new . description . split . join ( ' ' )
351
+ rescue ::Exception , ::LoadError => e
352
+ wlog ( "Module #{ name } failed to initialize: #{ e } " , 'core' , LEV_0 )
353
+ next
354
+ end
355
+ tbl << [ name , mod_info ]
350
356
end
351
357
352
358
"\n " + tbl . to_s + "\n "
You can’t perform that action at this time.
0 commit comments