[
  {
    "path": ".gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Jerry Gamblin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "# Black Hat macOS Config\nA simple shell script to configure your Mac to some of the most commonly recommended settings for the world's most dangerous hacking conferences (Black Hat/Defcon) or every day life.\n\n**Warning:** Tool does not ask before making changes.\n\n## What It Does:\n- Deletes Saved Wireless Networks.\n- ~~Disable Wireless Network Auto Join.~~ < This cant be done programmatically. `¯\\_(ツ)_/¯`\n- Require Password Immediately After Sleep\n- Turns On Firewall.\n  - Enables Stealth Mode\n- Installs Needed System Updates.\n- Validates System Integrity Protection is enabled.\n- Enables Full Disk Encryption.\n\nNote: Script Will Prompt For Password If Not Root.\n\n## Usage:\n- Review for your preferences and comment out options **You** don't want.\n- Set `homessid` and `workssid` variable to stop from deleting those!\n\nTo Run:  \n```\nchmod +x blackhat-macos-config.sh\n./blackhat-macos-config.sh\n```\n\n## Important Notice\nI likely don't know what I am doing and this could be done faster, better and simpler some other way. These scripts could also break your MacBook and make you cry.\n"
  },
  {
    "path": "blackhat-macos-config.sh",
    "content": "#!/bin/bash\n\nhomessid=\"AddMe\"\nworkssid=\"AddMe\"\n\nSECONDS=0\n\nRED='\\033[0;31m'\nNC='\\033[0m'\n\n#Check if running as root and if not elevate\nsudo -nv 2>>/dev/null\nif [ $? -ne 0 ]; then\n    printf \"Black Hat macOS Config requires root access.\\n\"\n    printf \"Please enter your password, or run 'sudo -v' first.\\n\"\n    sudo -v\n\n    #Validate we can sudo now\n    if [ $? -ne 0 ]; then\n      printf \"\\n\"\n      printf \"Still not root. Exiting.\\n\"\n      exit\n    fi\n    printf \"\\n\"\nfi\n\n#Delete Saved SSIDs For Security\n#Be Sure To Set Home And Work SSID for ease of use.\nprintf \"Deleting saved Wi-Fi networks.\\n\"\nIFS=$'\\n'\nfor ssid in $(networksetup -listpreferredwirelessnetworks en0 | grep -v \"Preferred networks on en0:\" | grep -v $homessid | grep -v $workssid | sed \"s/[\\\t]//g\")\ndo\n    networksetup -removepreferredwirelessnetwork en0 \"$ssid\" > /dev/null 2>&1\ndone\n\n\n#Enable Password Login:\nprintf \"Require Password Immediately After Sleep or Screen Saver Begins.\\n\"\ndefaults write com.apple.screensaver askForPassword 1 > /dev/null 2>&1\ndefaults write com.apple.screensaver askForPasswordDelay 0 > /dev/null 2>&1\n\n#Enable Firewall:\nprintf \"Enabling Firewall.\\n\"\n\n#This is a more \"open\" firewall config\n#https://discussions.apple.com/thread/3148672\ndefaults write /Library/Preferences/com.apple.alf globalstate 1  > /dev/null 2>&1\n\n#This is a more \"strict\" firewall config\n#defaults write /Library/Preferences/com.apple.alf globalstate 2  > /dev/null 2>&1\n\nprintf \"Enabling Stealth Firewall Mode.\\n\"\ndefaults write /Library/Preferences/com.apple.alf stealthenabled 1 > /dev/null 2>&1\n\n\n#Install Updates.\nprintf \"Installing needed updates.\\n\"\nsoftwareupdate -i -a > /dev/null 2>&1\n\n\n#Check if System Integrity Protection is enabled\nprintf \"Verifying System Integrity Protection (SIP) is enabled.\\n\"\ncsrutil=$(csrutil status)\nif [[ $csrutil = *\"disabled\"* ]]; then\n  printf \"${RED}WARNING: System Integrity Protection is disabled!${NC}\\n\"\n  printf \"To enable, you must boot into recovery mode and enable:\\n\"\n  printf \" - restart\\n\"\n  printf \" - during bootup, hold Cmd+R\\n\"\n  printf \" - click Utilities->Terminal\\n\"\n  printf \" - run: csrutil enable\\n\"\n  printf \" - run: reboot # to get back into standard macOS\\n\"\nfi\n\n#Enabling Firevault:\nprintf \"Enabling FDE.\\n\"\nfdesetup enable  > /dev/null 2>&1\n\n\n#Finishing Up.\ntimed=\"$((SECONDS / 3600)) Hours $(((SECONDS / 60) % 60)) Minutes $((SECONDS % 60)) seconds\"\nprintf \"It took %s to help get your Mac ready for Black Hat.\\n\" \"$timed\"\n"
  }
]