A 2 minute read written by
Social media applications spy on you, and probably send home some data about you every second you use the app. But what about the applications that have another business model? Do you trust that your bus pass app, developed by your the municipality, or your smart vacuum cleaner is not sending your data back to the developers? Often, we have no idea, and until recently iOS-users had no good way of inspecting the traffic that was sent from their devices.
The problem with owning an iOS-devices is that the information going between the device and a server has been difficult to inspect. Prior to me discovering Charles, I had no good ways of checking what and how often data was transmitted from an app. Previous rigs for inspecting the traffic included doing MiTM-attacks from my router, and still then it was hard to inspect HTTPS traffic. Just watch how tedious this guide from Fiddler is. Another option for inspecting the traffic was to jailbreak the device. From a security standpoint you should not jailbreak or root your device, as SANS and NorSIS states. While jailbreaking the phone exposes you to a new world of cool applications and tweaks, the security problems that follow are not worth it in my opinion. Most Norwegian banks and public services will not allow the use of their apps if they detect you are using a jailbroken device, so you will in most cases lose functionality by jailbreaking.
There is a better way!
Charles should be a familiar name when we talk about packet analyzers and proxy tools for debugging. What you might not know is that Charles also has a client for iOS. Proxyman as well as some smaller apps like Stream and Thor HTTP Sniffer have also been allowed in on the AppStore.
How to get started spying on your applications.
- Force close the app you want to spy on.
- First time you open the Charles Proxy App, you will be prompted for permission to install VPN Configurations, press “allow”.
- The app will start the proxy and should show that it is active.
- Tap the gear icon in the top left. Then tap “SSL Proxying”.
- At the bottom of the screen you will find instruction for installing and trusting the Charles Proxy CA Certificate. Follow the instructions, install the Certificate and make sure that the Certificate Status shows “Trusted” when you come back in the Charles Proxy app.
- Now toggle the “Enabled” switch in the SSL Proxying screen to "On" and go back (close the settings menu) to the main screen of the app.
- Open the app you want to spy on, and let it load completely.
- Switch back to the Charles Proxy app and tap on the Current Session.
- You should see a lot of requests, pick the endpoint you want to inspect, and tap on it.
- Tap “Enable SSL Proxying”.
- Go back to the main screen of Charles and clear the Current Session by swiping to the left and tap “Clear”.
- Force close the app you are spying on and open it again. Let it fully load.
- Go back to Charles Proxy and tap on the new Current Session.
- Look for the endpoint from step 9, and tap it.
- You can now see the request and response body for all paths.
Some considerations when using this.
- Many applications use multiple endpoints, and send your data all over the place, so finding the correct endpoint may be tricky.
- You will find endpoints and access-tokens for many applications where developers thought that information was private because it is obfuscated/hidden. Use it with care, as some restrictions may apply. Some companies state that you need explicit consent for using their API’s even though they provide no security.