One of the most important things in android application penetration testing is “Capturing Android application’s HTTPS traffic”. Reading HTTP traffic generated by android apps is some what easier than reading HTTPS traffic. Recently some peoples asked me about “how to get Facebook for Android access token”. It can be done by intercepting SSL / HTTPS traffic from Facebook application. So here it goes the easy way to intercept, read and modify ssl network traffic generated by android applications.
Things we need :
1) Android mobile phone.
2) WiFi Internet Connection.
3) Laptop or Desktop with Charles proxy installed.
Note : Desktop/Laptop should be connected to the same network connection where your mobile is connected. i.e. same WiFi connection.
Step 1 : Install intercepting proxy software (Charles proxy in our case)
Step 2 : Setup WiFi proxy in your android mobile
In your android mobile, go to Settings > Wi-Fi, long press the active network connection. Select “Modify network” > Tick “Advanced options”. Change none to manual under proxy drop down menu. Enter your computer’s local ip address (i.e. 192.168.1.100) in host, 8888 in port. And also note down the local ip address of your mobile shown at the top of the Modify network menu. Please note that some older versions of android do not support WiFi proxy feature.
Step 3 : Install SSL certificate in android trusted credentials
Before installing ssl certificate, we need to add our android mobile’s local network ip in charles proxy access control list. Proxy – > Access Control Settings in charles proxy. Add the local ip we got from step 2 to the access control list. Download charles proxy ssl certificate zip here. Extract the certificate and copy it to your mobile’s SD storage. In your mobile, Settings > Security > Install (certificates) from Memory / SD Card and then select the certificate file.
Step 4 : Intercept SSL / HTTPS traffic
Read Facebook account hacking and their prevention measures
I hope this post would be useful. Please let me know if you have any doubts.