Last active
August 29, 2015 14:17
-
-
Save triti/e467f015b7657d6f18bc to your computer and use it in GitHub Desktop.
Absolute Manage custom information field to check for /mach_kernel visibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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