VMware Fusion Version Detection (Mac OS X)

2010-11-29T00:00:00
ID MACOSX_FUSION_DETECT.NASL
Type nessus
Reporter This script is Copyright (C) 2010-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
Modified 2010-11-29T00:00:00

Description

The remote host is running VMware Fusion, a popular desktop virtualization software.

                                        
                                            #TRUSTED 29c7c580df4e1c3669d87984c727e9f4097f43bd6f799667c45ac62adccb6e14b5f4747c8608c2970de81c4ae69cf26fdc572744a2da3056ae8f61945667b30d926d19ca6d8159f3006f229064e86ba534935f5c19ec8924f0884b59d4d14300ce1652228bfdba97142313d61c9337414a6e56f15d36a56aa6b87c09978cf6652795a3f22ba02c0953e1ab13be43e6262b65948a8cfccccde162deb82512b46656d7edd03e0767a4465498b1dd5bc6169c267f106c753e48aaeab0413a6a0f96e07e794f0ac5f5dc979865c82f85e205b05ab5c2232257c971ebebe85b09c53e1e0beea1dd8b345a9c77f1e6db42fcc28e91c60ae6bf53db4ff0ebf51f0a14a5599c0a3350ed9e5089ec777709f1e588f8899261c568bef149617f608b5a80859090074fa44653be1eb3315612c5082176a57d1d8142d893a1b807bf251a8b0a623d53e7f54d062fe769d2096dace1967f5de64bfe9f4621d59acead1172050b4eaaad15acfa9be6bc986c417e07a43610311e5e70a1ab49adfadfda8fffa55fb237485aef49328ac2c551ae6fecc2ef9b39be7ecb9196490dbaf1bde4bc1c425bb6b3d8511c1c5de739791b1e879c9a68a942e4316914cbee87c84a386598659285d7568bc405c321cdf85020b4a4d1ef149d953ed3e88395c90c325e15ae4e2877eca7102d82336b0c368cc27db8b5c1043cb3b6547372555dbb15ac7f1301
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(50828);
  script_version("1.17");
  script_set_attribute(attribute:"plugin_modification_date", value: "2020/09/22");

  script_xref(name:"IAVT", value:"0001-T-0735");

  script_name(english:"VMware Fusion Version Detection (Mac OS X)");
  script_summary(english:"Checks the version of VMware Fusion");

  script_set_attribute(attribute:"synopsis", value:"The remote Mac OS X host has a copy of VMware Fusion installed.");
  script_set_attribute(attribute:"description", value:
"The remote host is running VMware Fusion, a popular desktop
virtualization software.");
  script_set_attribute(attribute:"solution", value:
"Make sure use of this program agrees with your organization's
acceptable use and security policies.");
  script_set_attribute(attribute:"risk_factor", value:"None");

  script_set_attribute(attribute:"plugin_publication_date", value:"2010/11/29");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:vmware:fusion");
  script_set_attribute(attribute:"asset_inventory", value:"True");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"MacOS X Local Security Checks");
  script_copyright(english:"This script is Copyright (C) 2010-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/MacOSX/Version");

  exit(0);
}


include("audit.inc");
include("global_settings.inc");
include("macosx_func.inc");
include("misc_func.inc");
include("ssh_func.inc");
include("install_func.inc");


if(sshlib::get_support_level() >= sshlib::SSH_LIB_SUPPORTS_COMMANDS)
  enable_ssh_wrappers();
else disable_ssh_wrappers();

appname = "VMware Fusion";
kb_base = "MacOSX/Fusion/";

if (!get_kb_item("Host/local_checks_enabled"))
  audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

os = get_kb_item("Host/MacOSX/Version");
if (!os) audit(AUDIT_OS_NOT, "Mac OS X");

path = "/Applications/VMware Fusion.app";
plist = path + "/Contents/Info.plist";
cmd =  'cat \'' + plist + '\' | ' +
  'grep -A 1 CFBundleShortVersionString | ' +
  'tail -n 1 | ' +
  'sed \'s/.*string>\\(.*\\)<\\/string>.*/\\1/g\'';
version = exec_cmd(cmd:cmd);
if (!strlen(version)) audit(AUDIT_NOT_INST, appname);

if (version !~ "^[0-9]") exit(1, "The " + appname + " version does not look valid (" + version + ").");

set_kb_item(name:kb_base+"Installed", value:TRUE);
set_kb_item(name:kb_base+"Path", value:path);
set_kb_item(name:kb_base+"Version", value:version);

register_install(
  app_name:appname,
  path:path,
  version:version,
  cpe:"cpe:/a:vmware:fusion");

report_installs(app_name:appname);