[Openvas-commits] r9518 - in trunk/openvas-plugins: . scripts/nmap_nse
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Nov 25 08:32:26 CET 2010
Author: chandra
Date: 2010-11-25 08:32:22 +0100 (Thu, 25 Nov 2010)
New Revision: 9518
Added:
trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_nfs_showmount.nasl
trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl
trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_sshv1.nasl
Modified:
trunk/openvas-plugins/ChangeLog
Log:
Added Nmap wrapper scripts
Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog 2010-11-25 07:29:59 UTC (rev 9517)
+++ trunk/openvas-plugins/ChangeLog 2010-11-25 07:32:22 UTC (rev 9518)
@@ -1,5 +1,12 @@
2010-11-25 Chandrashekhar B <bchandra at secpod.com>
+ * scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl,
+ scripts/nmap_nse/gb_nmap_sshv1.nasl,
+ scripts/nmap_nse/gb_nmap_nfs_showmount.nasl:
+ Added Nmap wrapper scripts.
+
+2010-11-25 Chandrashekhar B <bchandra at secpod.com>
+
* scripts/gb_ms09-063.nasl,
scripts/gb_ms10-009.nasl:
Added new MS bulletin plugins.
Added: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_nfs_showmount.nasl
===================================================================
--- trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_nfs_showmount.nasl 2010-11-25 07:29:59 UTC (rev 9517)
+++ trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_nfs_showmount.nasl 2010-11-25 07:32:22 UTC (rev 9518)
@@ -0,0 +1,94 @@
+###############################################################################
+# OpenVAS Vulnerability Test
+# $Id$
+#
+# Wrapper for Nmap NFS Show Mount NSE script.
+#
+# Authors:
+# NSE-Script: Patrik Karlsson <patrik at cqure.net>
+# NASL-Wrapper: Sooraj KS <kssooraj at secpod.com>
+#
+# Copyright:
+# NSE-Script: The Nmap Security Scanner (http://nmap.org)
+# NASL-Wrapper: Copyright (c) 2010 Greenbone Networks GmbH (http://www.greenbone.net)
+#
+# 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 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.
+###############################################################################
+
+if(description)
+{
+ script_id(801632);
+ script_version("$Revision$: 1.0");
+ script_tag(name:"risk_factor", value:"None");
+ script_name("Nmap NSE: NFS Show Mount");
+ desc = "
+ Overview: This script attempts to show NFS exports.
+
+ This is a wrapper on the Nmap Security Scanner's (http://nmap.org) nfs-showmount.nse
+ ";
+ script_description(desc);
+ script_summary("Shows NFS exports");
+ script_category(ACT_GATHER_INFO);
+ script_copyright("NSE-Script: The Nmap Security Scanner; NASL-Wrapper: Greenbone Networks GmbH");
+ script_family("Nmap NSE");
+
+ if(defined_func("script_mandatory_keys"))
+ {
+ script_mandatory_keys("Tools/Present/nmap5.21");
+ script_mandatory_keys("Tools/Launch/nmap_nse");
+ }
+ else
+ {
+ script_require_keys("Tools/Present/nmap5.21");
+ script_require_keys("Tools/Launch/nmap_nse");
+ }
+ exit(0);
+}
+
+
+## Required Keys
+if(! get_kb_item("Tools/Present/nmap5.21") ||
+ ! get_kb_item("Tools/Launch/nmap_nse")) {
+ exit(0);
+}
+
+## Run Nmap and get the result
+res = pread(cmd: "nmap", argv: make_list("nmap", "--script=nfs-showmount.nse",
+ get_host_ip()));
+if(res)
+{
+ foreach line (split(res))
+ {
+ if(ereg(pattern:"^\|",string:line)) {
+ result += substr(chomp(line),2) + '\n';
+ }
+
+ error = eregmatch(string:line, pattern:"^nmap: (.*)$");
+ if (error) {
+ msg = string('Nmap command failed with following error message:\n', line);
+ log_message(data : msg, port:port);
+ }
+ }
+
+ if("nfs-showmount" >< result) {
+ msg = string('Result found by Nmap Security Scanner (nfs-showmount.nse) ',
+ 'http://nmap.org:\n\n', result);
+ security_note(data : msg, port:port);
+ }
+}
+else
+{
+ msg = string('Nmap command failed entirely:\n');
+ log_message(data : msg, port:port);
+}
Property changes on: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_nfs_showmount.nasl
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl
===================================================================
--- trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl 2010-11-25 07:29:59 UTC (rev 9517)
+++ trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl 2010-11-25 07:32:22 UTC (rev 9518)
@@ -0,0 +1,109 @@
+###############################################################################
+# OpenVAS Vulnerability Test
+# $Id$
+#
+# Wrapper for Nmap SSH Hostkey NSE script.
+#
+# Authors:
+# NSE-Script: Sven Klemm
+# NASL-Wrapper: Sooraj KS <kssooraj at secpod.com>
+#
+# Copyright:
+# NSE-Script: The Nmap Security Scanner (http://nmap.org)
+# NASL-Wrapper: Copyright (c) 2010 Greenbone Networks GmbH (http://www.greenbone.net)
+#
+# 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 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.
+###############################################################################
+
+if(description)
+{
+ script_id(801633);
+ script_version("$Revision$: 1.0");
+ script_tag(name:"risk_factor", value:"None");
+ script_name("Nmap NSE: SSH Hostkey");
+ desc = "
+ Overview: This script attempts to get the target SSH server's key fingerprint
+ and public key.
+
+ This is a wrapper on the Nmap Security Scanner's (http://nmap.org) ssh-hostkey.nse
+ ";
+ script_description(desc);
+ script_summary("Get SSH Hostkey");
+ script_category(ACT_GATHER_INFO);
+ script_copyright("NSE-Script: The Nmap Security Scanner; NASL-Wrapper: Greenbone Networks GmbH");
+ script_dependencie("find_service.nes");
+ script_family("Nmap NSE");
+ script_add_preference(name:"ssh_hostkey :", value: "full;bubble;visual;all",type: "radio");
+
+ if(defined_func("script_mandatory_keys"))
+ {
+ script_mandatory_keys("Tools/Present/nmap5.21");
+ script_mandatory_keys("Tools/Launch/nmap_nse");
+ }
+ else
+ {
+ script_require_keys("Tools/Present/nmap5.21");
+ script_require_keys("Tools/Launch/nmap_nse");
+ }
+ exit(0);
+}
+
+
+## Required Keys
+if(! get_kb_item("Tools/Present/nmap5.21") ||
+ ! get_kb_item("Tools/Launch/nmap_nse")) {
+ exit(0);
+}
+
+## Get SSH Ports
+port = get_kb_item("Services/ssh");
+if(!port){
+ exit(0);
+}
+
+argv = make_list("nmap", "--script=ssh-hostkey.nse", "-p", port, get_host_ip());
+
+## Get the preference
+if( pref = script_get_preference("ssh_hostkey :")){
+ argv = make_list(argv, "--script-args=ssh_hostkey="+pref);
+}
+
+## Run Nmap and get the result
+res = pread(cmd: "nmap", argv: argv);
+if(res)
+{
+ foreach line (split(res))
+ {
+ if(ereg(pattern:"^\|",string:line)) {
+ result += substr(chomp(line),2) + '\n';
+ }
+
+ error = eregmatch(string:line, pattern:"^nmap: (.*)$");
+ if (error) {
+ msg = string('Nmap command failed with following error message:\n', line);
+ log_message(data : msg, port:port);
+ }
+ }
+
+ if("ssh-hostkey" >< result) {
+ msg = string('Result found by Nmap Security Scanner (ssh-hostkey.nse) ',
+ 'http://nmap.org:\n\n', result);
+ security_note(data : msg, port:port);
+ }
+}
+else
+{
+ msg = string('Nmap command failed entirely:\n');
+ log_message(data : msg, port:port);
+}
Property changes on: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_ssh_hostkey.nasl
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_sshv1.nasl
===================================================================
--- trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_sshv1.nasl 2010-11-25 07:29:59 UTC (rev 9517)
+++ trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_sshv1.nasl 2010-11-25 07:32:22 UTC (rev 9518)
@@ -0,0 +1,102 @@
+###############################################################################
+# OpenVAS Vulnerability Test
+# $Id$
+#
+# Wrapper for Nmap SSHv1 NSE script.
+#
+# Authors:
+# NSE-Script: Brandon Enright
+# NASL-Wrapper: Sooraj KS <kssooraj at secpod.com>
+#
+# Copyright:
+# NSE-Script: The Nmap Security Scanner (http://nmap.org)
+# NASL-Wrapper: Copyright (c) 2010 Greenbone Networks GmbH (http://www.greenbone.net)
+#
+# 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 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.
+###############################################################################
+
+if(description)
+{
+ script_id(801634);
+ script_version("$Revision$: 1.0");
+ script_tag(name:"risk_factor", value:"None");
+ script_name("Nmap NSE: SSHv1");
+ desc = "
+ Overview: This script attempts to check if an SSH server supports the obsolete
+ and less secure SSH Protocol Version 1.
+
+ This is a wrapper on the Nmap Security Scanner's (http://nmap.org) sshv1.nse
+ ";
+ script_description(desc);
+ script_summary("Check if an server supports SSHv1");
+ script_category(ACT_GATHER_INFO);
+ script_copyright("NSE-Script: The Nmap Security Scanner; NASL-Wrapper: Greenbone Networks GmbH");
+ script_dependencie("find_service.nes");
+ script_family("Nmap NSE");
+
+ if(defined_func("script_mandatory_keys"))
+ {
+ script_mandatory_keys("Tools/Present/nmap5.21");
+ script_mandatory_keys("Tools/Launch/nmap_nse");
+ }
+ else
+ {
+ script_require_keys("Tools/Present/nmap5.21");
+ script_require_keys("Tools/Launch/nmap_nse");
+ }
+ exit(0);
+}
+
+
+## Required Keys
+if(! get_kb_item("Tools/Present/nmap5.21") ||
+ ! get_kb_item("Tools/Launch/nmap_nse")) {
+ exit(0);
+}
+
+## Get SSH Ports
+port = get_kb_item("Services/ssh");
+if(!port){
+ exit(0);
+}
+
+## Run Nmap and get the result
+res = pread(cmd: "nmap", argv: make_list("nmap", "--script=sshv1.nse", "-p",
+ port, get_host_ip()));
+if(res)
+{
+ foreach line (split(res))
+ {
+ if(ereg(pattern:"^\|",string:line)) {
+ result += substr(chomp(line),2) + '\n';
+ }
+
+ error = eregmatch(string:line, pattern:"^nmap: (.*)$");
+ if (error) {
+ msg = string('Nmap command failed with following error message:\n', line);
+ log_message(data : msg, port:port);
+ }
+ }
+
+ if("sshv1" >< result) {
+ msg = string('Result found by Nmap Security Scanner (sshv1.nse) ',
+ 'http://nmap.org:\n\n', result);
+ security_note(data : msg, port:port);
+ }
+}
+else
+{
+ msg = string('Nmap command failed entirely:\n');
+ log_message(data : msg, port:port);
+}
Property changes on: trunk/openvas-plugins/scripts/nmap_nse/gb_nmap_sshv1.nasl
___________________________________________________________________
Name: svn:keywords
+ Revision
More information about the Openvas-commits
mailing list