Skip to content

Commit

Permalink
Make the TryToFork option generic
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Jun 24, 2017
1 parent 549ebb4 commit feb8d14
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/msf/core/payload/python/meterpreter_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def initialize(info = {})
))

register_advanced_options([
OptBool.new('PythonMeterpreterDebug', [ true, 'Enable debugging for the Python meterpreter', false ]),
OptBool.new('PythonMeterpreterTryToFork', [ true, 'Fork a new process if the functionality is available', true ])
OptBool.new('MeterpreterTryToFork', [ true, 'Fork a new process if the functionality is available', true ]),
OptBool.new('PythonMeterpreterDebug', [ true, 'Enable debugging for the Python meterpreter', false ])
], self.class)
end

Expand Down Expand Up @@ -62,11 +62,11 @@ def stage_meterpreter(opts={})
txt.gsub('\\', '\\'*8).gsub('\'', %q(\\\\\\\'))
}

if ds['PythonMeterpreterDebug']
met = met.sub('DEBUGGING = False', 'DEBUGGING = True')
unless ds['MeterpreterTryToFork']
met.sub!('TRY_TO_FORK = True', 'TRY_TO_FORK = False')
end
unless ds['PythonMeterpreterTryToFork']
met = met.sub('TRY_TO_FORK = True', 'TRY_TO_FORK = False')
if ds['PythonMeterpreterDebug']
met.sub!('DEBUGGING = False', 'DEBUGGING = True')
end

met.sub!('SESSION_EXPIRATION_TIMEOUT = 604800', "SESSION_EXPIRATION_TIMEOUT = #{ds['SessionExpirationTimeout']}")
Expand Down

0 comments on commit feb8d14

Please sign in to comment.