Skip to content

Instantly share code, notes, and snippets.

@triti
Last active August 29, 2015 14:17
Show Gist options
  • Save triti/e467f015b7657d6f18bc to your computer and use it in GitHub Desktop.
Save triti/e467f015b7657d6f18bc to your computer and use it in GitHub Desktop.
Absolute Manage custom information field to check for /mach_kernel visibility.
#!/bin/bash
# https://gist.github.com/e467f015b7657d6f18bc
# This custom information field checks for the hidden flag on /mach_kernel
# if the file exists.
# Adapted from Rich Trouton's adaption of Tim Sutton's script.
# Link: https://derflounder.wordpress.com/2015/03/11/fixing-mach_kernel-file-visibility-using-casper/
# Link: http://macops.ca/security-updates-leaving-mach_kernel-visible/
if [[ -e /mach_kernel ]]; then
# Simple test for a static substring in Bash
if [[ "$(/bin/ls -lO /mach_kernel)" = *hidden* ]]; then
echo "Hidden"
else
echo "Visible"
fi
else
echo "Not present"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment