@@ -707,36 +707,9 @@ def target_arch
707
707
# @return [FalseClass] Payload is not compatible.
708
708
#
709
709
def is_payload_compatible? ( payload_name )
710
- c_platform = ( target and target . platform ) ? target . platform : platform
711
- c_arch = ( target and target . arch ) ? target . arch : ( arch == [ ] ) ? nil : arch
712
- c_arch ||= [ ARCH_X86 ]
713
-
714
- framework . payloads . each_module (
715
- 'Platform' => c_platform ,
716
- 'Arch' => c_arch ) { |name , mod |
717
-
718
- # Skip over payloads that are too big
719
- if ( ( payload_space ) and
720
- ( framework . payloads . sizes [ name ] ) and
721
- ( framework . payloads . sizes [ name ] > payload_space ) )
722
- dlog ( "#{ refname } : Skipping payload #{ name } for being too large" , 'core' ,
723
- LEV_1 )
724
- next
725
- end
726
-
727
- # Are we compatible in terms of conventions and connections and
728
- # what not?
729
- next if ( compatible? ( framework . payloads . instance ( name ) ) == false )
730
-
731
- # If the payload is privileged but the exploit does not give
732
- # privileged access, then fail it.
733
- next if ( self . privileged == false and framework . payloads . instance ( name ) . privileged == true )
734
-
735
- # This one be compatible!
736
- return true if payload_name == name
737
- }
710
+ payload_names = compatible_payloads . collect { |entry | entry [ 0 ] }
738
711
739
- false
712
+ payload_names . include? ( payload_name )
740
713
end
741
714
742
715
#
0 commit comments