code | #TRUSTED 5889fa49c703286459f5646f4e1df94bbae34a5d7d503fd28f5b38e8b8046b9ba0368b153677a5892cb7d76ecac56c15e164185ff0efb3e30522c092a594238d31237397cd566d436e26304ff22e8622626086c75b49ea3fcce1876b4fbba8e3154b5c98e53029113436c09342a40a6710a7c1ea373409e718e36e56a239260c11d63b79016bd00b5c704d299a68b962730ec248f8ffcb48c0b8b2de0ae7d46268778f59729c4b33a46bf6a213706cdbbc93bb9bf5eadad64ab3b085dd1441ab5af6ce2321f70d7cb88cd5d10531beda994cce51a2555a274ff4574c639ed6ac9c4e87c7de9f5fde68fb5b25ba8be82feba103a723b0b5b6325aa141d24ef8559d509a098742a660c13c50a58e15a740077bfa230276246a51f4ad4e2f00c9bdb9c71307735661080e071e8c54fc298937803b581e5bb3940a32a3b1e3556fd94a94b5d989db4ad5a2a86211cbda8ebabf77168d88c1f45169316844762c6d86e7f98703156783543cd6c742bcf5db3e992f7109d10ca0ffab4bc09b2468f267c36fb0f622e0bce253bfa4900af143ea89a0d0139928885bc8d3a06680169a9649e3286e5df0d96169e90c4ee9622ce612bd7bf897927c085e2ec785995ecfd5ed7e781c541da094438dc7806df17849576152ed9f727c4f38e3a7c806aaa8940de9a31f0e53e03134f7625092e7a78277942cba3bda27bfb03d9b4be5cca95e
#
# (C) Tenable Network Security, Inc.
#
include("compat.inc");
if (description)
{
script_id(109400);
script_version("1.6");
script_cvs_date("Date: 2019/11/08");
script_cve_id("CVE-2018-0239");
script_bugtraq_id(103923);
script_xref(name:"CISCO-BUG-ID", value:"CSCvf32385");
script_xref(name:"CISCO-SA", value:"cisco-sa-20180418-staros");
script_xref(name:"IAVA", value:"2018-A-0137");
script_name(english:"Cisco ASR StarOS Interface Forwarding Denial of Service Vulnerability (cisco-sa-20180418-staros)");
script_summary(english:"Checks the StarOS version.");
script_set_attribute(attribute:"synopsis", value:
"The remote device is affected by a denial of service vulnerability.");
script_set_attribute(attribute:"description", value:
"According to its self-reported version and model number, the remote
Cisco ASR device is affected by a denial of service vulnerability.
Please see the included Cisco BID and the Cisco Security Advisory for
more information.");
# https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20180418-staros
script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?b84fc064");
script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvf32385");
script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco bug ID
CSCvf32385.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H");
script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-0239");
script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
script_set_attribute(attribute:"vuln_publication_date", value:"2018/04/18");
script_set_attribute(attribute:"patch_publication_date", value:"2018/04/18");
script_set_attribute(attribute:"plugin_publication_date", value:"2018/04/27");
script_set_attribute(attribute:"potential_vulnerability", value:"true");
script_set_attribute(attribute:"plugin_type", value:"local");
script_set_attribute(attribute:"cpe", value:"cpe:/o:cisco:staros");
script_set_attribute(attribute:"cpe", value:"cpe:/h:cisco:asr_5700");
script_set_attribute(attribute:"cpe", value:"cpe:/a:cisco:asr_5700_series_software");
script_set_attribute(attribute:"stig_severity", value:"I");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"CISCO");
script_copyright(english:"This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("ssh_get_info.nasl");
script_require_keys("Host/Cisco/ASR/Model", "Host/Cisco/StarOS", "Settings/ParanoidReport");
exit(0);
}
include("audit.inc");
include("cisco_func.inc");
include("cisco_kb_cmd_func.inc");
get_kb_item_or_exit("Host/Cisco/StarOS");
version = get_kb_item_or_exit("Host/Cisco/StarOS/Version");
model = get_kb_item_or_exit("Host/Cisco/ASR/Model");
major = NULL;
build = NULL;
fix = NULL;
train = NULL;
# only affects ASR 5700 series systems
if (model !~ "^57\d{2}$")
audit(AUDIT_DEVICE_NOT_VULN, 'The ASR ' + model);
# Normalize train characters
version= toupper(version);
# For newer versions, We may be able to get the build number during detection
build = get_kb_item("Host/Cisco/StarOS/Build");
if (!empty_or_null(build))
version += "." + build;
# defensive check for the pregmatches below
if (version !~ "^[\d\.]+\([\d\.]+" &&
version !~ "^[\d\.]+([A-Z]{1,2}\d+)?\.\d+$")
audit(AUDIT_VER_FORMAT, version);
if (report_paranoia < 2) audit(AUDIT_PARANOID);
# old style of versioning 15.0(5439), style change mid 16.1, making
# all of the old style versions fall into the vulnerable range.
if ("(" >< version)
{
major = pregmatch(pattern:"^([\d\.]+)\(", string:version);
if(!isnull(major))
{
major = major[1];
if (isnull(build))
{
build = pregmatch(pattern:"^[\d\.]+\(([\d\.]+)", string:version);
if(!isnull(build))
{
build = build[1];
# Set the train to an empty string, or it causes issues when
# seeing if a patched version exists using NULL as the value
train = '';
}
else
exit(1, "Unable to extract build number.");
}
}
else
exit(1, "Unable to extract version number.");
}
else
{
# extract major, train, and build for new style
extract = pregmatch(pattern:"^([\d\.]+)\.([A-Z]{1,2}\d+)?\.?(\d+)?", string:version);
if (!isnull(extract))
{
major = extract[1];
train = extract[2];
if (isnull(build))
build = extract[3];
}
}
# Defensive checking for versions that we haven't yet seen
if(empty_or_null(major) || empty_or_null(build))
exit(1, "An error occurred during version extraction.");
fix_array = make_array(
"21.0", make_array("v4", 67670),
"21.1", make_array("v6", 67740),
"21.4", make_array("C0", 68000, "D0", 67675, "M0", 67671)
);
if (major == "21.3.1" && int(build) < 67739)
fix = "21.3.1.67739";
else if (major == "21.4.0" && int(build) < 68051)
fix = "21.4.0.68051";
else if (!empty_or_null(fix_array[major]) &&
!empty_or_null(train) &&
int(build) < fix_array[major][train])
fix = major + "." + train + "." + fix_array[major][train];
else audit(AUDIT_DEVICE_NOT_VULN, "ASR " + model, version);
override = FALSE;
flag = FALSE;
if (get_kb_item("Host/local_checks_enabled"));
{
buf = cisco_command_kb_item(
"Host/Cisco/Config/show_support_details_grep_Cisco_VIC",
"show support details | grep 'Cisco VIC'"
);
if (check_cisco_result(buf))
{
if (preg(multiline:TRUE, pattern:"Cisco VIC", string:buf))
flag = TRUE;
}
else if (cisco_needs_enable(buf)) override = TRUE;
if (!flag && !override) audit(AUDIT_HOST_NOT, "affected because vulnerable features are not enabled");
}
security_report_cisco(
port : 0,
severity : SECURITY_WARNING,
override : override,
version : version,
fix : fix,
bug_id : 'CSCvf32385'
);
|