Git Product home page Git Product logo

apple-gsa-protocol's Introduction

Apple GSA Protocol

This repository includes a simple script for authenticating with Apple's GrandSlam Authentication protocol. Although there is a little documentation on this process online, I could not find any resources on how to set up some of the parameters for GSA authentication, which is why I decided to make this repository.

What is GrandSlam Authentication (GSA) ?

GSA is based on the SRP-6a authentication protocol which can verify a user has the correct password to an account without actually transmitting it. GSA is utilized in many of Apple's applications for authentication. Some apps that use GSA endpoints include iCloud and the App Store.

The endpoint for GSA is https://gsa.apple.com/grandslam/GsService2

Analyzing traffic

All of Apple's applications utilize SSL pinning which means you must take a couple of extra steps in order to read some of the traffic yourself.

macOS: The first step in obtaining the web traffic would be to intercept the SSL pinning functions with a tool such as Frida to effectively render pinning useless, but in order to do so you must disable System Integrity Protection (SIP), otherwise, Frida cannot hook to the process properly and will throw an error.

iOS: Using a jailbroken device, you may use Frida or SSL Kill Switch 2 to bypass the SSL pinning.

Important Note: Regardless of what application or process you want to analyze, if you're after GSA traffic, you need to hook into Auth Kit Daemon (AKD). This process is entirely responsible for all GSA protocols. The process will be titled akd. If you're going to use SSL Kill Switch 2 on iOS, then akd is launched before it can be hooked, which means that you'll need to execute a kill -9 command to kill akd and have it restart so that SSL Kill Switch 2 can properly hook it next time.

Python Script

The python script in this repository can successfully execute one of the first steps towards proper authentication via the GSA protocol (getting s, B to make the M1 parameter as well as getting the c parameter), but it may not provide much help in getting past any further for reasons explained below. Nevertheless, the first step can be considered complete and this provides a nice overview of how some parameters such as the a2k are generated.

Note: If you're going to utilize this Python script, please be sure to modify some of the other parameters under cpd, also known as the Anisette data. This includes X-Mme-Device-Id (Device UDID) and X-Apple-I-SRL-NO (Device Serial Number) to name a few.

Limitations

I have not been successful in terms of getting an M2 token when trying to recreate the second GSA request. According to some online sources, the X-Apple-I-MD parameter is time-sensitive and lasts only about 30 seconds. The first step in getting a full implementation would be to figure out how this is generated.

Because it is difficult to analyze Apple's binaries to get this information, some people have resorted to hooking into Apple's AFD binaries to call the function that generates the X-Apple-I-MD token and extracting it for utilization. In a future update, I will likely incorporate support for this.

Contributions

Contributions in the form of issues or pull requests are always welcome. It may take a community-led effort to get the whole process completed.

apple-gsa-protocol's People

Contributors

mathewyaldo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apple-gsa-protocol's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.