[Openvas-commits] r12178 - in trunk/openvas-plugins: . scripts

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 24 10:53:38 CET 2011


Author: jan
Date: 2011-11-24 10:53:31 +0100 (Thu, 24 Nov 2011)
New Revision: 12178

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/secpod_mutt_detect.nasl
Log:
* scripts/secpod_mutt_detect.nasl: Revised according
to CR#57. Also fixed bug of too early exit.


Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2011-11-24 09:48:04 UTC (rev 12177)
+++ trunk/openvas-plugins/ChangeLog	2011-11-24 09:53:31 UTC (rev 12178)
@@ -1,5 +1,10 @@
 2011-11-24  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
 
+	* scripts/secpod_mutt_detect.nasl: Revised according
+	to CR#57. Also fixed bug of too early exit.
+
+2011-11-24  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+
 	* scripts/secpod_ghostscript_detect_lin.nasl,
 	scripts/gb_gzip_detect_lin.nasl, scripts/secpod_xpdf_detect.nasl,
 	scripts/gb_evolution_data_server_detect.nasl: Revised according

Modified: trunk/openvas-plugins/scripts/secpod_mutt_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/secpod_mutt_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
+++ trunk/openvas-plugins/scripts/secpod_mutt_detect.nasl	2011-11-24 09:53:31 UTC (rev 12178)
@@ -7,6 +7,9 @@
 # Authors:
 # Antu Sanadi <santu at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-22
+# Revised to comply with Change Request #57.
+#
 # Copyright:
 # Copyright (c) 2009 SecPod, http://www.secpod.com
 #
@@ -24,60 +27,57 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900675";
+
 if(description)
 {
-  script_id(900675);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-06-24 07:17:25 +0200 (Wed, 24 Jun 2009)");
   script_tag(name:"risk_factor", value:"None");
+  script_tag(name:"cvss_base", value:"0.0");
+  script_tag(name:"detection", value:"executable version check");
   script_name("Mutt Version Detection");
-  desc = "
+  script_description("Detection of installed version of Mutt.
 
-  Overview: This script detects the installed version of Mutt and
-  sets the result in KB.";
-
-  script_description(desc);
-  script_summary("Sets KB for the version of Mutt");
+The script logs in via ssh, searches for executable 'mutt' and
+queries the found executables via command line option '-v'.");
+  script_summary("Detection of installed version of Mutt");
   script_category(ACT_GATHER_INFO);
   script_copyright("Copyright (C) 2009 SecPod");
-  script_family("Service detection");
+  script_family("Product detection");
   exit(0);
 }
 
-
 include("ssh_func.inc");
 include("version_func.inc");
 include("cpe.inc");
 include("host_details.inc");
 
-## Constant values
-SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900675";
-SCRIPT_DESC = "Mutt Version Detection";
-
 sock = ssh_login_or_reuse_connection();
 if(!sock){
-  exit(0);
+  if (defined_func("error_message"))
+    error_message(port:port, data:"Failed to open ssh port.");
+  exit(-1);
 }
 
 paths = find_bin(prog_name:"mutt", sock:sock);
-foreach muttbin (paths)
+foreach executableFile (paths)
 {
-  muttVer = get_bin_version(full_prog_name:chomp(muttbin), sock:sock,
-            version_argv:"-version", ver_pattern:"Mutt (([0-9.]+)([a-z])?)");
+  muttVer = get_bin_version(full_prog_name:chomp(executableFile), sock:sock,
+            version_argv:"-v", ver_pattern:"Mutt (([0-9.]+)([a-z])?)");
   if(muttVer[1] != NULL)
   {
     set_kb_item(name:"Mutt/Ver", value:muttVer[1]);
-    security_note(data:"Mutt version " + muttVer[1] + " running at location " +
-                        muttbin +  " was detected on the host");
-    ssh_close_connection();
+    log_message(data:'Detected Mutt version: ' + muttVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + muttVer[max_index(muttVer)-1]);
    
-    ## build cpe and store it as host_detail
     cpe = build_cpe(value:muttVer[1], exp:"^([0-9.]+)", base:"cpe:/a:mutt:mutt:");
     if(!isnull(cpe))
-       register_host_detail(name:"App", value:cpe, nvt:SCRIPT_OID, desc:SCRIPT_DESC);
-
-    exit(0);
+      register_product(cpe:cpe, location:executableFile, nvt:SCRIPT_OID);
   }
 }
+
 ssh_close_connection();



More information about the Openvas-commits mailing list