From 8341facfd0992ee9eeeefd71b5c5d0dd81c73a96 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 1 Dec 2009 20:51:18 +0000 Subject: [PATCH] Add better help output and avoid an exception when no address range is specified git-svn-id: file:///home/svn/framework3/trunk@7661 4d416f70-5f16-0410-b530-b9f4589650da --- plugins/nexpose.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/nexpose.rb b/plugins/nexpose.rb index 044f6d176c..a75be0ebf4 100644 --- a/plugins/nexpose.rb +++ b/plugins/nexpose.rb @@ -120,7 +120,7 @@ class Plugin::Nexpose < Msf::Plugin end def cmd_nexpose_scan(*args) - return if not nexpose_verify + opts = Rex::Parser::Arguments.new( "-h" => [ false, "This help menu"], @@ -147,6 +147,7 @@ class Plugin::Nexpose < Msf::Plugin opts.parse(args) do |opt, idx, val| case opt when "-h" + print_line("Usage: nexpose_scan [options] ") print_line(opts.usage) return when "-t" @@ -168,8 +169,16 @@ class Plugin::Nexpose < Msf::Plugin end end + return if not nexpose_verify + opt_ranges = opt_ranges.join(",") + if(opt_ranges.strip.empty?) + print_line("Usage: nexpose_scan [options] ") + print_line(opts.usage) + return + end + if(opt_verbose) print_status("Creating a new scan using template #{opt_template} and #{opt_maxaddrs} concurrent IPs against #{opt_ranges}") end