Adobe Flash Professional for Mac Installed

2012-05-17T00:00:00
ID MACOSX_FLASH_PROFESSIONAL_INSTALLED.NASL
Type nessus
Reporter This script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
Modified 2012-05-17T00:00:00

Description

Adobe Flash Professional for Mac, a multimedia authoring application, is installed on the remote Mac OS X host.

                                        
                                            #TRUSTED a4156c69cbe967c12deb45e751f614c992eaa3f37c27740178728f7cc59d8c830fff488a09882a19770ae28f44d0144481b1770e04d804b9cef7d8b6408856ccb716fdb50fc5bc6d2e47a3b3240f5c082b41a90455a6dc7a1e23cbafa42035b5dc4719062ceada275705547d634097b51a8909cbe6818eaa6779387a26194f99cbde5abf52141f153bc77bb5bb70f244c7b6c0b7a7e6914f1e3604542c04ac57e52103bb3c3019d10d3ba92b66bce3fec1b241199d942fedf4c1f2c7fc0a8a6dc04c1278a06e8a903c35c6842c37dc15db5ba63a5b17bca1904274d1325382575b5f9c71296e4f3a23c56657ae0a24e7f1c2bed459f42d4ba2960f66d64673a82e412e7dbcadcc0798208ca9f76a5761e030c0322e82946d47ce171708e493ebba7bb3803314caec3caa281fb93776f65c822db1ce2626874ac47a030d0ee9e4f2689843624bf305d35875a8fe9770f40aecf4137ed9505499d57ceeec93d756f04b18b5e49895a52722b1eb8476f10b0433d3efd0f1e03b26fd4ee27fbf7a5e75b8ccf2fde55092b6cacd25e4ebf34c7c8b01f00d294923e3b55eb86758c499f89100ad20b8d67f8ba5437531ab0b408a4bd512f45b38b00002e1661d5974117cdb806f664eef58268311b5b117aa9a1454d3c37aeb6a828a9b4783cedb05b0806a98b0afeb157933c771463a39aa8966cafe8d38aa035b444c2a7a7b11869c
#
# (C) Tenable Network Security, Inc.
#

include('compat.inc');

if (description)
{
  script_id(59177);
  script_version("1.19");
  script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/12");

  script_name(english:"Adobe Flash Professional for Mac Installed");
  script_summary(english:"Gets Adobe Flash Professional version from Info.plist");

  script_set_attribute(attribute:"synopsis", value:"The remote Mac OS X host contains a multimedia authoring application.");
  script_set_attribute(attribute:"description", value:
"Adobe Flash Professional for Mac, a multimedia authoring application,
is installed on the remote Mac OS X host.");
  script_set_attribute(attribute:"see_also", value:"http://www.adobe.com/products/flash.html");
  script_set_attribute(attribute:"solution", value:"n/a");
  script_set_attribute(attribute:"risk_factor", value:"None");

  script_set_attribute(attribute:"plugin_publication_date", value:"2012/05/17");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:adobe:flash");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:adobe:flash_cs");
  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) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl", "command_builder_init.nasl");
  script_require_keys("Host/MacOSX/packages");

  exit(0);
}

include('audit.inc');
include('global_settings.inc');
include('misc_func.inc');
include('ssh_func.inc');
include('telnet_func.inc');
include('hostlevel_funcs.inc');
include('macosx_func.inc');
include("install_func.inc");
include('sh_commands_find.inc');

app = 'Adobe Flash Professional';

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

if (!get_kb_item('Host/local_checks_enabled')) exit(0, 'Local checks are not enabled.');
packages = get_kb_item_or_exit('Host/MacOSX/packages');
kb_base = 'MacOSX/Adobe Flash Professional';

if (islocalhost())
{
  if (!defined_func("pread")) audit(AUDIT_FN_UNDEF,"pread");
  info_t = INFO_LOCAL;
}
else
{
  sock_g = ssh_open_connection();
  if (!sock_g) audit(AUDIT_FN_FAIL, 'ssh_open_connection');
  info_t = INFO_SSH;
}

# Get a list of install directories, given that multiple versions can be installed
err = '';
dirs = sh_commands::find('/Applications', '-xautofs', '-tenb_fstype_exclusions', '-tenb_path_exclusions', '-name', 'Adobe Flash CS*', '-mindepth', '1', '-maxdepth', '1', '-type', 'd');
if (dirs[0] == sh_commands::CMD_OK)
{
  dirs = dirs[1];
}
else if (dirs[0] == sh_commands::CMD_TIMEOUT)
{
  err = 'Find command timed out.';
}
else
{
  err = dirs[1];
}

if (info_t == INFO_SSH) ssh_close_connection();

if (!empty_or_null(err)) exit(1, err);

if (empty_or_null(dirs)) audit(AUDIT_NOT_INST, app);

install_count = 0;
foreach dir (split(dirs, keep:FALSE))
{
  base_dir = (dir - '/Applications') + '.app';

  plist = dir + base_dir + '/Contents/Info.plist';

  cmd =
    'plutil -convert xml1 -o - \'' + plist + '\' 2>/dev/null | ' +
    'grep -A 1 CFBundleShortVersionString | ' +
    'tail -n 1 | ' +
    'sed \'s/.*<string>\\(.*\\)<\\/string>.*/\\1/g\'';
  version = exec_cmd(cmd:cmd);
  if (isnull(version) || version !~ '^[0-9\\.]+') version = 'n/a';

  if (!isnull(version) && version =~ '^[0-9\\.]+')
  {
    set_kb_item(name:kb_base+base_dir+'/Version', value:version);
  }

  register_install(
    app_name:app,
    path:dir,
    version:version,
    cpe:"cpe:/a:adobe:flash");

  install_count += 1;
}

if (install_count)
{
  set_kb_item(name:kb_base + '/Installed', value:TRUE);
  report_installs(app_name:app, port:0);
}
else exit(1, 'Failed to extract the installed version of Adobe Flash Professional.');