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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jun 2 00:42:31 CEST 2008


Author: jan
Date: 2008-06-02 00:42:27 +0200 (Mon, 02 Jun 2008)
New Revision: 882

Added:
   trunk/openvas-plugins/scripts/smb_authorization.nasl
Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/logins.nasl
   trunk/openvas-plugins/scripts/ssh_authorization.nasl
Log:
Implementing Change Request #8 (http://www.openvas.org/openvas-cr-8.html).

* scripts/ssh_authorization.nasl: Changed family to "Credentials".

* scripts/smb_authorization.nasl: New. Handle credentials for
a single SMB credentials.

* scripts/logins.nasl: Removed most SMB handling. Also the multi-account
handling for SMB credentials. Only remains are handling
of "SMB/dont_send_ntlmv1" and "SMB/dont_send_in_cleartext".



Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2008-06-01 21:44:22 UTC (rev 881)
+++ trunk/openvas-plugins/ChangeLog	2008-06-01 22:42:27 UTC (rev 882)
@@ -1,3 +1,16 @@
+2008-06-01  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
+
+	Implementing Change Request #8 (http://www.openvas.org/openvas-cr-8.html).
+
+	* scripts/ssh_authorization.nasl: Changed family to "Credentials".
+
+	* scripts/smb_authorization.nasl: New. Handle credentials for
+	a single SMB credentials.
+
+	* scripts/logins.nasl: Removed most SMB handling. Also the multi-account
+	handling for SMB credentials. Only remains are handling
+	of "SMB/dont_send_ntlmv1" and "SMB/dont_send_in_cleartext".
+
 2008-05-29  Bernhard Herzog  <bh at intevation.de>
 
 	* extra/build_oid_map: New.  Script to generate a mapping from
@@ -13,12 +26,12 @@
 	  deb_1578_1.nasl deb_1579_1.nasl deb_1580_1.nasl deb_1581_1.nasl
 	  deb_1582_1.nasl deb_1583_1.nasl deb_1584_1.nasl deb_1586_1.nasl
 	  deb_1587_1.nasl deb_1569_2.nasl: New Debian Scripts
-        
+
 2008-05-21  Carsten Koch-Mauthe <c.koch-mauthe at dn-systems.de>.
 
 	* scripts/ssh_authorization: Fixed password parameter
 	* scripts/clamav-CB-A08-0001.nasl: Changed to use ssh_authorization
-          instead of ssh_settings.nasl
+	instead of ssh_settings.nasl
 
 2008-05-15  Carsten Koch-Mauthe <c.koch-mauthe at dn-systems.de>.
 

Modified: trunk/openvas-plugins/scripts/logins.nasl
===================================================================
--- trunk/openvas-plugins/scripts/logins.nasl	2008-06-01 21:44:22 UTC (rev 881)
+++ trunk/openvas-plugins/scripts/logins.nasl	2008-06-01 22:42:27 UTC (rev 882)
@@ -7,8 +7,6 @@
 #
 
 
-MAX_ADDITIONAL_SMB_LOGINS = 3;
-
 default_http_login = "";
 default_http_password = "";
 
@@ -28,11 +26,6 @@
 default_imap_login = "";
 default_imap_password = "";
 
-default_smb_login = "";
-default_smb_password = "";
-default_smb_domain = "";
-
-
 if(description)
 {
  script_id(10870);
@@ -99,18 +92,6 @@
  script_add_preference(name:"IMAP account :", type:"entry", value:default_imap_login);
  script_add_preference(name:"IMAP password (sent in clear) :", type:"password", value:default_imap_password);
 
- script_add_preference(name:"SMB account :", type:"entry", value:default_smb_login);
- script_add_preference(name:"SMB password :", type:"password", value:default_smb_password);
- script_add_preference(name:"SMB domain (optional) :", type:"entry", value:default_smb_domain);
-
- for ( i = 1 ; i <= MAX_ADDITIONAL_SMB_LOGINS ; i ++ )
- {
- script_add_preference(name:"Additional SMB account (" + i + ") :", type:"entry", value:default_smb_login);
- script_add_preference(name:"Additional SMB password (" + i + ") :", type:"password", value:default_smb_password);
- script_add_preference(name:"Additional SMB domain (optional) (" + i + ") :", type:"entry", value:default_smb_password);
- }
-
-
  if(defined_func("MD5")) script_add_preference(name:"Never send SMB credentials in clear text", type:"checkbox", value:"yes");
  if(defined_func("MD5")) script_add_preference(name:"Only use NTLMv2", type:"checkbox", value:"no");
  exit(0);
@@ -200,15 +181,6 @@
 }
 
 # SMB
-smb_login = script_get_preference("SMB account :");
-if(!smb_login)smb_login = "";
-
-smb_password = script_get_preference("SMB password :");
-if(!smb_password)smb_password = "";
-
-smb_domain = script_get_preference("SMB domain (optional) :");
-if(!smb_domain)smb_domain = "";
-
 if(defined_func("MD5"))
 {
 smb_ctxt = script_get_preference("Never send SMB credentials in clear text");
@@ -228,30 +200,3 @@
 	if(smb_ctxt != "yes")set_kb_item(name:"SMB/dont_send_in_cleartext", value:TRUE);
 	}
 }
-
-
-if(smb_login)
-{
-  set_kb_item(name:"SMB/login_filled/0", value:smb_login);
-}
-  
-if(smb_password)
-{
-  set_kb_item(name:"SMB/password_filled/0", value:smb_password);
-}
-
-if(smb_domain)
-{ 
- set_kb_item(name:"SMB/domain_filled/0", value:smb_domain);
-}
-
-for ( i = 1 ; i <= MAX_ADDITIONAL_SMB_LOGINS ; i ++ )
-{
- l = script_get_preference("Additional SMB account (" + i + ") :");
- p = script_get_preference("Additional SMB password (" + i + ") :");
- d = script_get_preference("Additional SMB domain (optional) (" + i + ") :");
- if ( l ) set_kb_item(name:"SMB/login_filled/" + i, value:l);
- if ( p ) set_kb_item(name:"SMB/password_filled/" + i, value:p);
- if ( d ) set_kb_item(name:"SMB/domain_filled/" + i, value:d);
- if ( l || p ) j ++;
-}

Added: trunk/openvas-plugins/scripts/smb_authorization.nasl
===================================================================
--- trunk/openvas-plugins/scripts/smb_authorization.nasl	2008-06-01 21:44:22 UTC (rev 881)
+++ trunk/openvas-plugins/scripts/smb_authorization.nasl	2008-06-01 22:42:27 UTC (rev 882)
@@ -0,0 +1,73 @@
+# OpenVAS
+# $Id$
+# Description: Set information for smb authorization in KB.
+#
+# Authors:
+# Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
+#
+# Copyright:
+# Copyright (C) 2008 Intevation GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2,
+# or, at your option, any later version as published by the
+# Free Software Foundation
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# The two entries "SMB/dont_send_ntlmv1" and "SMB/dont_send_in_cleartext"
+# are not handled here yet. They are still managed in logins.nasl.
+
+# Unlike the old code in logins.nasl, here only a single
+# set of credentials in managed. Thus the strange name
+# used for the KB.
+
+if(description)
+{
+ script_id(90023);
+ script_version ("1.0");
+ name["english"] = "SMB Authorization";
+
+ script_name(english:name["english"]);
+
+ desc["english"] = "
+This script allows users to enter the information
+required to authorize and login via SMB.
+
+These data are stored in the knowledge base
+and used by other tests.
+
+Risk factor: None";
+
+ script_description(english:desc["english"]);
+
+ summary["english"] = "Sets SMB authorization";
+ script_summary(english:summary["english"]);
+
+ script_category(ACT_INIT);
+
+ script_copyright(english:"Copyright 2008 Intevation GmbH, License: GNU GPLv2+");
+ family["english"] = "Credentials";
+ script_family(english:family["english"]);
+
+ script_add_preference(name:"SMB login:", type:"entry", value:"");
+ script_add_preference(name:"SMB password:", type:"password", value:"");
+ script_add_preference(name:"SMB domain (optional):", type:"entry", value:"");
+
+ exit(0);
+}
+
+smb_login = script_get_preference("SMB login:");
+smb_password = script_get_preference("SMB password:");
+smb_domain = script_get_preference("SMB domain (optional):");
+
+if (smb_login) set_kb_item(name: "SMB/login_filled/0", value: smb_login);
+if (smb_password) set_kb_item(name:"SMB/password_filled/0", value:smb_password);
+if (smb_domain) set_kb_item(name: "SMB/domain_filled/0", value: smb_domain);

Modified: trunk/openvas-plugins/scripts/ssh_authorization.nasl
===================================================================
--- trunk/openvas-plugins/scripts/ssh_authorization.nasl	2008-06-01 21:44:22 UTC (rev 881)
+++ trunk/openvas-plugins/scripts/ssh_authorization.nasl	2008-06-01 22:42:27 UTC (rev 882)
@@ -49,7 +49,7 @@
  script_category(ACT_INIT);
 
  script_copyright(english:"Copyright 2007 Intevation GmbH, License: GNU GPLv2+");
- family["english"] = "Settings";
+ family["english"] = "Credentials";
  script_family(english:family["english"]);
 
  script_add_preference(name:"SSH login name:", type:"entry", value:"sshovas");



More information about the Openvas-commits mailing list