From fb6b993492530895173ed576e76a17a5e55f3140 Mon Sep 17 00:00:00 2001 From: Jonathan Cran Date: Fri, 13 Aug 2010 06:11:10 +0000 Subject: [PATCH] added validation for the route command - thanks robin wood git-svn-id: file:///home/svn/framework3/trunk@9992 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/ui/console/command_dispatcher/core.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 27c58e4533..257eed7785 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -783,6 +783,18 @@ class Core return false end + # Satisfy check to see that formatting is correct + unless Rex::Socket::RangeWalker.new(args[0]).length == 1 + print_error "Invalid IP Address" + return false + end + + unless Rex::Socket::RangeWalker.new(args[1]).length == 1 + print_error "Invalid Subnet mask" + return false + end + + gw = nil # Satisfy case problems @@ -816,6 +828,19 @@ class Core return false end + + # Satisfy check to see that formatting is correct + unless Rex::Socket::RangeWalker.new(args[0]).length == 1 + print_error "Invalid IP Address" + return false + end + + unless Rex::Socket::RangeWalker.new(args[1]).length == 1 + print_error "Invalid Subnet mask" + return false + end + + gw = nil # Satisfy case problems