When you think of hacking, MacOS probably doesn’t spring to mind. Likely you think of Linux, BSD, or even Windows as the platform of choice for techies and tinkerers who want to break into something. Yet MacOS offers a unique value proposition: the Unix-y goodness and flexibility of Linux, with the user friendly ease of Windows. Whether it’s installing apps via the command line, booting up Kali in a virtual machine, or auditing a smart contract using pentesting tools, using MacOS for hacking is a surprisingly delightful experience.
In this article, we’re going to cover some common use cases and show you how MacOS makes hacking convenient. We’ll also touch on some inconveniences where MacOS falls short compared to other OSes.
Let’s get started!
Brew: The Missing MacOS Package Manager
First off, you need a way to install hacking tools on MacOS. A modern hacker simply cannot get by without access to important utilities such as Git, a code editor, NPM, and so on. So how do we get these?
Simple – first, go to https://brew.sh/ and run the install command on their home page. Then, try to install something to make sure it worked. For example, let’s install Brew and then use it to install the classic IRC client loved by hackers from the early 2000s: IRSSI.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Installing Brew...
Done.
$ brew install irssi
Fetching irssi package...
Installing irssi
Done!
Irssi installed in ~/.Applications/
That’s all there is to it! You can install nmap, wget, netcat, or whatever other hacky tool catches your fancy. Essentially, it’s the same approach to managing apps as you’re used to with apt or yum on Linux.
Even more complex software, like Visual Studio Code, is only one command away. When installing an app that doesn’t run in the command line, you just add the –cask option to Brew, like so:
$ brew install --cask visual-studio-code
Visual Studio Code is already installed!
Reinstall? n
$
You can find out if an app is available via brew via the search bar on https://formulae.brew.sh/. Though it’s often enough to just type brew install <app_name> and it magically works.
Running other OSes within MacOS
Sometimes, when you’re hacking, you simply need to use Kali Linux. Luckily, running VMs in MacOS takes very little work. If you want the most convenient UX, install Parallels: https://www.parallels.com/
Beware! Parallels costs around 20 bucks a month. So if you want something free, you should stick with UTM: https://mac.getutm.app/. That’s what we’re going to use for this article. You’ll also need to download a .iso image for the OS you want to install. You can get the Kali Linux .iso from this web page: https://www.kali.org/get-kali/#kali-installer-images
They even offer it as a Torrent!
You can run as many different OSes as you want, including different images of the same OS. The UI (assuming you chose UTM) looks like this:
In addition to taking advantage of hacking based OSes like Kali Linux, UTM also makes it much more convenient to test exploits against other operating systems. The flexibility is wild when you realize you can run as many different OSes on the same box, and network them all together, to practice pentesting whatever system you wish. For example, let’s say you’re doing a pentest for a bank in Southeast Asia and you notice they still use old versions of XP for some of their public ATM machines.
Running Windows from within MacOS
Normally, you’d want to test this on a machine with Windows installed, right? Nope, not necessary at all! With UTM, you can run Windows within MacOS, and send data between the two via the local network. And the best part is, it’s just a VM, so if you break it you can seamlessly boot it back up from a fresh ISO. Doing so on an OS installed on your actual machine would be much riskier.
For example, in the screenshot below, I’m accessing MacOS from within Windows XP via Telnet:
There’s really no limit, but it does require some networking knowledge. A good place to start would be our intro to networking: Networking basics for hackers. Otherwise, communicating between VM and host, or even between multiple different VMs running simultaneously on the same host, is pretty seamless.
Customizing MacOS for hacking
MacOS isn’t just good for hacking other systems, it’s also a delightfully hackable system that you can modify in a bunch of fun ways. Apple really values power users, and it shows. There are even Linux style alt desktop envs that you can run on MacOS, which you can learn more about here: https://apple.stackexchange.com/questions/439978/different-desktop-environment-for-mac.
One of the best ways to make life easier on Linux is the Automator app. It lets you run scripts at fixed times – sort of like a modern day cron. The UI looks like this:
Any aspiring MacOS hacker ought to spend at least a weekend learning the ins and outs of Automator. Once you get used to it, Linux automation even feels like a chore in comparison. One final note, MacOS offers a ton of neat keyboard shortcuts to make life simpler for power users. You can find a concise list here: https://support.apple.com/en-us/HT201236
Learn more about MacOS for hacking
As a hacker, you’ll doubtless find immense pleasure in securing your own system. Here are some useful links for learning about hardening MacOS:
Beyond that, MacOS is a pretty relevant target for pentesting. After all, a good portion of tech workers use Apple devices at work. Here are some resources for learning about targeting and hacking into MacOS:
- A Deep Dive into Penetration Testing of macOS Applications
- macOS Red Teaming
- The ultimate guide to macOS Security
The most important thing for a budding MacOS hacker is to develop strong intuitions for the technical foundation of the system. So lookup MacOS internals and start tinkering with your system. Luckily, a lot of knowledge carries over from Linux, due to both being Unix-based operating systems. Still, MacOS internals are a complex beast.
Perhaps the most exciting way for curious hackers to master the Mac is by getting involved with Asahi Linux, which aims to port Linux to the Apple Silicon architecture. you can learn more about their work here: https://asahilinux.org/about/.
Good luck and happy hacking!
Leave a Reply