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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 13 15:11:47 CEST 2008


Author: chandra
Date: 2008-10-13 15:11:46 +0200 (Mon, 13 Oct 2008)
New Revision: 1532

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_seamonkey_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_thunderbird_detect_lin.nasl
Log:
Updated as per the modified version_func.inc

Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2008-10-13 13:10:54 UTC (rev 1531)
+++ trunk/openvas-plugins/ChangeLog	2008-10-13 13:11:46 UTC (rev 1532)
@@ -1,3 +1,10 @@
+2008-10-13 Chandrashekhar B <bchandra at secpod.com>
+	* scripts/gb_adobe_prdts_detect_lin.nasl,
+	  scripts/gb_firefox_detect_lin.nasl,
+	  scripts/gb_thunderbird_detect_lin.nasl,
+	  scripts/gb_seamonkey_detect_lin.nasl:
+	 Updated as per the modified version_func.inc
+
 2008-10-12  Carsten Koch-Mauthe <c.koch-mauthe at dn-systems.de>.
 
 	* scripts/version_func.inc: changed function find_file

Modified: trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl	2008-10-13 13:10:54 UTC (rev 1531)
+++ trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl	2008-10-13 13:11:46 UTC (rev 1532)
@@ -27,7 +27,7 @@
 if(description)
 {
   script_id(800108);
-  script_version("$Revision: 1.0 $");
+  script_version("$Revision: 1.1 $");
   script_name(english:"Adobe products version detection (Linux)");
   desc["english"] ="
   Overview : This script retrieves all Adobe Products version and saves
@@ -46,13 +46,23 @@
 
 include("version_func.inc");
 
-adobePath = find_file(file_name:"AcroVersion", file_path:"/");
+sock = ssh_login_or_reuse_connection();
+if(!sock){
+  exit(0);
+}
+
+adobePath = find_file(file_name:"AcroVersion", file_path:"/", useregex=TRUE,
+                      regexpar:"$", sock:sock);
 foreach path (adobePath)
 {
   path = chomp(path);
-  adobeMatch = get_bin_version(full_prog_name:"cat", version_argv:path,
+  adobeVer = get_bin_version(full_prog_name:"cat", version_argv:path,
                                ver_pattern:"[0-9.]+(_SU[0-9])?");
-  if(adobeMatch){
-    set_kb_item(name:"Adobe/Reader/Linux/Version", value:adobeMatch[0]);
+  if(adobeVer)
+  {
+    set_kb_item(name:"Adobe/Reader/Linux/Version", value:adobeVer[0]);
+    ssh_close_connection();
+    exit(0);
   }
 }
+ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl	2008-10-13 13:10:54 UTC (rev 1531)
+++ trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl	2008-10-13 13:11:46 UTC (rev 1532)
@@ -1,6 +1,6 @@
 ###############################################################################
 # OpenVAS Vulnerability Test
-# $Id: gb_firefox_detect_lin.nasl 302 2008-10-06 15:57:11Z oct $
+# $Id: gb_firefox_detect_lin.nasl 302 2008-10-13 15:57:11Z oct $
 #
 # Mozilla Firefox Version Detection (Linux)
 #
@@ -28,7 +28,7 @@
 if(description)
 {
   script_id(800017);
-  script_version("Revision: 1.1 ");
+  script_version("$Revision: 1.1 $");
   script_name(english:"Mozilla Firefox Version Detection (Linux)");
   desc["english"] = "
   Overview : This script finds the Mozilla Firefox installed version on Linux
@@ -45,18 +45,25 @@
 }
 
 
-include("version_func.inc");
+include("version_func.inc")
 
-foxName = find_file(file_name:"firefox", file_path:"/");
+sock = ssh_login_or_reuse_connection();
+if(!sock){
+  exit(0);
+}
+
+foxName = find_file(file_name:"firefox", file_path:"/", useregex:TRUE,
+                    regexpar:"$", sock:sock);
 foreach binary_foxName (foxName)
 {
   binary_name = chomp(binary_foxName);
-  foxMatch = get_bin_version(full_prog_name:binary_name, version_argv:"-v",
-                             ver_pattern:"Mozilla.*Copyright.*mozilla\.org");
-  if(foxMatch =~ "Firefox|Iceweasel")
+  foxVer = get_bin_version(full_prog_name:binary_name, version_argv:"-v",
+                           ver_pattern:"[0-9].[0-9.]+", sock:sock);
+  if(foxVer)
   {
-    foxVer = eregmatch(pattern:"[0-9.]+", string:foxMatch[0]);
     set_kb_item(name:"Firefox/Linux/Ver", value:foxVer[0]);
+    ssh_close_connection();
     exit(0);
   }
 }
+ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/gb_seamonkey_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_seamonkey_detect_lin.nasl	2008-10-13 13:10:54 UTC (rev 1531)
+++ trunk/openvas-plugins/scripts/gb_seamonkey_detect_lin.nasl	2008-10-13 13:11:46 UTC (rev 1532)
@@ -1,6 +1,6 @@
 ###############################################################################
 # OpenVAS Vulnerability Test
-# $Id: gb_seamonkey_detect_lin.nasl 302 2008-10-06 18:59:15Z oct $
+# $Id: gb_seamonkey_detect_lin.nasl 302 2008-10-13 18:59:15Z oct $
 #
 # Mozilla Seamonkey Version Detection (Linux)
 #
@@ -28,7 +28,7 @@
 if(description)
 {
   script_id(800019);
-  script_version("Revision: 1.1 ");
+  script_version("$Revision: 1.1 $");
   script_name(english:"Mozilla SeaMonkey Version Detection (Linux)");
   desc["english"] = "
   Overview : This script finds the Mozilla SeaMonkey installed version on
@@ -45,48 +45,29 @@
 }
 
 
-include("ssh_func.inc");
+include("version_func.inc");
 
 sock = ssh_login_or_reuse_connection();
 if(!sock){
   exit(0);
 }
 
-seaName = ssh_cmd(socket:sock, cmd:"seamonkey -v", timeout:120);
-if(seaName =~ "seamonkey.* not found"){
-  seaName = ssh_cmd(socket:sock, cmd:"iceape -v", timeout:120);
+seaName = find_file(file_name:"seamonkey", file_path:"/", useregex:TRUE,
+                    regexpar:"$", sock:sock);
+if(!seaName){
+  seaName = find_file(file_name:"iceape", file_path:"/", useregex:TRUE,
+                      regexpar:"$", sock:sock);
 }
-
-if(seaName =~ "iceape.* not found")
+foreach binary_seaName (seaName)
 {
-  seaName = ssh_cmd(socket:sock, cmd:"locate -ir seamonkey$", timeout:120);
-  if("seamonkey" >< seaName)
+  binary_name = chomp(binary_seaName);
+  seaVer = get_bin_version(full_prog_name:binary_name, version_argv:"-v",
+                           ver_pattern:"[0-9].[0-9.]+");
+  if(seaVer)
   {
-    seaName = split(seaName);
-    for(i = 0; i < max_index(seaName); i++)
-      path = path + chomp(seaName[i]) + " -v;";
-
-    seaName = ssh_cmd(socket:sock, cmd:path, timeout:120);
+    set_kb_item(name:"Seamonkey/Linux/Ver", value:seaVer[0]);
+    ssh_close_connection();
+    exit(0);
   }
-  else
-  {
-    # Check for Seamonkey thoroughly (slow).
-    if("yes" >< get_kb_item("global_settings/thorough_tests"))
-    {
-      command = "find / -mount -maxdepth 5 -mindepth 1 -type f -name " +
-                "'seamonkey' -exec '{}' '-v' ';'";
-      seaName = ssh_cmd(socket:sock, cmd:command, timeout:500);
-    }
-  }
 }
-
-# Seamonkey is branded as Iceape in Debian
-if(seaName =~ "Seamonkey|Iceape")
-{
-  seaName = egrep(pattern:"(SeaMonkey|Iceape).*Copyright.*mozilla\.org", string:seaName);
-  seaName = chomp(seaName);
-  seaVer = eregmatch(pattern:"[.0-9]+", string:seaName);
-  set_kb_item(name:"Seamonkey/Linux/Ver", value:seaVer[0]);
-}
-
 ssh_close_connection();

Modified: trunk/openvas-plugins/scripts/gb_thunderbird_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_thunderbird_detect_lin.nasl	2008-10-13 13:10:54 UTC (rev 1531)
+++ trunk/openvas-plugins/scripts/gb_thunderbird_detect_lin.nasl	2008-10-13 13:11:46 UTC (rev 1532)
@@ -1,6 +1,6 @@
 ###############################################################################
 # OpenVAS Vulnerability Test
-# $Id: gb_thunderbird_detect_lin.nasl 302 2008-10-06 18:10:37Z oct $
+# $Id: gb_thunderbird_detect_lin.nasl 302 2008-10-13 18:10:37Z oct $
 #
 # Mozilla Thunderbird Version Detection (Linux)
 #
@@ -28,7 +28,7 @@
 if(description)
 {
   script_id(800018);
-  script_version("Revision: 1.1 ");
+  script_version("$Revision: 1.1 $");
   script_name(english:"Mozilla Thunderbird Version Detection (Linux)");
   desc["english"] = "
   Overview : This script retrieves Mozilla ThunderBird Version and
@@ -45,44 +45,25 @@
 }
 
 
-include("ssh_func.inc");
+include("version_func.inc");
 
 sock = ssh_login_or_reuse_connection();
 if(!sock){
   exit(0);
 }
 
-birdName = ssh_cmd(socket:sock, cmd:"thunderbird -v", timeout:120);
-if(birdName =~ "thunderbird.* not found")
+birdName = find_file(file_name:"thunderbird", file_path:"/", useregex:TRUE,
+                     regexpar:"$", sock:sock);
+foreach binary_birdName (birdName)
 {
-  birdName = ssh_cmd(socket:sock, cmd:"locate -ir thunderbird$", timeout:120);
-  if("thunderbird" >< birdName)
+  binary_name = chomp(binary_birdName);
+  birdVer = get_bin_version(full_prog_name:binary_name, version_argv:"-v",
+                              ver_pattern:"[0-9].[0-9.]+", sock:sock);
+  if(birdVer)
   {
-    birdName = split(birdName);
-    for(i = 0; i < max_index(birdName); i++)
-      path = path + chomp(birdName[i]) + " -v;";
-
-    birdName = ssh_cmd(socket:sock, cmd:path, timeout:120);
+    set_kb_item(name:"Thunderbird/Linux/Ver", value:birdVer[0]);
+    ssh_close_connection();
+    exit(0);
   }
-  else
-  {
-    # Search for Thunderbird thoroughly (slow).
-    if("yes" >< get_kb_item("global_settings/thorough_tests"))
-    {
-      command = "find / -mount -maxdepth 5 -mindepth 1 -type f -name " +
-                "'thunderbird' -exec '{}' '-v' ';'";
-      birdName = ssh_cmd(socket:sock, cmd:command, timeout:500);
-    }
-  }
 }
-
-# Thunderbird is branded as Icedove in Debian
-if(birdName =~ "Thunderbird|Icedove")
-{
-  birdName = egrep(pattern:"Thunderbird.*Copyright.*mozilla\.org", string:birdName);
-  birdName = chomp(birdName);
-  birdVer = eregmatch(pattern:"[.0-9]+", string:birdName);
-  set_kb_item(name:"Thunderbird/Linux/Ver", value:birdVer[0]);
-}
-
 ssh_close_connection();



More information about the Openvas-commits mailing list