[Openvas-commits] r1460 - trunk/openvas-plugins/scripts

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 26 15:37:23 CEST 2008


Author: chandra
Date: 2008-09-26 15:37:21 +0200 (Fri, 26 Sep 2008)
New Revision: 1460

Modified:
   trunk/openvas-plugins/scripts/gb_vmware_prdts_detect_lin.nasl
Log:
Added a different means to detect VMPlayer

Modified: trunk/openvas-plugins/scripts/gb_vmware_prdts_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_vmware_prdts_detect_lin.nasl	2008-09-26 12:12:58 UTC (rev 1459)
+++ trunk/openvas-plugins/scripts/gb_vmware_prdts_detect_lin.nasl	2008-09-26 13:37:21 UTC (rev 1460)
@@ -51,14 +51,14 @@
   exit(0);
 }
 
-version = ssh_cmd(socket:sock, cmd:"vmware-config.pl -v", timeout:120);
+version = ssh_cmd(socket:sock, cmd:"vmware -v", timeout:120);
 
 if("VMware GSX Server" >< version)
 {
   gsxVer = ereg_replace(string:version, replace:"\1",
                         pattern:".*VMware GSX Server ([0-9].*) build.*");
   gsxBuild = ereg_replace(string:version, replace:"\1",
-                          pattern:".*VMware GSX Server [0-9].* build-([0-9]+) .*");
+                          pattern:".*VMware GSX Server [0-9].* build-([0-9]+).*");
 
   set_kb_item(name:"VMware/GSX-Server/Linux/Ver", value:gsxVer);
   set_kb_item(name:"VMware/GSX-Server/Linux/Build", value:chomp(gsxBuild));
@@ -73,7 +73,7 @@
   wrkstnVer = ereg_replace(string:version, replace:"\1",
                            pattern:".*VMware Workstation ([0-9].*) build.*");
   wrkstnBuild = ereg_replace(string:version, replace:"\1",
-                             pattern:".*VMware Workstation [0-9].* build-([0-9]+) .*");
+                             pattern:".*VMware Workstation [0-9].* build-([0-9]+).*");
 
   set_kb_item(name:"VMware/Workstation/Linux/Ver", value:wrkstnVer);
   set_kb_item(name:"VMware/Workstation/Linux/Build", value:chomp(wrkstnBuild));
@@ -88,7 +88,7 @@
   svrVer = ereg_replace(string:version, replace:"\1",
                         pattern:".*VMware Server ([0-9].*) build.*");
   svrBuild = ereg_replace(string:version, replace:"\1",
-                          pattern:".*VMware Server [0-9].* build-([0-9]+) .*");
+                          pattern:".*VMware Server [0-9].* build-([0-9]+).*");
 
   set_kb_item(name:"VMware/Server/Linux/Ver", value:svrVer);
   set_kb_item(name:"VMware/Server/Linux/Build", value:chomp(svrBuild));
@@ -98,18 +98,16 @@
   exit(0);
 }
 
-else if("VMware Player" >< version)
+version = ssh_cmd(socket:sock, cmd:"vmplayer -v", timeout:120);
+if(version !~ "vmplayer.* not found")
 {
-  playerVer = ereg_replace(pattern:".*VMware Player ([0-9].*) build.*",
-                           string:version, replace:"\1");
-  playerBuild = ereg_replace(string:version, replace:"\1",
-                             pattern:".*VMware Player [0-9].* build-([0-9]+) .*");
+  version = ssh_cmd(socket:sock, timeout:120,
+                    cmd:"cat /usr/bin/vmware-config.pl | grep -ir ' build-'");
+  playerVer = ereg_replace(pattern:".*'([0-9.]+) .*", string:version, replace:"\1");
+  playerBuild = ereg_replace(pattern:".*-([0-9]+)'.*", string:version, replace:"\1");
 
   set_kb_item(name:"VMware/Player/Linux/Ver", value:playerVer);
   set_kb_item(name:"VMware/Player/Linux/Build", value:chomp(playerBuild));
   set_kb_item(name:"VMware/Linux/Installed", value:TRUE);
-
-  ssh_close_connection();
-  exit(0);
 }
 ssh_close_connection();



More information about the Openvas-commits mailing list