Last night, I tried to figure out how the iTunes App Store (as accessed from the iPod Touch) worked.
I was able to simulate the app store experience, and here are the few notes I took on the matter.
All replies from the App Store are gzip-compressed.
If any of these steps fails, the connection is terminated.
- The device queries phobos.apple.com for a “bag” (ix=2), which contains a signature and a signing key.
- The device sends a non-binary plist (XML property list) of its current applications to a WebObject called “availableSoftwareUpgrades”
- The app store replies with a list of all the information for those applications. It is up to the iPod itself to determine whether/not there are upgrades.
- Periodically, the device makes a request to metrics.apple.com (which replies 100 Continue instead of 200 OK), which I believe is for stats tracking.
- The device reads software categories and loads icons (WebObject viewFeaturedSoftwareCategories)
- The device loads the contents of a category (WebObject viewGenre)
- The device loads an application’s information descriptor (WebObject viewSoftware). This for some reason contains the text to be used in the price display, as well as the “INSTALL” or “BUY NOW” text.
- The device initiated a secure connection to download an application. This is where I had to stop my research, as I couldn’t track this.
- curl (Commandline URL Fetcher)
- Wireshark (packet capturer/analyzer)
- Apache (Web Server, used here to serve fake App Ptore pages)
- A single firewall rule on my router to redirect all traffic coming from the iPod back to my computer (iptables -t nat -A PREROUTING -s ipod -p tcp -j DNAT –to 192.168.254.1. Note: I couldn’t redirect to a computer inside the router’s network, so I had to hook up via WiFi to the router AND via Ethernet to the modem)
Not much useful information into the app loading process was gleaned from this, unfortunately, though I did manage to snap some “neat” screenshots of my meddling.
Applications are signed, though, so even if this was an exploitable vector, the device would need to be jailbroken first, thus making this useless.