Hack A Mac - With Only 30 Seconds of Physical Access
Hack A Mac - With Only 30 Seconds of Physical Access
Hack A Mac - With Only 30 Seconds of Physical Access
Published by
Disclaimer: The information contained in this guide is for informational purposes only. Any instructions in this guide are intended to be performed on a machine that you have permission to use, as well as permission to execute the following commands and procedures upon. We take absolutely no responsibility for any damages of any kind resulting from the use of any knowledge in this guide. By reading further, you agree release HackMac.org from any and all liability, and assume all responsibility for your own actions. No part of this publication shall be reproduced, transmitted, or sold in whole or in part in any form, without the prior written consent of the author. All trademarks and registered trademarks appearing in this guide are the property of their respective owners. Users of this guide are advised to use their own due diligence when it comes to making any sort of decisions and all information, products, and services that have been provided should be independently veried by your own qualied professionals. By reading this guide, you agree that HackMac.org and its authors are not responsible for the success or failure of your decisions relating to any information presented in this guide.
Table of Contents
Chapter 1: The Admin Hack!
Boot into Single-User Mode! Mount the Hard Drive! Remove the Setup has been completed File! Reboot! Watch the Video! Continue Setup! Set up the Administrator Account! Finish Setup and Log In!
5
6 6 6 7 7 7 8 8
9
10 11
12
13 13
14
15 15
17
4
Log in and open Terminal.! Finding the GUID (Globally Unique Identier)! The Password Hash! Obtaining the Hash! 18 18 19 19
20
21 22 22
6
Boot into Single-User Mode
Turn on the computer. When you hear the startup chime hold down the keys CMD+S. This key combination boots the computer into Single-User Mode (SUM), giving you temporary root access. It is important to note that this can be blocked by a firmware password. If thats the case, take a look at our guide on how to get into single-user mode while locked.
/sbin/mount -uw /
rm /var/db/.applesetupdone
This deletes the afore mentioned file (aptly named .applesetupdone), which is stored in the /var/db/ directory.
Reboot
This step is pretty self explanatory. We need the system to exit SUM and reboot so that it can check for the file we just deleted and not find it. Type in the following and press return:
reboot
Continue Setup
Continue through the rest of the setup process. See the next step for setting up the administrator account. Heads Up: Be sure to select DO NOT TRANSFER MY DATA. Dont worry, all of your old files will still be on the computer, you just dont have any files from an older computer to be transferred.
10
Option 1: Enable Root Via GUI
Enabling the Root User through the GUI is different depending on your version of Mac OS X.
11
sudo passwd root When prompted, youll be asked to enter your administrator password. Do so. It may not look like youre typing when youre doing it, but trust me, you are. Hit enter after you type your password. The system will then ask you to enter in a root password twice. Pick a new password, type in it and press enter. Enter the same password for confirmation.
12
13
14
15
If you want to stop it from Terminal, replace start with stop, as so: sudo /sbin/service ssh stop
With SSH enabled, you can send Bash commands (you can take a look at our Bash 101 series to learn more about Bash) or AppleScript commands from the Terminal of another computer. To learn more about how to log in using SSH, and other SSH basics, please see our article on it: Remotely Control a Computer: A Basic SSH Tutorial
16
Thats It.
Youve gained root access and the ability to command the computer remotely with SSH.
Chapters 5 & 6
Chapters 5 & 6 follow this page and explain how to recover any users password in cleartext on that computer. That means actually viewing the unencrypted password of any account on the computer.
17
18
You should get a value that looks like A66BCB30-2413-422A-A574-DE03108F8AF2. This is the GUID. Write it down, well need it later on.
19
20
21
At this point, you no longer need physical access to the target computer, and can perform the rest of the commands on another computer. Well use the application John the Ripper (John) to decrypt the hash. John will use brute force to determine what the password is in cleartext. That means that the application will systematically generate passwords, encrypt them into the salted SHA1 hash (the encryption scheme that Apple uses for its passwords), and check them against the hash you found to see if the password matches. If it matches, then John has found the password. You can download John the Ripper for Mac OS X here, and for Windows here. Open up the zip file (Nowadays, Mac OS X will usually unzip it for you) and drag the John the Ripper folder into your base directory (also known as your home folder). This can get a little tricky so be sure to follow the instructions correctly.
crackMe:33BA7C74C318F5D3EF40EB25E1C42F312ACF905E20540226
22
cd /name_of_your_john_folder/. If you decided to be a rebel and leave the John the Ripper folder in a different directory, you just need to type in the full path to the directory from your home folder.
23
Depending on the complexity of the password this process could take anywhere from a second to a day, so be patient. When John is successful at cracking the hash, it will display something along the lines of: password (crackMe)guesses: 1 time: 0:00:00:00 100% (2) c/s: 153000 trying: password Any text after trying: should be the password. In this case, the user account crackMe has the password: password
24