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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 20 07:57:46 CET 2009


Author: chandra
Date: 2009-03-20 07:57:42 +0100 (Fri, 20 Mar 2009)
New Revision: 2854

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/ldapsearch.nasl
Log:
Fixed the false reporting issue

Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2009-03-20 06:08:52 UTC (rev 2853)
+++ trunk/openvas-plugins/ChangeLog	2009-03-20 06:57:42 UTC (rev 2854)
@@ -1,4 +1,8 @@
 2009-03-20 Chandrashekhar B <bchandra at secpod.com>
+	* scripts/ldapsearch.nasl:
+	Fixed the false reporting issue
+
+2009-03-20 Chandrashekhar B <bchandra at secpod.com>
 	* scripts/secpod_passwiki_dir_traversal_vuln.nasl,
 	scripts/secpod_bitdefender_prdts_detect.nasl,
 	scripts/secpod_opera_mult_vuln_mar09_win.nasl,

Modified: trunk/openvas-plugins/scripts/ldapsearch.nasl
===================================================================
--- trunk/openvas-plugins/scripts/ldapsearch.nasl	2009-03-20 06:08:52 UTC (rev 2853)
+++ trunk/openvas-plugins/scripts/ldapsearch.nasl	2009-03-20 06:57:42 UTC (rev 2854)
@@ -40,6 +40,7 @@
   exit(0);
 }  
 
+
 port = get_kb_item("Services/ldap");
 if (! port) port = 389;
 if (! get_port_state(port)) exit(0);
@@ -119,7 +120,7 @@
 
     if (type="null-base")
     {
-      security_hole(
+      security_warning(
         port: port,
         data: 'The LDAPserver allows null-binds and null-base requests.\n\n' 
       );
@@ -141,14 +142,25 @@
   }
 }
 
+function res_check(res)
+{
+  if(res =~ "(S|s)uccess" && "LDAPv" >< res){
+    return res;
+  }
+  else return(0);
+}
+
 #first do ldapsearch -h x.x.x.x -b '' -x -C -s base
 type = "null-base";
 value = '';
 args = scanopts(port,type,value);
 
-res = pread(cmd: "ldapsearch", argv: args, nice: 5);
+res = pread(cmd:"ldapsearch", argv: args, nice: 5);
+res = res_check(res);
 #this is insecure, but there's no other way to do this at the moment.
-makereport(res, type);
+if(res){
+  makereport(res, type);
+}
 
 #then ldapsearch -h x.x.x.x -b dc=X,dc=Y -x -C -s base 'objectclass=*' -P3 -A
 type = "null-bind"; 
@@ -160,6 +172,9 @@
 
 args = scanopts(port,type,value);
 
-res = pread(cmd: "ldapsearch", argv: args, nice: 5);
+res = pread(cmd:"ldapsearch", argv: args, nice: 5);
+res = res_check(res);
 #this is insecure, but unfortunately there's no other way to do this at the moment.
-makereport(res, type);
+if(res){
+  makereport(res, type);
+}



More information about the Openvas-commits mailing list