Skip to content

A multithreaded, fast approach to cracking iOS Restrictions passcodes

License

Notifications You must be signed in to change notification settings

alex-taffe/iOS-Restrictions-Cracker

Repository files navigation

iOS-Restrictions-Cracker-Linux

This program is designed to crack iOS 7-11 restrictions passcodes as quickly as possible. It can use an unlimited number of threads to complete this process.

Install

apt package coming soon

Compile from source

Make sure that gcc (4.7 or newer), make, openssl and openssl-dev are installed on the machine (Linux only, macOS see Docker. This will be fixed in future builds)

sudo apt install gcc make openssl libssl-dev

To compile run make

Usage

To crack, simply enter

restrictions-crack <hash> <salt>

Ex (will yield a code of 3956):

./restrictions-crack "J94ZcXHm1J/F9Vye8GwNh1HNclA=" "/RHN4A=="

Usage with Docker

  1. Install Docker from docker.com
  2. Clone this repository
  3. cd into the repository
  4. Run docker build -t restrictions .
  5. Run docker run -e hash=HASH -e salt=SALT restrictions replacing HASH and SALT with your input

Alternatively, to run the program using the hash and salt listed above in the Usage section (will yield a code of 3956):
docker run -e hash="J94ZcXHm1J/F9Vye8GwNh1HNclA=" -e salt="/RHN4A==" restrictions

To Find Your Restrictions Hash and Salt

  1. Create a non encrypted iPhone backup in iTunes
  2. On macOS navigate to ~/Library/Application Support/MobileSync/Backup/YOUR_DEVICE_UDID or on Windows %AppData%\Apple Computer\MobileSync\Backup\YOUR_DEVICE_UDID.
  3. Search the folder for a file called 398bc9c2aeeab4cb0c12ada0f52eea12cf14f40b
  4. Open the folder in a text editor. In the file you will find a section that looks like:
 <dict>
      <key>RestrictionsPasswordKey</key>
      <data>
      M/p4734c8/SOXZnGgZot+BciAW0=
      </data>
      <key>RestrictionsPasswordSalt</key>
      <data>
      aSbUXg==
      </data>
 </dict>

In this example, the hash would be M/p4734c8/SOXZnGgZot+BciAW0= and the salt aSbUXg==

  1. Plug the retrieved values into the program

Performance

Code CPU This Program Javascript Website
0001 Intel Core i7 7700k 00:00:00.00   00:00:01.13
1024 Intel Core i7 7700k 00:00:00.35   00:02:15.96
3956 Intel Core i7 7700k 00:00:00.06   00:07:26.92

The website compared against: https://ios7hash.derson.us (Nothing against the site, javascript is just very slow). The website is single threaded and as such, the higher the code, the longer it takes to find. As a result, for small codes (under 50), the speed difference is negligible, but for larger codes, especially approaching the upper limit of the keyspace, the difference is multiple orders of magnitude faster.

Todo

  • Clean up memory when it is no longer needed
  • Add apt package
  • Add error checking and input validation
  • Create threads more quickly to improve performance (multi-thread thread creation?)
  • Add timer to program to measure performance
  • End all threads immediately
  • Improve algorithm efficiency
  • Improve code documentation and commenting
  • Remove debug flags from production build files
  • Add -O3 flag to gcc for production builds to speed up execution
  • Add make install action
  • Add configure script
  • Add automake support
  • Add better support for macOS (OpenSSL libraries not preinstalled, use Apple's Crypto library)
  • Add support on macOS to auto extract data from iOS backups
  • Add the ability to read codes in from a file
  • Add a Improve the premade list of codes for benchmarking purposes
  • Add unit tests
  • Compile a list of benchmarks on various systems

About

A multithreaded, fast approach to cracking iOS Restrictions passcodes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages