Add another condition to check if the payload name is a reverse shell

Only reverse shells need LHOST
bug/bundler_fix
sinn3r 2014-02-24 15:37:01 -06:00
parent 47ae4b470a
commit 17f8cf900a
2 changed files with 3 additions and 4 deletions

View File

@ -118,10 +118,11 @@ rest.each do |x|
end
# if LHOST is not set auto set it
if options['LHOST'].nil?
if payload_name =~ /[\_\/]reverse/ and options['LHOST'].nil?
options['LHOST'] = Rex::Socket.source_address
end
payload.datastore.merge! options
if (cmd =~ /^(p|y|r|d|c|h|j|x|b|v|w|n)$/)

View File

@ -152,9 +152,7 @@ require 'msf/core/payload_generator'
k,v = x.split('=', 2)
datastore[k.upcase] = v.to_s
end
# if LHOST is not set auto set it
if datastore['LHOST'].nil?
if opts[:payload].to_s =~ /[\_\/]reverse/ and datastore['LHOST'].nil?
datastore['LHOST'] = Rex::Socket.source_address
end
end