Google Picasa Installed (Mac OS X)

2013-04-11T00:00:00
ID MACOSX_PICASA_INSTALLED.NASL
Type nessus
Reporter Tenable
Modified 2018-07-30T00:00:00

Description

Google Picasa is installed on the remote Mac OS X host.

                                        
                                            #TRUSTED 707653413cec2d828c58c3231a8df92d5033f145f72e1c426e9a8151447e1e3e7c6e834e52a0e7d5b4a2e44565460694083fa7aa28b8a00dddbfd914bbe7486d51be5b946fc6379ec1f753836c0508bc58a86deb9aac9df5b09e360710a0359082598d54815c8b4163344ff5a110fb7b7e00b267c9d6618266cb05d54f6e8518cc4d4c60a1c3b2ebc8541ea33977acb6f6c2ad5cf2d432654afc2bb631369901ca86700316f2a291824c39b3bfd3e1cf63ed96aaea1fc7cfd6bca4fe0107809ce936105333b33d0f957910b27a0220cfafd26d70c5974406a5bcae8a6bea18618a54bb151f5a29c041177d3e80c6f3e6217d0942ffc6202a8617cc3c96afc0db27b3892f137fa6019ded3a44014e3738f13fda8328ff31afe80befbda563327c06748c3dad37c4cb425a718bf3a2d0e8ec8ff050e049a53f51e09fa93e6b57e1a7b6d13e5f2616a08e4047fb1f4fe608c6756acb573aa8e1ffe448f373e9331f9e19aac1e4de836dc596de8bd0c985ce65ba06e696a2692cbb1ae062b506f0ab2116c95e65a0409ab63131565afa15d86c0710bb11f13449b84ceaf26e58a13676f0f639a9281dacfad4573d03a6f1fcc3cab2ebad16c83a033a350ea5c8ecee799167dd1c96fb700bdd7256f6d1526edb76c4ffc8ebf8e216d2f82fbbef3c14f0e41519f06c6452866d6dbc870c55f8cf6295ecfd34bffaa476f2a15d065343
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(65924);
  script_version("1.8");
  script_set_attribute(attribute:"plugin_modification_date", value:"2018/07/30");

  script_name(english:"Google Picasa Installed (Mac OS X)");
  script_summary(english:"Gets Google Picasa version from Info.plist");

  script_set_attribute(attribute:"synopsis", value:"Google Picasa is installed on the remote Mac OS X host.");
  script_set_attribute(attribute:"description", value:"Google Picasa is installed on the remote Mac OS X host.");
  script_set_attribute(attribute:"see_also", value:"http://www.google.com/picasa/");
  script_set_attribute(attribute:"solution", value:"n/a");
  script_set_attribute(attribute:"risk_factor", value:"None");

  script_set_attribute(attribute:"plugin_publication_date", value:"2013/04/11");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:google:picasa");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"MacOS X Local Security Checks");

  script_copyright(english:"This script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version");

  exit(0);
}


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


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")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

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

appname = "Google Picasa";
kb_base = "MacOSX/Picasa";

path = '/Applications/Picasa.app';
plist = path + '/Contents/Info.plist';
cmd = 'cat \'' + plist + '\' | ' +
  'grep -A 1 CFBundleVersion | ' +
  'tail -n 1 | ' +
  'sed \'s/.*string>\\(.*\\)<\\/string>.*/\\1/g\'';
version = exec_cmd(cmd:cmd);

if (!version)
{
  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][0-9.]+$") audit(AUDIT_VER_FAIL, appname);

set_kb_item(name:kb_base+"/Installed", value:TRUE);

ver = split(version, sep:".", keep:FALSE);
for (i=0; i<max_index(ver); i++)
  ver[i] = int(ver[i]);

version_ui = ver[0] + "." + ver[1] + " Build " + ver[2] + "." + ver[3];

set_kb_item(name:kb_base+"/Version", value:version);
set_kb_item(name:kb_base+"/Version_UI", value:version_ui);
set_kb_item(name:kb_base+"/Path", value:path);

register_install(
  app_name:appname,
  path:path,
  version:version,
  display_version:version_ui,
  cpe:"cpe:/a:google:picasa");

report_installs(app_name:appname);