Author: jfs
Date: 2007-10-31 22:30:13 +0100 (Wed, 31 Oct 2007)
New Revision: 493

Modified:
   trunk/openvas-plugins/audit/audit-plugins
Log:
Additional check to detect possibly suspicious plugins

Modified: trunk/openvas-plugins/audit/audit-plugins
===================================================================
--- trunk/openvas-plugins/audit/audit-plugins   2007-10-31 21:15:47 UTC (rev 
492)
+++ trunk/openvas-plugins/audit/audit-plugins   2007-10-31 21:30:13 UTC (rev 
493)
@@ -50,6 +50,7 @@
 
     if [ $count -ne 0 ] ; then
      echo "$count NON-FREE plugins found"
+     echo "Please fix this (remove the files or remove them from the 
non-free-plugins file) and rerun the script"
      exit 1
     fi
 
@@ -74,10 +75,41 @@
 
     if [ $count -ne 0 ] ; then
         echo "$count FREE plugins that depend on NON-FREE found"
+        echo "Please fix this and rerun the script"
         exit 1
     fi
 fi
 
+echo "Looking for (possibly) non-free plugins..."
+count=0
+
+# This regexp is bound to find non-free plugins:
+for plugin in `egrep -i "script_copyright.*Tenable.*" $SCRIPTDIR/*`; do
+    if egrep -iq '(c).*Tenable Network Security' "$SCRIPTDIR/$plugin"; then
+        # If they have the script_copyright and the (c) then they
+        # are non-free for sure
+        echo "NON-FREE plugin $plugin found"
+        count=$(($count+1))
+    else
+        echo "POSSIBLE NON-FREE plugin $plugin found"
+        count=$(($count+1))
+    fi
+fi
+# This regexp might have false positives
+for plugin in `egrep -i "\(c\).*Tenable.*Network.*Security" $SCRIPTDIR/*`; do
+    if [ ! -e non-free-false-positives ] || ! grep -q ^$plugin 
non-free-false-positives; then
+        echo "POSSIBLE NON-FREE plugin $plugin found"
+        count=$(($count+1))
+    fi
+fi
+
+if [ $count -ne 0 ] ; then
+    echo "$count NON-FREE plugins found"
+    echo "Please fix this and rerun the script"
+    exit 1
+fi
+
+
 if [ -f "depend-plugins" ] ; then
     echo "Looking for (known) free plugins that depend on non-free..."
     count=0
@@ -90,6 +122,7 @@
 
     if [ $count -ne 0 ] ; then
      echo "$count FREE plugins that depend on NON-FREE found"
+     echo "Please fix this and rerun the script"
      exit 1
     fi
 else
@@ -108,6 +141,7 @@
 
     if [ $count -ne 0 ] ; then
      echo "$count FREE plugins that depend on NON EXISTANT plugins found"
+     echo "Please fix this and rerun the script"
      exit 1
     fi
 

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

Reply via email to