Microsoft Windows SMTP Server DNS spoofing vulnerability

2010-05-05T00:00:00
ID OPENVAS:1361412562310100624
Type openvas
Reporter Copyright (C) 2010 Greenbone Networks GmbH
Modified 2020-03-23T00:00:00

Description

The Microsoft Windows Simple Mail Transfer Protocol (SMTP) Server is prone to a DNS spoofing vulnerability.

                                        
                                            ###############################################################################
# OpenVAS Vulnerability Test
#
# Microsoft Windows SMTP Server DNS spoofing vulnerability
#
# Authors:
# Michael Meyer <michael.meyer@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.
###############################################################################

CPE = "cpe:/a:microsoft:exchange_server";

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.100624");
  script_version("2020-03-23T13:51:29+0000");
  script_bugtraq_id(39910, 39908);
  script_cve_id("CVE-2010-1690", "CVE-2010-1689");
  script_tag(name:"last_modification", value:"2020-03-23 13:51:29 +0000 (Mon, 23 Mar 2020)");
  script_tag(name:"creation_date", value:"2010-05-05 18:44:23 +0200 (Wed, 05 May 2010)");
  script_tag(name:"cvss_base", value:"6.4");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:P/A:P");
  script_name("Microsoft Windows SMTP Server DNS spoofing vulnerability");
  script_category(ACT_GATHER_INFO);
  script_family("SMTP problems");
  script_copyright("Copyright (C) 2010 Greenbone Networks GmbH");
  script_dependencies("sw_ms_exchange_server_remote_detect.nasl");
  script_mandatory_keys("microsoft/exchange_server/smtp/detected");

  script_xref(name:"URL", value:"http://www.securityfocus.com/bid/39910");
  script_xref(name:"URL", value:"http://www.securityfocus.com/bid/39908");
  script_xref(name:"URL", value:"http://archives.neohapsis.com/archives/fulldisclosure/2010-05/0058.html");
  script_xref(name:"URL", value:"http://www.coresecurity.com/content/CORE-2010-0424-windows-stmp-dns-query-id-bugs");
  script_xref(name:"URL", value:"https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-024");

  script_tag(name:"solution", value:"This issue is reported to be patched in Microsoft security advisory
  MS10-024. Please see the references for more information.");

  script_tag(name:"summary", value:"The Microsoft Windows Simple Mail Transfer Protocol (SMTP) Server is
  prone to a DNS spoofing vulnerability.");

  script_tag(name:"impact", value:"Successfully exploiting this issue allows remote attackers to spoof
  DNS replies, allowing them to redirect network traffic and to launch man-in-the-middle attacks.");

  script_tag(name:"qod_type", value:"remote_banner");
  script_tag(name:"solution_type", value:"VendorFix");

  exit(0);
}

include("smtp_func.inc");
include("version_func.inc");
include("host_details.inc");
include("misc_func.inc");

function check_version(vers,range,fixed) {

  version = split(vers,  sep:".", keep:FALSE);
  fix     = split(fixed, sep:".", keep:FALSE);
  r       = split(range, sep:".", keep:FALSE);

  if(max_index(version) != 4) return FALSE;

  if(int(version[0]) == int(fix[0]) && int(version[1]) == int(fix[1]) && int(version[2]) == int(fix[2])) {

    if(int(version[3]) >= int(r[3])) {
      if(version_is_less(version:version[3], test_version:fix[3])) {
        return TRUE;
      }
    }
  }
  return FALSE;
}

if(!port = get_app_port(cpe:CPE, service:"smtp"))
  exit(0);

if(!get_app_location(cpe:CPE, port:port))
  exit(0);

banner = smtp_get_banner(port:port);
if(!banner || "Microsoft ESMTP MAIL" >!< banner)
  exit(0);

version = eregmatch(pattern:"Version: ([0-9.]+)", string:banner);
if(!version[1])
  exit(0);

vers = version[1];

if(check_version(vers:vers, fixed:"6.0.2600.5949", range:"6.0.2600.5000")   || # xp sp3
   check_version(vers:vers, fixed:"5.0.2195.7381", range:"5.0.2195.0")      || # win 2000
   check_version(vers:vers, fixed:"6.0.3790.4675", range:"6.0.3790.0")      || # xp professional x64, win 2003
   check_version(vers:vers, fixed:"6.0.2600.3680", range:"6.0.2600.0")      || # xp sp2
   check_version(vers:vers, fixed:"7.5.7600.16544", range:"7.5.7600.16000") || # Server 2008 R2 x86/x64/ia64
   check_version(vers:vers, fixed:"7.5.7600.20660", range:"7.5.7600.20000")) { # Server 2008 R2 x86/x64/ia64
  report = report_fixed_ver(installed_version:vers, fixed_version:"See references");
  security_message(port:port, data:report);
  exit(0);
}

# extra check for some windows 2008 versions
else if((vers =~ "^[6-7]\.0\.6001\." && version_in_range(version:vers, test_version:"6.0.6001.22000", test_version2:"7.0.6001.22647")) || # Server 2008 32bit/x64
        (vers =~ "^[6-7]\.0\.6002\." && version_in_range(version:vers, test_version:"6.0.6002.18000", test_version2:"7.0.6002.18221"))) { # Server 2008 SP2 32bit/x64
  report = report_fixed_ver(installed_version:vers, fixed_version:"See references");
  security_message(port:port, data:report);
  exit(0);
}

exit(99);