From bfef110932b15607321fdda2c19e549de774e4fe Mon Sep 17 00:00:00 2001 From: HD Moore Date: Thu, 14 Apr 2011 21:45:42 +0000 Subject: [PATCH] Add a compatibility check, prevents errors caused by interaction with out of date engines git-svn-id: file:///home/svn/framework3/trunk@12318 4d416f70-5f16-0410-b530-b9f4589650da --- plugins/nexpose.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/nexpose.rb b/plugins/nexpose.rb index 5a476e28b0..0a8c0871a8 100644 --- a/plugins/nexpose.rb +++ b/plugins/nexpose.rb @@ -112,7 +112,7 @@ class Plugin::Nexpose < Msf::Plugin # Wrap this so a duplicate session doesnt prevent a new login begin - cmd_nexpose_disconnect + cmd_nexpose_disconnect rescue ::Interrupt raise $! rescue ::Exception @@ -128,6 +128,8 @@ class Plugin::Nexpose < Msf::Plugin end @nsc = nsc + nexpose_compatibility_check + nsc end def cmd_nexpose_activity(*args) @@ -219,6 +221,15 @@ class Plugin::Nexpose < Msf::Plugin end end + def nexpose_compatibility_check + res = @nsc.console_command("ver") + if res !~ /^Console Version ID:\s*480\s*$/m + print_error("") + print_error("Warning: This version of NeXpose has not been tested with Metasploit!") + print_error("") + end + end + def cmd_nexpose_site_import(*args) site_id = args.shift if not site_id