• Mac OS X,  Mac Security

    A couple one-liners for analyzing Mac app usage

    Reporting on application usage is an interesting topic on the Mac. This is done automatically with a number of device management solutions. But there are things built into the OS that can help as well. mdls "/Applications/Xcode.app" -name kMDItemLastUsedDate | awk '{print $3}' Now, if you happen to also need the time, simply add ,$4 to the end of your awk print so you can see the next position, which is the time. Additionally, a simple one-liner to grab the foreground app via AppleScript is: osascript -e 'tell application "System Events"' -e 'set frontApp to name of first application process whose frontmost is true' -e 'end tell' That’s pretty much…

  • Mac OS X,  Mac OS X Server,  Mac Security

    A Service-By-Service Guide For Moving Away From macOS Server

    I’ve been making guides to macOS Server since Server 2: Mountain Lion Server (Server 2) Yosemite Server (Server 3) Mavericks Server (Server 4) OS X Server 5 (for El Capitan) macOS Server 5.2 (for macOS Sierra) macOS Server 5.4 (for High Sierra) And along the way, I’ve also sold plenty of books on Mac Servers and gotten a lot of opportunities I might not have gotten otherwise. So thank you to everyone for joining me on that journey. After teaching so many how to use the services that Apple made available in their server operating system, when they announced they’d no longer be making many of the services my readers…

  • Mac OS X,  Mac Security

    Using Apple’s Built-In Malware Removal Tool (MRT)

    macOS now comes with a vulnerability scanner called mrt. It’s installed within the MRT.app bundle in /System/Library/CoreServices/MRT.app/Contents/MacOS/ and while it doesn’t currently have a lot that it can do – it does protect against the various bad stuff that is actually available for the Mac. To use mrt, simply run the binary with a -a flag for agent and then a -r flag along with the path to run it against. For example, let’s say you run a launchctl command to list LaunchDaemons and LaunchAgents running: launchctl list And you see something that starts with com.abc. Let me assure you that nothing should ever start with that. So you can scan it using…

  • Mac OS X,  Mac Security

    Managing Google SafeBrowsing in Firefox for Mac

    Firefox describes their malware posture at https://support.mozilla.org/en-US/kb/how-does-phishing-and-malware-protection-work which heavily leverages Google SafeBrowsing, as do many a browser. Settings for SafeBrowsing are set in the browser.safebrowsing.downloads.remote.enabled pref. To lock this pref, you would need to create an autoconfig.js file in  /Applications/Firefox.app/Contents/Resources/defaults/pref that points to a firefox.cfg file with a lock pref in it. To do so, create the autoconfig.js file and paste in these settings: // Configure SafeBrowsing pref("general.config.filename", "firefox.cfg"); pref("general.config.obscure_value", 0); Then create the firefox.cfg file and paste in these settings: // Configuring SafeBrowsing lockPref("browser.safebrowsing.downloads.remote.enabled", TRUE) Live Firefox preferences can be seen at /Users/charles.edge 1/Library/Application Support/Firefox/Profiles/*.default. Because SafeBrowsing is enabled by default, you shouldn’t see it listed unless it’s been disabled. But you can confirm it’s doing its…

  • Mac Security

    Notes On Google SafeBrowsing And Safari

    Most phishing sites follow a known pattern. And people like to flag bad sites. So Google and a few other organizations, such as stopbadware.org have a collection of feeds that can be leveraged by software vendors to provide a warning or flat-out block potentially fraudulent sites. If a piece of malware is found, even if buried deep in a site, the site will likely get picked up by a robot or reported by a user. Robots can pick up a lot, as people who exploit WordPress sites and stuff like that are often after playing a numbers game. Harvesting hundreds of thousands or email address and sending phishing emails. It only…

  • Mac OS X,  Mac Security

    Check Versions of Common Apps and Services on macOS

    Just some little one-liners to grab the version of a few common Apple services/built-in apps you might need the version of for another project I’m working on kinda’: cups: cups-config –version Finder: mdls -name kMDItemVersion /System/Library/CoreServices/Finder.app | cut -d ‘”‘ -f2 Help Viewer: mdls -name kMDItemVersion /System/Library/CoreServices/HelpViewer.app | cut -d ‘”‘ -f2 iBooks Author: mdls -name kMDItemVersion /Application/iTunes\ Author.app | cut -d ‘”‘ -f2 ical/Calendar: mdls -name kMDItemVersion /Applications/Calendar.app/ | cut -d ‘”‘ -f2 ichat/Messages: mdls -name kMDItemVersion /Applications/Calendar.app/ | cut -d ‘”‘ -f2 iMovie: mdls -name kMDItemVersion /Applications/iMovie.app | cut -d ‘”‘ -f2 installer: /usr/sbin/installer -vers Photos/iPhoto: mdls -name kMDItemVersion /Applications/Photos.app | cut -d ‘”‘ -f2  iTunes: mdls -name…