This repository contains scripts and utilities used in collecting data for the paper, "Traffic Analysis of Encrypted Messaging Services: Apple iMessage and Beyond." Included are utilities for automatically generating iMessage network traffic for various user behaviors both from an OSX (now, MacOS) computer and iPhone.
Note that these utilities were written and used circa 2014, and it is unlikely that they can be directly applied to the latest versions of iOS or MacOS without heavy modifications. Also, note that generation of user behaviors on the iPhone requires a Jailbroken phone with VNC and SSH access. There are also several dependencies, which are explained below.
No support will be provided for these utilities, but hopefully they will provide a starting point for anyone who wants to generate user behavior data on iOS or MacOS devices.
If you use any of these utilities, please consider citing the original paper:
- S. Coull and K. Dyer. Traffic Analysis of Encrypted Messaging Services: Apple iMessage and Beyond. ACM SIGCOMM Computer Communications Review, 44(4), October, 2014.
The following README includes information on how each of the iOS data collection scripts operates. Packet capture data is simultaneously collected from the local wireless interface and all iPhone interfaces using the rvi0 interface created by the rvictl utility.
Dependencies:
- Cliclick -- mouse click utility for Mac OSX
- VNC client -- remote access to iPhone GUI from Mac OSX
- Jailbroken iPhone -- install of unauthorized apps
- VNC server on iPhone -- remote access to Messages GUI on phone
- SSH access to iPhone -- remote access to BiteSMS
- BiteSMS on iPhone -- command line driven iMessages
- Pastebote on iPhone & Mac OSX -- shares Mac clipboard with phone
- Python 2.6+ -- drives data collection and calls other scripts
- tcpdump -- collects packets for each iMessage event
- rvictl -- creates virtual interface to collect to iPhone packets
Start/stop data collection records the messages sent by iMessage when a user starts or stops typing in the Messages app. This collection is driven through remote VNC access to the Messages GUI.
Workflow:
- Determine x,y coordinates of Messages text box using Cliclick
- Set focus to VNC client and click in Messages text box with Cliclick
- Begin collecting "start" message data using tcpdump
- Use AppleScript to type random message into text box using VNC
- Stop "start" message collection
- Start "stop" message collection
- Use AppleScript to type backspaces and erase all text using VNC
- Stop "stop" message collection
This collects packet trace data associated with the event that a user, with read recipients enabled, has looked at a message.
Workflow: 0. Ensure read recipients are enabled on recipient device
- Determine x,y coordinates of button to return to main Messages index
- Determine x,y coordinates of Messages index used for collection
- Send random text to recipient using SSH and BiteSMS
- Start tcpdump collection
- Use Cliclick to view Messages index from sender
- Stop tcpdump collection
Collects data on the sending and receiving of standard text messages containing random text strings of exponentially increasing length (8, 16, 32, 64, 128). Languages proceed in a similar way except instead of creating random strings, the strings are taken from the corpus index in the respective data folders.
Workflow:
- Start tcpdump collection
- Send random text of specified size using SSH and BiteSMS
- Stop tcpdump collection
Capture all data streams surrounding the event where a user sends an attachment through iMessage. These include APNS, TLS (to Apple/MS) on the sender side and APNS, HTTP (to MS), TLS (to Apple) on the receiver. Images are sent a canonical attachments of exponentially increasing dimensions (16 x 16, 32 x 32, 64 x 64).
Workflow:
- Determine x,y coordinates of Messages text box, paste bubble, and send
- Generate random PNG image of specified dimensions save to "temp.png"
- Use AppleScript to copy "temp.png" to clipboard
- Pastebot should automatically transfer the image to iPhone's clipboard
- Use VNC and Cliclick to paste image. Wait until after "start" message
- Start tcpdump collection
- Use VNC and Cliclick to press send button
- Stop tcpdump collection after image has fully transferred