Author: chandra
Date: 2008-10-08 13:48:43 +0200 (Wed, 08 Oct 2008)
New Revision: 1494

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_lin.nasl
   trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_win.nasl
   trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl
   trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl
Log:
Fixed issues: to use the library functions available and reported FP

Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog     2008-10-08 10:48:18 UTC (rev 1493)
+++ trunk/openvas-plugins/ChangeLog     2008-10-08 11:48:43 UTC (rev 1494)
@@ -1,3 +1,10 @@
+2008-10-08 Chandrashekhar B <[EMAIL PROTECTED]>
+       * scripts/gb_adobe_prdts_detect_lin.nasl,
+         scripts/gb_adobe_prdts_code_exec_vuln_win.nasl,
+         scripts/gb_firefox_detect_lin.nasl,
+         scripts/gb_adobe_prdts_code_exec_vuln_lin.nasl:
+         Fixed issues
+
 2008-10-07 Chandrashekhar B <[EMAIL PROTECTED]>
        * scripts/gb_ms08-046.nasl,
          scripts/gb_php_detect.nasl,

Modified: trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_lin.nasl        
2008-10-08 10:48:18 UTC (rev 1493)
+++ trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_lin.nasl        
2008-10-08 11:48:43 UTC (rev 1494)
@@ -77,11 +77,16 @@
 }
 
 
-adobeVer = get_kb_item("Adobe/Reader/Linux/Ver");
+adobeVer = get_kb_item("Adobe/Reader/Linux/Version");
 if(!adobeVer){
   exit(0);
 }
 
-if(adobeVer =~ "^(7\.0(\.[0-9])?|(8\.0(\..*)?|8\.1(\.[0-2])?))$"){
+# Security Update 1 (SU1) is applied
+if(adobeVer =~ "8.1.2_SU[0-9]+"){
+  exit(0);
+}
+
+if(adobeVer =~ "^(7\.0(\.[0-9])?|8\.0(\..*)?|8\.1(\.[0-2])?)$"){
   security_hole(0);
 }

Modified: trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_win.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_win.nasl        
2008-10-08 10:48:18 UTC (rev 1493)
+++ trunk/openvas-plugins/scripts/gb_adobe_prdts_code_exec_vuln_win.nasl        
2008-10-08 11:48:43 UTC (rev 1494)
@@ -2,7 +2,7 @@
 # OpenVAS Vulnerability Test
 # $Id: gb_adobe_prdts_code_exec_vuln_win.nasl 298 2008-10-01 13:17:18Z oct $
 #
-# Adobe Reader/Acrobat JavaScript Method Handling Vulnerability
+# Adobe Reader/Acrobat JavaScript Method Handling Vulnerability (Windows)
 #
 # Authors:
 # Veerendra GG <[EMAIL PROTECTED]>
@@ -31,7 +31,7 @@
   script_cve_id("CVE-2008-2641");
   script_bugtraq_id(29908);
   script_xref(name:"CB-A", value:"08-0105");
-  script_name(english:"Adobe Reader/Acrobat JavaScript Method Handling 
Vulnerability");
+  script_name(english:"Adobe Reader/Acrobat JavaScript Method Handling 
Vulnerability (Windows)");
   desc["english"] = "
 
   Overview : This host has Adobe Reader/Acrobat installed, which is/are prone
@@ -105,10 +105,13 @@
       exit(0);
     }
 
-    if(adobeVer =~ "^(7\.0(\.[0-9])?|(8\.0(\..*)?|8\.1(\.[0-2])?))$")
-    {
-      security_hole(0);
+    if(adobeVer == "8.1.2" && adobeName =~ "Security Update ?[0-9]+"){
       exit(0);
     }
+
+    if(adobeVer =~ "^(7\.0(\.[0-9])?|8\.0(\..*)?|8\.1(\.[0-2])?)$"){
+      security_hole(0);
+    }
+    exit(0);
   }
 }

Modified: trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl        
2008-10-08 10:48:18 UTC (rev 1493)
+++ trunk/openvas-plugins/scripts/gb_adobe_prdts_detect_lin.nasl        
2008-10-08 11:48:43 UTC (rev 1494)
@@ -36,77 +36,23 @@
   Risk factor : Informational";
 
   script_description(english:desc["english"]);
-  script_summary(english:"Get/Set the versions of Adobe Products");
+  script_summary(english:"Set the Versions of Adobe Products");
   script_category(ACT_GATHER_INFO);
   script_copyright(english:"Copyright (C) 2008 Intevation GmbH");
   script_family(english:"General");
-  script_dependencies("gather-package-list.nasl");
-  script_require_keys("ssh/login/uname");
   exit(0);
 }
 
 
-include("ssh_func.inc");
+include("version_func.inc");
 
-if("Linux" >!< get_kb_item("ssh/login/uname")){
-  exit(0);
-}
-
-rpmLists = get_kb_list("ssh/*/rpms");
-foreach rpm (rpmLists)
+adobePath = find_file(file_name:"AcroVersion", file_path:"/");
+foreach path (adobePath)
 {
-  if("AdobeReader" >< rpm)
-  {
-    adobeVer = egrep(pattern:"AdobeReader.*$", string:rpm);
-    adobeVer = chomp(adobeVer);
-    adobeVer = ereg_replace(pattern:"AdobeReader_[a-z]+~([.0-9]*).*",
-                            string:adobeVer, replace:"\1");
-    if(adobeVer =~ "^[0-9](\.|[0-9]).*"){
-        set_kb_item(name:"Adobe/Reader/Linux/Ver", value:adobeVer);
-    }
-    exit(0);
+  path = chomp(path);
+  adobeMatch = 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]);
   }
 }
-
-sock = ssh_login_or_reuse_connection();
-if(!sock){
-       exit(0);
-}
-
-# If not RPM.
-acroPath = ssh_cmd(socket:sock, cmd:"locate -ir .*Reader/AcroVersion$",
-                   timeout:120);
-
-# If thorough test is on
-if("Reader/AcroVersion" >!< acroPath &&
-   "yes" >< get_kb_item("global_settings/thorough_tests"))
-{
-  cmd = "find / -maxdepth 7 -mindepth 3 -xdev -type f -path" +
-            " '*Reader/AcroVersion' -print";
-  acroPath = ssh_cmd(socket:sock, cmd:cmd, timeout:120);
-}
-
-if("Reader/AcroVersion" >!< acroPath)
-{
-  ssh_close_connection();
-  exit(0);
-}
-
-acroPath = split(acroPath);
-foreach path (acroPath)
-{
-  if(ssh_cmd(socket:sock, cmd:"test -f " + chomp(path) + " && echo $?",
-             timeout:120))
-  {
-    adobeVer = ssh_cmd(socket:sock, cmd:"cat " + chomp(path), timeout:120);
-    adobeVer = chomp(adobeVer);
-    adobeVer = ereg_replace(pattern:"([.0-9]*).*", string:adobeVer, 
replace:"\1");
-    if(adobeVer)
-    {
-      set_kb_item(name:"Adobe/Reader/Linux/Ver", value:adobeVer);
-      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-08 
10:48:18 UTC (rev 1493)
+++ trunk/openvas-plugins/scripts/gb_firefox_detect_lin.nasl    2008-10-08 
11:48:43 UTC (rev 1494)
@@ -45,44 +45,18 @@
 }
 
 
-include("ssh_func.inc");
+include("version_func.inc");
 
-sock = ssh_login_or_reuse_connection();
-if(!sock){
-  exit(0);
-}
-
-foxName = ssh_cmd(socket:sock, cmd:"firefox -v", timeout:120);
-if(foxName =~ "firefox.* not found")
+foxName = find_file(file_name:"firefox", file_path:"/");
+foreach binary_foxName (foxName)
 {
-  foxName = ssh_cmd(socket:sock, cmd:"locate -ir firefox$", timeout:120);
-  if("firefox" >< 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")
   {
-    foxName = split(foxName);
-    for(i = 0; i < max_index(foxName); i++)
-      path = path + chomp(foxName[i]) + " -v;";
-
-    foxName = ssh_cmd(socket:sock, cmd:path, timeout:120);
+    foxVer = eregmatch(pattern:"[0-9.]+", string:foxMatch[0]);
+    set_kb_item(name:"Firefox/Linux/Ver", value:foxVer[0]);
+    exit(0);
   }
-  else
-  {
-    # Search for Firefox thoroughly (slow).
-    if("yes" >< get_kb_item("global_settings/thorough_tests"))
-    {
-      command = "find / -mount -maxdepth 5 -mindepth 1 -type f -name " +
-                "'firefox' -exec '{}' '-v' ';'";
-      foxName = ssh_cmd(socket:sock, cmd:command, timeout:500);
-    }
-  }
 }
-
-# Firefox is branded as Iceweasel in Debian
-if(foxName =~ "Firefox|Iceweasel")
-{
-  foxName = egrep(pattern:"Mozilla.*Copyright.*mozilla\.org", string:foxName);
-  foxName = chomp(foxName);
-  foxVer = eregmatch(pattern:"[.0-9]+", string:foxName);
-  set_kb_item(name:"Firefox/Linux/Ver", value:foxVer[0]);
-}
-
-ssh_close_connection();

_______________________________________________
Openvas-commits mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-commits

Reply via email to