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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 21 15:37:30 CET 2011


Author: hdoreau
Date: 2011-03-21 15:37:26 +0100 (Mon, 21 Mar 2011)
New Revision: 10598

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/gather-package-list.nasl
Log:
* scripts/gather-package-list.nasl: register the host OS informations to
the HostDetails database.


Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2011-03-21 14:19:24 UTC (rev 10597)
+++ trunk/openvas-plugins/ChangeLog	2011-03-21 14:37:26 UTC (rev 10598)
@@ -1,5 +1,10 @@
 2011-03-21  Henri Doreau <henri.doreau at greenbone.net>
 
+	* scripts/gather-package-list.nasl: register the host OS informations to
+	the HostDetails database.
+
+2011-03-21  Henri Doreau <henri.doreau at greenbone.net>
+
 	* scripts/host_details.nasl,
 	scripts/host_details.inc,
 	scripts/xml.inc:

Modified: trunk/openvas-plugins/scripts/gather-package-list.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gather-package-list.nasl	2011-03-21 14:19:24 UTC (rev 10597)
+++ trunk/openvas-plugins/scripts/gather-package-list.nasl	2011-03-21 14:37:26 UTC (rev 10598)
@@ -62,6 +62,7 @@
 #
 cmdline = 0;
 include("ssh_func.inc");
+include("host_details.inc");
 
 port = get_kb_item("Services/ssh");
 if(!port) {
@@ -77,9 +78,16 @@
 # First command: Grab uname -a of the remote system
 uname = ssh_cmd(socket:sock, cmd:"uname -a");
 set_kb_item(name: "ssh/login/uname", value:uname);
+register_host_detail(name:"OS", value:uname, nvt:"1.3.6.1.4.1.25623.1.0.50282",
+    desc:"Determine OS and list of installed packages via SSH login");
 
 # GNU/Linux platforms:
 
+function register_detected_os(os) {
+    register_host_detail(name:"OS", value:os, nvt:"1.3.6.1.4.1.25623.1.0.50282",
+        desc:"Determine OS and list of installed packages via SSH login");
+}
+
 # Ok...let's first check if this is a RedHat/Fedora Core/Mandrake release
 rls = ssh_cmd(socket:sock, cmd:"cat /etc/redhat-release");
 if("Red Hat Linux release 7.3" >< rls) {
@@ -87,6 +95,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Red Hat Linux release 8.0 (Psyche)" >< rls) {
@@ -94,6 +103,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Red Hat Linux release 9 (Shrike)" >< rls) {
@@ -101,6 +111,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 1 (Yarrow)" >< rls) {
@@ -108,6 +119,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 2 (Tettnang)" >< rls) {
@@ -115,6 +127,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 3 (Heidelberg)" >< rls) {
@@ -122,6 +135,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 4 (Stentz)" >< rls) {
@@ -129,6 +143,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 5 (Bordeaux)" >< rls) {
@@ -136,6 +151,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora Core release 6 (Zod)" >< rls) {
@@ -143,6 +159,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 7 (Moonshine)" >< rls) {
@@ -150,6 +167,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 8 (Werewolf)" >< rls) {
@@ -157,6 +175,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 9 (Sulphur)" >< rls) {
@@ -164,6 +183,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 10 (Cambridge)" >< rls) {
@@ -171,6 +191,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 11 (Leonidas)" >< rls) {
@@ -178,6 +199,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 12 (Constantine)" >< rls) {
@@ -185,6 +207,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Fedora release 13 (Goddard)" >< rls) {
@@ -192,6 +215,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 
@@ -200,6 +224,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 
@@ -215,6 +240,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE}~%{SIGGPG:pgpsig};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if(egrep(pattern:"Red Hat Enterprise.*release 3[ .]", string:rls)) {
@@ -222,6 +248,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE}~%{SIGGPG:pgpsig};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if(egrep(pattern:"Red Hat Enterprise.*release 4[ .]", string:rls)) {
@@ -229,6 +256,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE}~%{SIGGPG:pgpsig};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if(egrep(pattern:"Red Hat Enterprise.*release 5[ .]", string:rls)) {
@@ -236,6 +264,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE}~%{SIGGPG:pgpsig};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 
@@ -244,6 +273,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2010.1" >< rls) {
@@ -251,6 +281,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2010.0" >< rls) {
@@ -258,6 +289,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2009.1" >< rls) {
@@ -265,6 +297,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2009.0" >< rls) {
@@ -272,6 +305,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2008.1" >< rls) {
@@ -279,6 +313,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2008.0" >< rls) {
@@ -286,6 +321,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2007.1" >< rls) {
@@ -293,6 +329,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2007.0" >< rls) {
@@ -300,6 +337,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandriva Linux release 2006.0" >< rls) {
@@ -307,6 +345,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrakelinux release 10.2" >< rls) {
@@ -314,6 +353,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrakelinux release 10.1" >< rls) {
@@ -321,6 +361,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 10.0" >< rls) {
@@ -328,6 +369,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 9.2" >< rls) {
@@ -335,6 +377,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 9.1" >< rls) {
@@ -342,6 +385,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 8.1" >< rls) {
@@ -349,6 +393,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 8.0" >< rls) {
@@ -356,6 +401,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Mandrake Linux release 7.2" >< rls) {
@@ -363,6 +409,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 
@@ -377,6 +424,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running CentOS release 5"));
+    register_detected_os(os:"CentOS release 5");
     exit(0);
 }
 if("CentOS release 4" >< rls) {
@@ -384,6 +432,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running CentOS release 4"));
+    register_detected_os(os:"CentOS release 4");
     exit(0);
 }
 if("CentOS release 3" >< rls) {
@@ -391,6 +440,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running CentOS release 3"));
+    register_detected_os(os:"CentOS release 3");
     exit(0);
 }
 if("CentOS release 2" >< rls) {
@@ -398,6 +448,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running CentOS release 2"));
+    register_detected_os(os:"CentOS release 2");
     exit(0);
 }
 
@@ -408,6 +459,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 4.10"));
+    register_detected_os(os:"Ubuntu 4.10");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=5.04"><rls) {
@@ -415,6 +467,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 5.04"));
+    register_detected_os(os:"Ubuntu 5.04");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=5.10"><rls) {
@@ -422,6 +475,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 5.10"));
+    register_detected_os(os:"Ubuntu 5.10");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=6.06"><rls) {
@@ -429,6 +483,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 6.06"));
+    register_detected_os(os:"Ubuntu 6.06");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=6.10"><rls) {
@@ -436,6 +491,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 6.10"));
+    register_detected_os(os:"Ubuntu 6.10");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=7.04"><rls) {
@@ -443,6 +499,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 7.04"));
+    register_detected_os(os:"Ubuntu 7.04");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=7.10"><rls) {
@@ -450,6 +507,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 7.10"));
+    register_detected_os(os:"Ubuntu 7.10");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=8.04"><rls) {
@@ -457,6 +515,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 8.04 LTS"));
+    register_detected_os(os:"Ubuntu 8.04 LTS");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=8.10"><rls) {
@@ -464,6 +523,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 8.10"));
+    register_detected_os(os:"Ubuntu 8.10");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=9.04"><rls) {
@@ -471,6 +531,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 9.04"));
+    register_detected_os(os:"Ubuntu 9.04");
     exit(0);
 }
 if("DISTRIB_ID=Ubuntu"><rls && "DISTRIB_RELEASE=9.10"><rls) {
@@ -478,6 +539,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 9.10"));
+    register_detected_os(os:"Ubuntu 9.10");
     exit(0);
 }
 
@@ -486,6 +548,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 10.04 LTS"));
+    register_detected_os(os:"Ubuntu 10.04 LTS");
     exit(0);
 }
 
@@ -497,6 +560,7 @@
   {
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Ubuntu 10.10"));
+    register_detected_os(os:"Ubuntu 10.10");
     exit(0);
   }
 }
@@ -510,6 +574,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Conectiva Linux 9"));
+    register_detected_os(os:"Conectiva Linux 9");
     exit(0);
 }
 if("Conectiva Linux 10" >< rls) {
@@ -517,6 +582,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Conectiva Linux 10"));
+    register_detected_os(os:"Conectiva Linux 10");
     exit(0);
 }
 
@@ -543,6 +609,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux Workstation 7.0" >< rls) {
@@ -550,6 +617,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux Server 8.0" >< rls) {
@@ -557,6 +625,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux Workstation 8.0" >< rls) {
@@ -564,6 +633,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux Desktop 10.0" >< rls) {
@@ -571,6 +641,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux Server 10.0" >< rls) {
@@ -578,6 +649,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running ", rls));
+    register_detected_os(os:rls);
     exit(0);
 }
 if("Turbolinux">< rls) {
@@ -592,6 +664,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Debian 2.2 (Potato)"));
+    register_detected_os(os:"Debian 2.2 (Potato)");
     exit(0);
 }
 if("3.0"><rls) {
@@ -599,6 +672,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Debian 3.0 (Woody)"));
+    register_detected_os(os:"Debian 3.0 (Woody)");
     exit(0);
 }
 if("3.1"><rls) {
@@ -606,6 +680,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Debian 3.1 (Sarge)"));
+    register_detected_os(os:"Debian 3.1 (Sarge)");
     exit(0);
 }
 if("4.0"><rls) {
@@ -613,6 +688,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Debian 4.0 (Etch)"));
+    register_detected_os(os:"Debian 4.0 (Etch)");
     exit(0);
 }
 if("5.0"><rls) {
@@ -620,6 +696,7 @@
     buf = ssh_cmd(socket:sock, cmd:"COLUMNS=200 dpkg -l");
     set_kb_item(name: "ssh/login/packages", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Debian 5.0 (Lenny)"));
+    register_detected_os(os:"Debian 5.0 (Lenny)");
     exit(0);
 }
 
@@ -631,6 +708,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 12.0"));
+    register_detected_os(os:"Slackware 12.0");
     exit(0);
 }
 if("Slackware 11.0"><rls) {
@@ -638,6 +716,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 11.0"));
+    register_detected_os(os:"Slackware 11.0");
     exit(0);
 }
 if("Slackware 10.2"><rls) {
@@ -645,6 +724,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 10.2"));
+    register_detected_os(os:"Slackware 10.2");
     exit(0);
 }
 if("Slackware 10.1"><rls) {
@@ -652,6 +732,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 10.1"));
+    register_detected_os(os:"Slackware 10.1");
     exit(0);
 }
 if("Slackware 10.0"><rls) {
@@ -659,6 +740,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 10.0"));
+    register_detected_os(os:"Slackware 10.0");
     exit(0);
 }
 if("Slackware 9.1"><rls) {
@@ -666,6 +748,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 9.1"));
+    register_detected_os(os:"Slackware 9.1");
     exit(0);
 }
 if("Slackware 9.0"><rls) {
@@ -673,6 +756,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 9.0"));
+    register_detected_os(os:"Slackware 9.0");
     exit(0);
 }
 if("Slackware 8.1"><rls) {
@@ -680,6 +764,7 @@
     buf = ssh_cmd(socket:sock, cmd:"ls /var/log/packages");
     set_kb_item(name: "ssh/login/slackpack", value:buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Slackware 8.1"));
+    register_detected_os(os:"Slackware 8.1");
     exit(0);
 }
 
@@ -691,6 +776,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux Enterprise Server 11"));
+    register_detected_os(os:"SuSE Linux Enterprise Server 11");
     exit(0);
 }
 if("SUSE Linux Enterprise Server 10 "><rls) {
@@ -698,6 +784,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux Enterprise Server 10"));
+    register_detected_os(os:"SuSE Linux Enterprise Server 10");
     exit(0);
 }
 if("SUSE LINUX Enterprise Server 9 "><rls) {
@@ -705,6 +792,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux Enterprise Server 9"));
+    register_detected_os(os:"SuSE Linux Enterprise Server 9");
     exit(0);
 }
 
@@ -713,6 +801,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 11.3"));
+    register_detected_os(os:"openSUSE 11.3");
     exit(0);
 }
 if("openSUSE 11.2 "><rls) {
@@ -720,6 +809,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 11.2"));
+    register_detected_os(os:"openSUSE 11.2");
     exit(0);
 }
 if("openSUSE 11.1 "><rls) {
@@ -727,6 +817,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 11.1"));
+    register_detected_os(os:"openSUSE 11.1");
     exit(0);
 }
 if("openSUSE 11.0 "><rls) {
@@ -734,6 +825,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 11.0"));
+    register_detected_os(os:"openSUSE 11.0");
     exit(0);
 }
 if("openSUSE 10.3 "><rls) {
@@ -741,6 +833,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 10.3"));
+    register_detected_os(os:"openSUSE 10.3");
     exit(0);
 }
 
@@ -749,6 +842,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 10.2"));
+    register_detected_os(os:"openSUSE 10.2");
     exit(0);
 }
 
@@ -757,6 +851,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running openSUSE 10.1"));
+    register_detected_os(os:"openSUSE 10.1");
     exit(0);
 }
 
@@ -765,6 +860,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 11"));
+    register_detected_os(os:"SuSE Linux 11");
     exit(0);
 }
 if("SUSE LINUX 10.3 "><rls) {
@@ -772,6 +868,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 10.3"));
+    register_detected_os(os:"SuSE Linux 10.3");
     exit(0);
 }
 if("SUSE LINUX 10.2 "><rls) {
@@ -779,6 +876,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 10.2"));
+    register_detected_os(os:"SuSE Linux 10.2");
     exit(0);
 }
 if("SUSE LINUX 10.1 "><rls) {
@@ -786,6 +884,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 10.1"));
+    register_detected_os(os:"SuSE Linux 10.1");
     exit(0);
 }
 if("SuSE Linux 9.3 "><rls) {
@@ -793,6 +892,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 9.3"));
+    register_detected_os(os:"SuSE Linux 9.3");
     exit(0);
 }
 if("SuSE Linux 9.2 "><rls) {
@@ -800,6 +900,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 9.2"));
+    register_detected_os(os:"SuSE Linux 9.2");
     exit(0);
 }
 if("SuSE Linux 9.1 "><rls) {
@@ -807,6 +908,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 9.1"));
+    register_detected_os(os:"SuSE Linux 9.1");
     exit(0);
 }
 if("SuSE Linux 9.0 "><rls) {
@@ -814,6 +916,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 9.0"));
+    register_detected_os(os:"SuSE Linux 9.0");
     exit(0);
 }
 if("SuSE Linux 8.2 "><rls) {
@@ -821,6 +924,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 8.2"));
+    register_detected_os(os:"SuSE Linux 8.2");
     exit(0);
 }
 if("SuSE Linux 8.1 "><rls) {
@@ -828,6 +932,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 8.1"));
+    register_detected_os(os:"SuSE Linux 8.1");
     exit(0);
 }
 if("SuSE Linux 8.0 "><rls) {
@@ -835,6 +940,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 8.0"));
+    register_detected_os(os:"SuSE Linux 8.0");
     exit(0);
 }
 if("SuSE Linux 7.3 "><rls) {
@@ -842,6 +948,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running SuSE Linux 7.3"));
+    register_detected_os(os:"SuSE Linux 7.3");
     exit(0);
 }
 
@@ -855,6 +962,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 3.0.5"));
+    register_detected_os(os:"Trustix 3.0.5");
     exit(0);
 }
 if("Trustix Secure Linux release 3.0"><rls ||
@@ -863,6 +971,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 3.0"));
+    register_detected_os(os:"Trustix 3.0");
     exit(0);
 }
 if("Trustix Secure Linux release 2.2"><rls ||
@@ -871,6 +980,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 2.2"));
+    register_detected_os(os:"Trustix 2.2");
     exit(0);
 }
 if("Trustix Secure Linux release 2.1"><rls ||
@@ -879,6 +989,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 2.1"));
+    register_detected_os(os:"Trustix 2.1");
     exit(0);
 }
 if("Trustix Secure Linux release 2.0"><rls ||
@@ -887,6 +998,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 2.0"));
+    register_detected_os(os:"Trustix 2.0");
     exit(0);
 }
 if("Trustix Secure Linux release 1.5"><rls ||
@@ -895,6 +1007,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 1.5"));
+    register_detected_os(os:"Trustix 1.5");
     exit(0);
 }
 if("Trustix Secure Linux release 1.2"><rls ||
@@ -903,6 +1016,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 1.2"));
+    register_detected_os(os:"Trustix 1.2");
     exit(0);
 }
 if("Trustix Secure Linux release 1.1"><rls ||
@@ -911,6 +1025,7 @@
     buf = ssh_cmd(socket:sock, cmd:"/bin/rpm -qa --qf '%{NAME}~%{VERSION}~%{RELEASE};\n'");
     set_kb_item(name: "ssh/login/rpms", value: ";" + buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Trustix 1.1"));
+    register_detected_os(os:"Trustix 1.1");
     exit(0);
 }
 # Missing Trustix e-2
@@ -930,6 +1045,7 @@
     }
     set_kb_item(name: "ssh/login/gentoo_maintained", value: buf);
     security_note(port:port, data:string("We are able to login and detect that you are running Gentoo"));
+    register_detected_os(os:"Gentoo");
     exit(0);
 }
 
@@ -948,6 +1064,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 10.01"));
+        register_detected_os(os:"HP-UX 10.01");
 	exit(0);
     }
     if("10.10"><rls) {
@@ -957,6 +1074,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 10.10"));
+        register_detected_os(os:"HP-UX 10.10");
 	exit(0);
     }
     if("10.20"><rls) {
@@ -966,6 +1084,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 10.20"));
+        register_detected_os(os:"HP-UX 10.20");
 	exit(0);
     }
     if("10.24"><rls) {
@@ -975,6 +1094,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 10.24"));
+        register_detected_os(os:"HP-UX 10.24");
 	exit(0);
     }
     if("10.26"><rls) {
@@ -984,6 +1104,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 10.26"));
+        register_detected_os(os:"HP-UX 10.26");
 	exit(0);
     }
     if("11.00"><rls) {
@@ -993,6 +1114,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.00"));
+        register_detected_os(os:"HP-UX 11.00");
 	exit(0);
     }
     if("11.04"><rls) {
@@ -1002,6 +1124,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.04"));
+        register_detected_os(os:"HP-UX 11.04");
 	exit(0);
     }
     if("11.11"><rls) {
@@ -1011,6 +1134,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.11"));
+        register_detected_os(os:"HP-UX 11.11");
 	exit(0);
     }
     if("11.20"><rls) {
@@ -1020,6 +1144,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.20"));
+        register_detected_os(os:"HP-UX 11.20");
 	exit(0);
     }
     if("11.22"><rls) {
@@ -1029,6 +1154,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.22"));
+        register_detected_os(os:"HP-UX 11.22");
 	exit(0);
     }
     if("11.23"><rls) {
@@ -1038,6 +1164,7 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.23"));
+        register_detected_os(os:"HP-UX 11.23");
 	exit(0);
     }
     if("11.31"><rls) {
@@ -1047,12 +1174,16 @@
 	buf = ssh_cmd(socket:sock, cmd:"swlist -a revision -l fileset");
 	set_kb_item(name: "ssh/login/hp_pkgrev", value:buf);
 	security_note(port:port, data:string("We are able to login and detect that you are running HP-UX 11.31"));
+        register_detected_os(os:"HP-UX 11.31");
 	exit(0);
     }
 }
 
 #How about FreeBSD?  If the uname line begins with "FreeBSD ", we have a match
 if(substr(uname, 0, 7)=="FreeBSD ") {
+    osversion = ssh_cmd(socket:sock, cmd:"uname -r");
+    register_detected_os(os:osversion); 
+
     version=eregmatch(pattern:"^[^ ]+ [^ ]+ ([^ ]+)+",string:uname);
     splitup = eregmatch(pattern:"([^-]+)-([^-]+)-p([0-9]+)", string:version[1]);
     found = 0;
@@ -1104,8 +1235,10 @@
     buf = ssh_cmd(socket:sock, cmd:"showrev -p");
     set_kb_item(name: "ssh/login/solpatches", value:buf);
     if (hardwaretype >< "sparc") {
+        register_detected_os(os:string("Solaris ", osversion, " Arch: SPARC"));
         security_note(port:port, data:string("We are able to login and detect that you are running Solaris ", osversion, " Arch: SPARC"));
     } else {
+        register_detected_os(os:string("Solaris ", osversion, " Arch: x86"));
         security_note(port:port, data:string("We are able to login and detect that you are running Solaris ", osversion, " Arch: x86"));
     }
     exit(0);
@@ -1115,6 +1248,7 @@
 if ("Darwin" >< uname)
 {
     buf = ssh_cmd(socket:sock, cmd:"sw_vers");
+    register_detected_os(os:buf);
     security_note(data:string("We are able to login and detect that you are running:\n", buf, '\n'));
     buf = chomp(ssh_cmd(socket:sock, cmd:"sw_vers -productName"));
     set_kb_item(name: "ssh/login/osx_name", value:buf);



More information about the Openvas-commits mailing list