[Openvas-commits] r10522 - in trunk/openvas-plugins: . scripts
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Mar 10 12:02:53 CET 2011
Author: mwiegand
Date: 2011-03-10 12:02:49 +0100 (Thu, 10 Mar 2011)
New Revision: 10522
Modified:
trunk/openvas-plugins/ChangeLog
trunk/openvas-plugins/scripts/kb_2_sc.nasl
Log:
* scripts/kb_2_sc.nasl: Add support for Debian package lists.
Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog 2011-03-10 08:22:37 UTC (rev 10521)
+++ trunk/openvas-plugins/ChangeLog 2011-03-10 11:02:49 UTC (rev 10522)
@@ -1,3 +1,7 @@
+2011-03-10 Michael Wiegand <michael.wiegand at greenbone.net>
+
+ * scripts/kb_2_sc.nasl: Add support for Debian package lists.
+
2011-03-10 Michael Meyer <michael.meyer at greenbone.net>
* smbcl_getversion.nasl:
Modified: trunk/openvas-plugins/scripts/kb_2_sc.nasl
===================================================================
--- trunk/openvas-plugins/scripts/kb_2_sc.nasl 2011-03-10 08:22:37 UTC (rev 10521)
+++ trunk/openvas-plugins/scripts/kb_2_sc.nasl 2011-03-10 11:02:49 UTC (rev 10522)
@@ -99,6 +99,31 @@
}
}
+if ("DEB" >< release)
+{
+ packages_str = get_kb_item ("ssh/login/packages");
+ packages = split (packages_str, sep: '\n', keep: 0);
+ i = 1;
+ foreach package (packages)
+ {
+ if (eregmatch (pattern: "^.i[ ]+", string: package))
+ {
+ package = ereg_replace (pattern: "([ ]+)", replace: "#", string: package);
+ package_data = split (package, sep: "#", keep: 0);
+
+ xml = string (xml, '\t\t<dpkginfo_item id=\"', i, '\" xmlns=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#linux\">\n');
+ xml = string (xml, '\t\t\t<name>', package_data[1], '</name>\n');
+ xml = string (xml, '\t\t\t<arch/>\n');
+ xml = string (xml, '\t\t\t<epoch/>\n');
+ xml = string (xml, '\t\t\t<release/>\n');
+ xml = string (xml, '\t\t\t<version>', package_data[2], '</version>\n');
+ xml = string (xml, '\t\t\t<evr/>\n');
+ xml = string (xml, '\t\t</dpkginfo_item>\n');
+ i++;
+ }
+ }
+}
+
xml = string (xml, '\t</system_data>\n');
xml = string (xml, '\t</oval_system_characteristics>\n');
More information about the Openvas-commits
mailing list