diff --git a/lib/msf/core/exploit/ftpserver.rb b/lib/msf/core/exploit/ftpserver.rb index 1469d3b991..b07fd62f27 100644 --- a/lib/msf/core/exploit/ftpserver.rb +++ b/lib/msf/core/exploit/ftpserver.rb @@ -22,7 +22,8 @@ module Exploit::Remote::FtpServer # Register the options that all FTP exploits may make use of. register_options( [ - OptPort.new('SRVPORT', [ true, "The local port to listen on.", 21 ]) + OptPort.new('SRVPORT', [ true, "The local port to listen on.", 21 ]), + OptPort.new('PASVPORT', [ false, "The local PASV data port to listen on (0 is random)", 0 ]) ], Msf::Exploit::Remote::FtpServer) end @@ -172,7 +173,7 @@ module Exploit::Remote::FtpServer if(not @state[c][:passive_sock]) s = Rex::Socket::TcpServer.create( 'LocalHost' => '0.0.0.0', - 'LocalPort' => 0, + 'LocalPort' => datastore['PASVPORT'].to_i, 'Context' => { 'Msf' => framework, 'MsfExploit' => self } )