diff --git a/documentation/plan.txt b/documentation/plan.txt index d53751bd04..b41934fa9d 100644 --- a/documentation/plan.txt +++ b/documentation/plan.txt @@ -7,15 +7,15 @@ X - pivoting X - portfwd command - networking X - switch board routing table for pivoting - - meterpreter 'comm' support +X - meterpreter 'comm' support - proxy 'comm' support - asm - block dependencies (req'd for shikata) - block permutation generation (req'd for shikata) - text - - create_pattern, pattern_offset - - base64 - - consider extending String +X - create_pattern, pattern_offset +X - base64 +X - consider extending String - framework-core - modules - reloading @@ -25,7 +25,7 @@ X - switch board routing table for pivoting - meta information - stager/stage calling conventions - stack requirements - - make payload prepend target specific +X - make payload prepend target specific - sessions - logging session activity - handler sharing diff --git a/lib/msf/core/exploit.rb b/lib/msf/core/exploit.rb index bc21d30fb3..3d2747e1d6 100644 --- a/lib/msf/core/exploit.rb +++ b/lib/msf/core/exploit.rb @@ -339,7 +339,11 @@ class Exploit < Msf::Module # and platform if it's a multi exploit. # def payload_prepend(payload_module) - payload_info['Prepend'] || '' + if (target and target['PayloadPrepend']) + target['PayloadPrepend'] + else + payload_info['Prepend'] || '' + end end # @@ -348,7 +352,11 @@ class Exploit < Msf::Module # and platform if it's a multi exploit. # def payload_append(payload_module) - payload_info['Append'] || '' + if (target and target['PayloadAppend']) + target['PayloadAppend'] + else + payload_info['Append'] || '' + end end # @@ -357,7 +365,11 @@ class Exploit < Msf::Module # at architecture and platform if it's a multi exploit. # def payload_prepend_encoder(payload_module) - payload_info['PrependEncoder'] || '' + if (target and target['PayloadEncoder']) + target['PayloadEncoder'] + else + payload_info['PrependEncoder'] || '' + end end # @@ -365,7 +377,11 @@ class Exploit < Msf::Module # Nil signifies that the framework should decide. # def payload_max_nops - payload_info['MaxNops'] || nil + if (target and target['PayloadMaxNops']) + target['PayloadMaxNops'] + else + payload_info['MaxNops'] || nil + end end # @@ -373,14 +389,20 @@ class Exploit < Msf::Module # Nil snigifies that the framework should decide. # def payload_min_nops - payload_info['MinNops'] || nil + if (target and target['PayloadMinNops']) + target['PayloadMinNops'] + else + payload_info['MinNops'] || nil + end end # # Returns the maximum amount of room the exploit has for a payload. # def payload_space - if (payload_info['Space']) + if (target and target['PayloadSpace']) + target['PayloadSpace'] + elsif (payload_info['Space']) payload_info['Space'].to_i else nil diff --git a/lib/rex/socket/comm.rb b/lib/rex/socket/comm.rb index 3a21f94043..29efbaa735 100644 --- a/lib/rex/socket/comm.rb +++ b/lib/rex/socket/comm.rb @@ -21,6 +21,16 @@ module Comm raise NotImplementedError end + # + # Indicates whether or not this comm can be chained with other chainable + # comms. This is particularly important for things like Proxy Comms that + # can be proxied through one another. The semantics of this are currently + # undefined and will probably need some more thought. + # + def chainable? + false + end + end end