Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created May 28, 2019 20:09
Show Gist options
  • Save AndrewWCarson/da838316883496810ec0a1a7c489c42f to your computer and use it in GitHub Desktop.
Save AndrewWCarson/da838316883496810ec0a1a7c489c42f to your computer and use it in GitHub Desktop.
Report True/False based on Stealth Mode settings.
#!/bin/bash
if /usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode | grep enabled >& /dev/null; then
echo "true"
elif /usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode | grep disabled >& /dev/null; then
echo "false"
else
echo "Error: could not read valid Stealth Mode value."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment