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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 21 20:48:40 CET 2011


Author: jan
Date: 2011-11-21 20:48:35 +0100 (Mon, 21 Nov 2011)
New Revision: 12154

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/gb_java_prdts_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_wireshark_detect_lin.nasl
   trunk/openvas-plugins/scripts/nikto.nasl
Log:
* scripts/gb_wireshark_detect_lin.nasl: Reworked according to CR#57.
Also fixed a bug of too early exit.

* scripts/nikto.nasl: Set CVSS to 0.0.

* scripts/gb_java_prdts_detect_lin.nasl: Add missing detection tag.



Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2011-11-21 19:31:15 UTC (rev 12153)
+++ trunk/openvas-plugins/ChangeLog	2011-11-21 19:48:35 UTC (rev 12154)
@@ -1,3 +1,12 @@
+2011-11-21  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+
+	* scripts/gb_wireshark_detect_lin.nasl: Reworked according to CR#57.
+	Also fixed a bug of too early exit.
+
+	* scripts/nikto.nasl: Set CVSS to 0.0.
+
+	* scripts/gb_java_prdts_detect_lin.nasl: Add missing detection tag.
+
 2011-11-21  Antu sanadi <santu at secpod.com>
 
 	* scripts/gb_CESA-2011_1455_freetype_centos4_i386.nasl,
@@ -55,7 +64,7 @@
 
 2011-11-21  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
 
-	* scripts/gb_java_prdts_detect_lin.nasl: Reworked according to CR#57.
+	* scripts/secpod_sun_virtualbox_detect_lin.nasl: Reworked according to CR#57.
 	- Replaced script_id() by script_oid() call and moved SCRIPT_OID to top.
 	- Added cvss_base tag of 0.0.
 	- Added detection tag.

Modified: trunk/openvas-plugins/scripts/gb_java_prdts_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_java_prdts_detect_lin.nasl	2011-11-21 19:31:15 UTC (rev 12153)
+++ trunk/openvas-plugins/scripts/gb_java_prdts_detect_lin.nasl	2011-11-21 19:48:35 UTC (rev 12154)
@@ -37,6 +37,7 @@
   script_tag(name:"creation_date", value:"2009-04-23 08:16:04 +0200 (Thu, 23 Apr 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("Sun Java Products Version Detection (Linux)");
   script_description("Detection of installed version of Java products
 on Linux systems. It covers Sun Java, IBM Java and GCJ.

Modified: trunk/openvas-plugins/scripts/gb_wireshark_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_wireshark_detect_lin.nasl	2011-11-21 19:31:15 UTC (rev 12153)
+++ trunk/openvas-plugins/scripts/gb_wireshark_detect_lin.nasl	2011-11-21 19:48:35 UTC (rev 12154)
@@ -7,8 +7,11 @@
 # Authors:
 # Chandan S <schandan at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-21
+# Revsied to comply with Change Request #57.
+#
 # Copyright:
-# Copyright (c) 2008 Greenbone Networks GmbH, http://www.greenbone.net
+# Copyright (c) 2008, 2011 Greenbone Networks GmbH, http://www.greenbone.net
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2
@@ -24,23 +27,26 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.800039";
+
 if(description)
 {
-  script_id(800039);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2008-10-24 15:11:55 +0200 (Fri, 24 Oct 2008)");
   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("Wireshark Version Detection (Linux)");
-  desc = "
-  Overview: This script finds the Wireshark installed version on Linux
-  and saves the version in KB.";
+  script_description("Detection of installed version of Wireshark.
 
-  script_description(desc);
-  script_summary("Set the Version of Wireshark in KB");
+The script logs in via ssh, searches for executable 'wireshark' and
+queries the found executables via command line option '-v'.");
+  script_summary("Detection of installed version of Wireshark");
   script_category(ACT_GATHER_INFO);
-  script_copyright("Copyright (C) 2008 Greenbone Networks GmbH");
-  script_family("General");
+  script_copyright("Copyright (C) 2008, 2011 Greenbone Networks GmbH");
+  script_family("Product detection");
   exit(0);
 }
 
@@ -49,34 +55,32 @@
 include("cpe.inc");
 include("host_details.inc");
 
-## Constant values
-SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.800039";
-SCRIPT_DESC = "Wireshark Version Detection (Linux)";
-
 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);
 }
 
 wiresharkName = find_file(file_name:"wireshark", file_path:"/", useregex:TRUE,
                           regexpar:"$", sock:sock);
-foreach binaryName (wiresharkName)
+foreach executableFile (wiresharkName)
 {
-  sharkVer = get_bin_version(full_prog_name:chomp(binaryName), version_argv:"-v",
+  sharkVer = get_bin_version(full_prog_name:chomp(executableFile), version_argv:"-v",
                              ver_pattern:"wireshark ([0-9.]+)", sock:sock);
   if(sharkVer)
   {
     set_kb_item(name:"Wireshark/Linux/Ver", value:sharkVer[1]);
-    security_note(data:"Wireshark version " + sharkVer[1] + 
-        " running at location " + binaryName + " was detected on the host");
+    log_message(data:'Detected Wireshark version: ' + sharkVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + sharkVer[max_index(sharkVer)-1]);
     ssh_close_connection();
    
     ## build cpe and store it as host_detail
     cpe = build_cpe(value:sharkVer[1], exp:"^([0-9.]+)", base:"cpe:/a:wireshark:wireshark:");
     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();

Modified: trunk/openvas-plugins/scripts/nikto.nasl
===================================================================
--- trunk/openvas-plugins/scripts/nikto.nasl	2011-11-21 19:31:15 UTC (rev 12153)
+++ trunk/openvas-plugins/scripts/nikto.nasl	2011-11-21 19:48:35 UTC (rev 12154)
@@ -29,6 +29,7 @@
  script_tag(name:"last_modification", value:"$Date$");
  script_tag(name:"creation_date", value:"2005-11-03 14:08:04 +0100 (Thu, 03 Nov 2005)");
  script_tag(name:"risk_factor", value:"None");
+ script_tag(name:"cvss_base", value:"0.0");
  name = "Nikto (NASL wrapper)";
  script_name(name);
  



More information about the Openvas-commits mailing list