Pymet patch in timeout info on generate_stage
parent
841fbddfc6
commit
29d45e3b18
|
@ -287,11 +287,6 @@ protected
|
|||
blob.sub!('HTTP_PROXY = None', "HTTP_PROXY = '#{var_escape.call(proxy_url)}'")
|
||||
end
|
||||
|
||||
blob.sub!('SESSION_EXPIRATION_TIMEOUT = 604800', "SESSION_EXPIRATION_TIMEOUT = #{datastore['SessionExpirationTimeout']}")
|
||||
blob.sub!('SESSION_COMMUNICATION_TIMEOUT = 300', "SESSION_COMMUNICATION_TIMEOUT = #{datastore['SessionCommunicationTimeout']}")
|
||||
blob.sub!('SESSION_RETRY_TOTAL = 3600', "SESSION_RETRY_TOTAL = #{datastore['SessionRetryTotal']}")
|
||||
blob.sub!('SESSION_RETRY_WAIT = 10', "SESSION_RETRY_WAIT = #{datastore['SessionRetryWait']}")
|
||||
|
||||
resp.body = blob
|
||||
|
||||
# Short-circuit the payload's handle_connection processing for create_session
|
||||
|
|
|
@ -22,14 +22,14 @@ module Metasploit3
|
|||
'Session' => Msf::Sessions::Meterpreter_Python_Python
|
||||
))
|
||||
register_advanced_options([
|
||||
OptBool.new('PythonMeterpreterDebug', [ true, "Enable debugging for the Python meterpreter", false ])
|
||||
OptBool.new('PythonMeterpreterDebug', [ true, 'Enable debugging for the Python meterpreter', false ])
|
||||
], self.class)
|
||||
end
|
||||
|
||||
def generate_stage(opts={})
|
||||
file = ::File.join(Msf::Config.data_directory, "meterpreter", "meterpreter.py")
|
||||
file = ::File.join(Msf::Config.data_directory, 'meterpreter', 'meterpreter.py')
|
||||
|
||||
met = ::File.open(file, "rb") {|f|
|
||||
met = ::File.open(file, 'rb') {|f|
|
||||
f.read(f.stat.size)
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,11 @@ module Metasploit3
|
|||
met = met.sub("DEBUGGING = False", "DEBUGGING = True")
|
||||
end
|
||||
|
||||
met.sub!('SESSION_EXPIRATION_TIMEOUT = 604800', "SESSION_EXPIRATION_TIMEOUT = #{datastore['SessionExpirationTimeout']}")
|
||||
met.sub!('SESSION_COMMUNICATION_TIMEOUT = 300', "SESSION_COMMUNICATION_TIMEOUT = #{datastore['SessionCommunicationTimeout']}")
|
||||
met.sub!('SESSION_RETRY_TOTAL = 3600', "SESSION_RETRY_TOTAL = #{datastore['SessionRetryTotal']}")
|
||||
met.sub!('SESSION_RETRY_WAIT = 10', "SESSION_RETRY_WAIT = #{datastore['SessionRetryWait']}")
|
||||
|
||||
uuid = opts[:uuid] || generate_payload_uuid
|
||||
bytes = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
|
||||
met = met.sub("PAYLOAD_UUID = \"\"", "PAYLOAD_UUID = \"#{bytes}\"")
|
||||
|
|
Loading…
Reference in New Issue