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

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


Author: jan
Date: 2011-11-24 10:48:04 +0100 (Thu, 24 Nov 2011)
New Revision: 12177

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/gb_evolution_data_server_detect.nasl
   trunk/openvas-plugins/scripts/gb_gzip_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_openssl_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_samba_detect.nasl
   trunk/openvas-plugins/scripts/secpod_ghostscript_detect_lin.nasl
   trunk/openvas-plugins/scripts/secpod_isc_dhcp_client_detect.nasl
   trunk/openvas-plugins/scripts/secpod_kde_konqueror_detect.nasl
   trunk/openvas-plugins/scripts/secpod_xpdf_detect.nasl
   trunk/openvas-plugins/scripts/slad_run.nasl
Log:
* 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
to CR#57. Also fixed bug of too early exit.

* scripts/gb_samba_detect.nasl: Revised according to CR#57.

* scripts/secpod_kde_konqueror_detect.nasl,
scripts/secpod_isc_dhcp_client_detect.nasl,
scripts/gb_openssl_detect_lin.nasl: Removed left-over security message.

* scripts/slad_run.nasl: Shorter code in description text. Added
cvss tag of 0.



Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/ChangeLog	2011-11-24 09:48:04 UTC (rev 12177)
@@ -1,3 +1,19 @@
+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
+	to CR#57. Also fixed bug of too early exit.
+
+	* scripts/gb_samba_detect.nasl: Revised according to CR#57.
+
+	* scripts/secpod_kde_konqueror_detect.nasl,
+	scripts/secpod_isc_dhcp_client_detect.nasl,
+	scripts/gb_openssl_detect_lin.nasl: Removed left-over security message.
+
+	* scripts/slad_run.nasl: Shorter code in description text. Added
+	cvss tag of 0.
+
 2011-11-23 Antu Sanadi <santu at secpod.com>
 
 	* scripts/secpod_google_chrome_v8_remote_code_exec_vuln_win.nasl,

Modified: trunk/openvas-plugins/scripts/gb_evolution_data_server_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_evolution_data_server_detect.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/gb_evolution_data_server_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -7,6 +7,9 @@
 # Authors:
 # Sujit Ghosal <sghosal at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-23
+# Revised to comply with Change Request #57.
+#
 # Copyright:
 # Copyright (c) 2009 Greenbone Networks GmbH, http://www.greenbone.net
 #
@@ -24,63 +27,60 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.800253";
+
 if(description)
 {
-  script_id(800253);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-03-18 14:25:01 +0100 (Wed, 18 Mar 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("Evolution Data Server Version Detection (Linux)");
-  desc = "
+  script_description("Detection of installed version of Evolution.
 
-  Overview: The script detects the version of Evolution and sets the result
-  in KB.";
-
-  script_description(desc);
-  script_summary("Check for Evolution version");
+The script logs in via ssh, searches for executable 'evolution' and
+queries the found executables via command line option '--version'.");
+  script_summary("Detection of installed version of Evolution");
   script_category(ACT_GATHER_INFO);
   script_copyright("Copyright (C) 2009 Greenbone Networks GmbH");
-  script_family("General");
+  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.800253";
-SCRIPT_DESC = "Evolution Data Server 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);
 }
 
 evolution = find_file(file_name:"evolution", file_path:"/", useregex:TRUE,
                      regexpar:"$", sock:sock);
 
-foreach binaryName (evolution)
+foreach executableFile (evolution)
 {
-  binaryName = chomp(binaryName);
-  evolutionVer = get_bin_version(full_prog_name:binaryName, version_argv:"--version",
+  executableFile = chomp(executableFile);
+  evolutionVer = get_bin_version(full_prog_name:executableFile, version_argv:"--version",
                               ver_pattern:"evolution ([0-9.]+)", sock:sock);
   if(evolutionVer[1] != NULL)
   {
     set_kb_item(name:"Evolution/Ver", value:evolutionVer[1]);
-    security_note(data:"Evolution Data Server version " + evolutionVer[1] +
-                  " running at location " + binaryName + " was detected on the host");
-    ssh_close_connection();
+    log_message(data:'Detected Evolution Data Server version: ' + evolutionVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + evolutionVer[max_index(evolutionVer)-1]);
     
-    ## build cpe and store it as host_detail
     cpe = build_cpe(value:evolutionVer[1], exp:"^([0-9.]+)", base:"cpe:/a:gnome:evolution:");
     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/gb_gzip_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_gzip_detect_lin.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/gb_gzip_detect_lin.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -7,6 +7,9 @@
 # Authors:
 # Antu Sanadi <santu at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-24
+# Revised to comply with Change Request #57.
+#
 # Copyright:
 # Copyright (c) 2010 Greenbone Networks GmbH, http://www.greenbone.net
 #
@@ -24,60 +27,58 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.800450";
+
 if(description)
 {
-  script_id(800450);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2010-02-04 12:53:38 +0100 (Thu, 04 Feb 2010)");
   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("GZip Version Detection (Linux)");
-  desc = "
-  Overview: This script detect the installed version of GZip and sets the
-  result in KB.";
+  script_description("Detection of installed version of GZip.
 
-  script_description(desc);
-  script_summary("Set KB for the version of GZip");
+The script logs in via ssh, searches for executable 'gzip' and
+queries the found executables via command line option '--version'.");
+  script_summary("Detection of installed version of GZip");
   script_category(ACT_GATHER_INFO);
   script_copyright("Copyright (c) 2010 Greenbone Networks GmbH");
-  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.800450";
-SCRIPT_DESC = "GZip 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);
 }
 
 paths = find_bin(prog_name:"gzip", sock:sock);
-foreach gzipbin (paths)
+foreach executableFile (paths)
 {
-  gzipVer = get_bin_version(full_prog_name:chomp(gzipbin), sock:sock,
+  gzipVer = get_bin_version(full_prog_name:chomp(executableFile), sock:sock,
                               version_argv:"--version",
                               ver_pattern:"gzip ([0-9.]+)");
   if(gzipVer[1] != NULL)
   {
     set_kb_item(name:"GZip/Linux/Ver", value:gzipVer[1]);
-    security_note(data:"GZip version " + gzipVer[1] + " running at location "
-                       + gzipbin + " was detected on the host");
-    ssh_close_connection();
+    log_message(data:'Detected GZip version: ' + gzipVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + gzipVer[max_index(gzipVer)-1]);
       
-    ## build cpe and store it as host_detail
     cpe = build_cpe(value:gzipVer[1], exp:"^([0-9.]+)", base:"cpe:/a:gnu:gzip:");
     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/gb_openssl_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_openssl_detect_lin.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/gb_openssl_detect_lin.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -71,8 +71,6 @@
   if(sslVer[1] != NULL)
   {
     set_kb_item(name:"OpenSSL/Linux/Ver", value:sslVer[1]);
-    security_note(data:"OpenSSL version " + sslVer[1] + " running at location " 
-                         + executableFile + " was detected on the host");
     log_message(data:'Detected OpenSSL version: ' + sslVer[1] +
         '\nLocation: ' + executableFile +
         '\n\nConcluded from version identification result:\n' + sslVer[max_index(sslVer)-1]);

Modified: trunk/openvas-plugins/scripts/gb_samba_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_samba_detect.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/gb_samba_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -11,6 +11,9 @@
 # Date: 8th May 2009
 # Changes: Changed the command from smbd to smbclient and Modified Regex
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-24
+# Revised to comply with Change Request #57.
+#
 # Copyright:
 # Copyright (c) 2009 Greenbone Networks GmbH, http://www.greenbone.net
 #
@@ -28,51 +31,57 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.800403";
 
 if(description)
 {
-  script_id(800403);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-01-09 13:48:55 +0100 (Fri, 09 Jan 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("Samba Version Detection");
-  desc = "
+  script_description("Detection of installed version of Samba.
 
-  Overview: The script detects the version of Samba and sets the value in KB.";
-
-  script_description(desc);
-  script_summary("Set the KB for the version of Samba");
+The script logs in via ssh, searches for executable 'smbd' and
+queries the found executables via command line option '-V'.");
+  script_summary("Detection of installed version of Samba");
   script_category(ACT_GATHER_INFO);
   script_copyright("Copyright (C) 2009 Greenbone Networks GmbH");
-  script_family("General");
+  script_family("Product detection");
   exit(0);
 }
 
-
 include("ssh_func.inc");
 include("version_func.inc");
 
 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);
 }
 
 smbName = find_file(file_name:"smbd", file_path:"/", useregex:TRUE,
                     regexpar:"$", sock:sock);
-foreach binaryName (smbName)
+foreach executableFile (smbName)
 {
-  binaryName = chomp(binaryName);
-  smbVer = get_bin_version(full_prog_name:binaryName, version_argv:"-V",
+  executableFile = chomp(executableFile);
+  smbVer = get_bin_version(full_prog_name:executableFile, version_argv:"-V",
                            ver_pattern:"Version (.*)", sock:sock);
   smbVer = split(smbVer[1], "\n", keep:0);
   if(smbVer[0] != NULL)
   {
     set_kb_item(name:"Samba/Version", value:smbVer[0]);
-    security_note(data:"Samba version " + smbVer[0] + " running at location " 
-                  + binaryName + " was detected on the host");
-    ssh_close_connection();
-    exit(0);
+    log_message(data:'Detected Samba version: ' + smbVer[0] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + smbVer[max_index(smbVer)-1]);
+
+#    cpe = build_cpe(value:gzipVer[1], exp:"^([0-9.]+)", base:"cpe:/a:TODO:TODO:");
+#    if(!isnull(cpe))
+#      register_product(cpe:cpe, location:executableFile, nvt:SCRIPT_OID);
   }
 }
 ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/secpod_ghostscript_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/secpod_ghostscript_detect_lin.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/secpod_ghostscript_detect_lin.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -7,6 +7,9 @@
 # Authors:
 # Nikita MR <rnikita at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-24
+# Revised to comply with Change Request #57.
+#
 # Copyright:
 # Copyright (c) 2009 SecPod, http://www.secpod.com
 #
@@ -24,62 +27,59 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900541";
+
 if(description)
 {
-  script_id(900541);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-04-28 07:58:48 +0200 (Tue, 28 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("Ghostscript Version Detection (Linux)");
-  desc = "
+  script_description("Detection of installed version of Ghostscript.
 
-  Overview: This script detects the installed version of Ghostscript and
-  sets the result in KB.";
-
-  script_description(desc);
-  script_summary("Sets KB for Version of Ghostscript");
+The script logs in via ssh, searches for executable 'gs' and
+queries the found executables via command line option '--version'.");
+  script_summary("Detection of installed version of Ghostscript");
   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.900541";
-SCRIPT_DESC = "Ghostscript 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);
 }
 
 gsName = find_file(file_name:"gs", file_path:"/", useregex:TRUE,
                    regexpar:"$", sock:sock);
-foreach binary_gsName(gsName)
+foreach executableFile(gsName)
 {
-  binary_name = chomp(binary_gsName);
-  gsVer = get_bin_version(full_prog_name:binary_name, version_argv:"--version",
+  executableFile = chomp(executableFile);
+  gsVer = get_bin_version(full_prog_name:executableFile, version_argv:"--version",
                           ver_pattern:"([0-9]\.[0-9.]+)", sock:sock);
   if(gsVer[0] != NULL)
   {
     set_kb_item(name:"Ghostscript/Linux/Ver", value:gsVer[0]);
-    security_note(data:"Ghostscript version " + gsVer[0] +
-         " running at location " + binary_name + " was detected on the host");
-    ssh_close_connection();
+    log_message(data:'Detected Ghostscript version: ' + gsVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + gsVer[max_index(gsVer)-1]);
 
-    ## build cpe and store it as host_detail
     cpe = build_cpe(value:gsVer[0], exp:"^([0-9.]+)", base:"cpe:/a:ghostscript:ghostscript:");
     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/secpod_isc_dhcp_client_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/secpod_isc_dhcp_client_detect.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/secpod_isc_dhcp_client_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -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,66 +27,65 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900696";
+
 if(description)
 {
-  script_id(900696);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-07-23 21:05:26 +0200 (Thu, 23 Jul 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("ISC DHCP Client Version Detection");
-  desc  = "
+  script_description("Detection of installed version of ISC DHCP Client.
 
-  Overview: This script detects the installed version of ISC DHCP Client
-  and sets the result in KB.";
-
-  script_description(desc);
-  script_summary("Sets KB for the version of DHCP Client");
+The script logs in via ssh, searches for executable 'dhclient' and
+queries the found executables via command line option '--version'.");
+  script_summary("Detection of installed version of ISC DHCP Client");
   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.900696";
-SCRIPT_DESC = "ISC DHCP Client Version Detection";
-
 dhcp_sock = ssh_login_or_reuse_connection();
 if(!dhcp_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:"dhclient", sock:dhcp_sock);
-foreach dhcpBin (paths)
+foreach executableFile (paths)
 {
-   dhcpVer= get_bin_version(full_prog_name:chomp(dhcpBin),
-            sock:dhcp_sock, version_argv:"--version",
-            ver_pattern:"([0-9.]+)(-| )?((alpha|beta|rc|[a-z][0-9])?([0-9]+)?)");
+  dhcpVer = get_bin_version(full_prog_name:chomp(executableFile),
+              sock:dhcp_sock, version_argv:"--version",
+              ver_pattern:"([0-9.]+)(-| )?((alpha|beta|rc|[a-z][0-9])?([0-9]+)?)");
 
-   if(("isc-dhclient" >< dhcpVer) && (dhcpVer[1] != NULL))
-   {
-     if(dhcpVer[3] != NULL){
-       dhcpVer = dhcpVer[1] + "." + dhcpVer[3];
-     }
-     else
-       dhcpVer = dhcpVer[1];
+  if(("isc-dhclient" >< dhcpVer) && (dhcpVer[1] != NULL))
+  {
+    if(dhcpVer[3] != NULL){
+      Ver = dhcpVer[1] + "." + dhcpVer[3];
+    }
+    else
+      Ver = dhcpVer[1];
    
-     set_kb_item(name:"ISC/DHCP-Client/Ver", value:dhcpVer);
-     security_note(data:"ISC DHCP Client version " + dhcpVer +
-             " running at location " + dhcpBin + " was detected on the host");
+    set_kb_item(name:"ISC/DHCP-Client/Ver", value:Ver);
+    log_message(data:'Detected ISC DHCP Client version: ' + Ver +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + dhcpVer[max_index(dhcpVer)-1]);
     
-     ## build cpe and store it as host_detail
-     cpe = build_cpe(value:dhcpVer, exp:"^([0-9.]+([a-z0-9]+)?)", base:"cpe:/a:isc:dhcp:");
-     if(!isnull(cpe))
-        register_host_detail(name:"App", value:cpe, nvt:SCRIPT_OID, desc:SCRIPT_DESC);
-
+    cpe = build_cpe(value:Ver, exp:"^([0-9.]+([a-z0-9]+)?)", base:"cpe:/a:isc:dhcp:");
+    if(!isnull(cpe))
+      register_product(cpe:cpe, location:executableFile, nvt:SCRIPT_OID);
   }
 }
+
 ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/secpod_kde_konqueror_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/secpod_kde_konqueror_detect.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/secpod_kde_konqueror_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -7,6 +7,9 @@
 # Authors:
 # Nikita MR <rnikita at secpod.com>
 #
+# Updated by: <jan-oliver.wagner at greenbone.net> on 2011-11-22
+# Revised to comply with Change Request #57.
+#
 # Copyright (c) 2009 SecPod, http://www.secpod.com
 #
 # This program is free software; you can redistribute it and/or modify
@@ -23,67 +26,65 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 ###############################################################################
 
+SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900902";
+
 if(description)
 {
-  script_id(900902);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-07-31 07:37:13 +0200 (Fri, 31 Jul 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("KDE Konqueror Version Detection");
-  desc = "
+  script_description("Detection of installed version of KDE Konqueror.
 
-  Overview:  This script finds the installed version of KDE
-  Konqueror and saves the version in KB.";
-
-  script_description(desc);
-  script_summary("Set version of Konqueror in KB");
+The script logs in via ssh, searches for executable 'konqueror' and
+queries the found executables via command line option '-v'.");
+  script_summary("Detection of installed version of KDE Konqueror");
   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.900902";
-SCRIPT_DESC = "KDE Konqueror 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);
 }
 
 konqerName = find_file(file_name:"konqueror", file_path:"/", useregex:TRUE,
                        regexpar:"$", sock:sock);
-foreach binaryName (konqerName)
+foreach executableFile (konqerName)
 {
-  binaryName = chomp(binaryName);
-  konqerVer = get_bin_version(full_prog_name:binaryName, version_argv:"-v",
+  konqerVer = get_bin_version(full_prog_name:chomp(executableFile), version_argv:"-v",
                  ver_pattern:"Konqueror: ([0-9.]+).?((rc|RC)?[0-9]+)?", sock:sock);
 
   if(konqerVer[1] != NULL)
   {
     if(konqerVer[2] != NULL){
-       konqerVer = konqerVer[1] + "." + konqerVer[2];
+       Ver = konqerVer[1] + "." + konqerVer[2];
      }
     else
-      konqerVer = konqerVer[1];
+      Ver = konqerVer[1];
 
-    set_kb_item(name:"KDE/Konqueror/Ver", value:konqerVer);
-    security_note(data:"KDE Konqueror version " + konqerVer +
-          " running at location " + binaryName + " was detected on the host");
+    set_kb_item(name:"KDE/Konqueror/Ver", value:Ver);
+    log_message(data:'Detected KDE Konqueror version: ' + Ver +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + konqerVer[max_index(konqerVer)-1]);
       
-    ## build cpe and store it as host_detail
-    cpe = build_cpe(value:konqerVer, exp:"Konqueror: ([0-9.]+)", base:"cpe:/a:kde:konqueror:");
+    cpe = build_cpe(value:Ver, exp:"Konqueror: ([0-9.]+)", base:"cpe:/a:kde:konqueror:");
     if(!isnull(cpe))
-       register_host_detail(name:"App", value:cpe, nvt:SCRIPT_OID, desc:SCRIPT_DESC);
-
+      register_product(cpe:cpe, location:executableFile, nvt:SCRIPT_OID);
   }
 }
+
 ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/secpod_xpdf_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/secpod_xpdf_detect.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/secpod_xpdf_detect.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -7,6 +7,9 @@
 # Authors:
 # Sujit Ghosal <sghosal 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,24 +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.900466";
+
 if(description)
 {
-  script_id(900466);
+  script_oid(SCRIPT_OID);
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2009-05-06 08:04:28 +0200 (Wed, 06 May 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("Xpdf Version Detection");
-  desc = "
+  script_description("Detection of installed version of Xpdf.
 
-  Overview: The script detects the version of Xpdf for Linux on
-  remote host and sets the result into KB.";
-
-  script_description(desc);
-  script_summary("Check for Linux Xpdf version");
+The script logs in via ssh, searches for executable 'xpdf' and
+queries the found executables via command line option '-v'.");
+  script_summary("Detection of installed version of Xpdf");
   script_category(ACT_GATHER_INFO);
   script_copyright("Copyright (C) 2009 SecPod");
-  script_family("Service detection");
+  script_family("Product detection");
   exit(0);
 }
 
@@ -50,35 +55,31 @@
 include("cpe.inc");
 include("host_details.inc");
 
-## Constant values
-SCRIPT_OID  = "1.3.6.1.4.1.25623.1.0.900466";
-SCRIPT_DESC = "Xpdf 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);
 }
 
 xpdfPaths = find_file(file_name:"xpdf", file_path:"/", useregex:TRUE,
                        regexpar:"$", sock:sock);
-foreach xpdfBin (xpdfPaths)
+foreach executableFile (xpdfPaths)
 {
-  xpdfVer = get_bin_version(full_prog_name:chomp(xpdfBin), sock:sock,
+  xpdfVer = get_bin_version(full_prog_name:chomp(executableFile), sock:sock,
                             version_argv:"-v",
                             ver_pattern:"xpdf version ([0-9]\.[0-9]+([a-z]?))");
   if(xpdfVer[1] != NULL)
   {
     set_kb_item(name:"Xpdf/Linux/Ver", value:xpdfVer[1]);
-    security_note(data:"Xpdf version " + xpdfVer[1] + " running at " +
-                       "location " + xpdfBin + " was detected on the host");
-    ssh_close_connection();
+    log_message(data:'Detected Xpdf version: ' + xpdfVer[1] +
+        '\nLocation: ' + executableFile +
+        '\n\nConcluded from version identification result:\n' + xpdfVer[max_index(xpdfVer)-1]);
    
-    ## build cpe and store it as host_detail
     cpe = build_cpe(value:xpdfVer[1], exp:"^([0-9.]+([a-z0-9]+)?)", base:"cpe:/a:foolabs:xpdf:");
     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/slad_run.nasl
===================================================================
--- trunk/openvas-plugins/scripts/slad_run.nasl	2011-11-23 18:48:10 UTC (rev 12176)
+++ trunk/openvas-plugins/scripts/slad_run.nasl	2011-11-24 09:48:04 UTC (rev 12177)
@@ -34,11 +34,9 @@
   script_version("$Revision$");
   script_tag(name:"last_modification", value:"$Date$");
   script_tag(name:"creation_date", value:"2007-07-31 16:52:22 +0200 (Tue, 31 Jul 2007)");
-  name = "SLAD Run";
-
-  script_name(name);
+  script_name("SLAD Run");
   script_tag(name:"risk_factor", value:"None");
-
+  script_tag(name:"cvss_base", value:"0.0");
   desc = "
 This script connects to SLAD on a remote host to run
 remote scanners.
@@ -49,14 +47,10 @@
 
   script_description(desc);
 
-  summary = "Connects to SLAD to run programs remotely";
-  script_summary(summary);
-
+  script_summary("Connects to SLAD to run programs remotely");
   script_category(ACT_GATHER_INFO);
-
   script_copyright("Copyright (C) 2005 Greenbone Networks GmbH");
-  family = "General";
-  script_family(family);
+  script_family("General");
 
   script_dependencies ("find_service.nes", "ssh_authorization.nasl");
   script_require_ports (22, "Services/ssh");



More information about the Openvas-commits mailing list