Use LPORT if opts[:lport] is undefined

`nil.to_i` returns 0 which will short circuit the || resulting in port 0
being used. nil should be checked for prior to casting to int.
This commit is contained in:
Jon Cave 2015-11-26 16:08:22 +00:00
parent 920d8c6ad7
commit d9655fc882
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ module Msf::Payload::TransportConfig
{
:scheme => 'http',
:lhost => opts[:lhost] || datastore['LHOST'],
:lport => opts[:lport].to_i || datastore['LPORT'].to_i,
:lport => (opts[:lport] || datastore['LPORT']).to_i,
:uri => uri,
:comm_timeout => datastore['SessionCommunicationTimeout'].to_i,
:retry_total => datastore['SessionRetryTotal'].to_i,