From 13cc54cbe5e4c67847b7c98bba42454bf9000032 Mon Sep 17 00:00:00 2001 From: kris <> Date: Mon, 26 Jan 2009 03:06:58 +0000 Subject: [PATCH] Add -P source port option to connect git-svn-id: file:///home/svn/framework3/trunk@6184 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/ui/console/command_dispatcher/core.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index edcb0ebe05..5d00e9d5c2 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -45,6 +45,7 @@ class Core "-C" => [ false, "Try to use CRLF for EOL sequence." ], "-c" => [ true, "Specify which Comm to use." ], "-i" => [ true, "Send the contents of a file." ], + "-P" => [ true, "Specify source port." ], "-S" => [ true, "Specify source address." ], "-s" => [ false, "Connect with SSL." ], "-w" => [ true, "Specify connect timeout." ]) @@ -197,7 +198,8 @@ class Core commval = nil fileval = nil proxies = nil - source = nil + srcaddr = nil + srcport = nil ssl = false cto = nil aidx = 0 @@ -213,11 +215,14 @@ class Core when "-i" fileval = val aidx = idx + 2 + when "-P" + srcport = val + aidx = idx + 2 when "-p" proxies = val aidx = idx + 2 when "-S" - source = val + srcaddr = val aidx = idx + 2 when "-s" ssl = true @@ -281,7 +286,8 @@ class Core 'SSL' => ssl, 'PeerHost' => host, 'PeerPort' => port, - 'LocalHost' => source, + 'LocalHost' => srcaddr, + 'LocalPort' => srcport, 'Timeout' => cto }) rescue