Security Vulnerability in third party IRCTC android applications in Google Play

About security vulnerability in third party IRCTC Android apps on Google Play

Update : If you have come here to download my IRCTC Android application, I am sorry I’ve removed it from google play as there are many IRCTC applications in Google play but with serious security risk.

I had developed an Android application for my personal use to book IRCTC (Indian Railway Catering and Tourism Corporation) railway tickets. I found it useful, So I released it on Google Play for the benefit of the others. Since then there has been an influx of numerous IRCTC apps on the Google play with added features like storing username/password, credit/debit card details, automatic login and session management. Though these features are undoubtedly useful, they pose a serious security risk which could lead to loosing your IRCTC login credentials to loosing your Credit/Debit card credentials thereby loosing your hard earned savings altogether to some malicious hacker/developer !

The reasons below states why it is not advisable to store user credentials on webview applications which make use of third party websites. Webview is the mecahnism by which android applications can make use of websites to provide a mobile application and it is the widely used method for number of IRCTC applications found on Google Play. You can check out the IRCTC applications from Google Play from the link below,

For this demo I am choosing IRCTC Pro app Shahul3D, it is the most well built IRCTC app  from the Google Play but is prone to following vulnerability in rooted Android devices,


As you can see from the images above (if not click the image to enlarge), the application takes in user credentials like username, passwords to credit/debit card details even with the pin !! and what does it do with it ?

Stores it in a plain xml format in the android preferences
Google implemented the preferences as a simple database mechanism to store in user preferences in an application like dates,settings and it was never meant to store credit card details like the above application. unfortunately many developers still use preferences to store in sensitive information which in turn gets saved as an un-encrypted plain xml.
How to retrieve user data stored from android application stored in preferences,
Above screen capture of my terminal shows the basic set of commands I used to navigate into an rooted android file system to access the sensitive information stored in the above android application.
I made a video of the same for your understanding !
Any newbie could code an android application to parse the above xml data and take it to his home server. Even better he could target users of an particular application like the one shown above using similar package signatures and steal the user data.
Update : As few few visitors like Ajay (see comment section below) doesn’t like me being subtle about the scope of the vulnerability mentioned above, I would like to clarify it further.
1. shared_preferences by design cannot be accessed by another app in a non-rooted Android device,
Unless !
The developer has put in a android:sharedUserId with the hope of sharing is own preferences with his future apps. You can create same application context used in the target app using the UserId and access the shared_preferences.
And you know how to access the UserId, right ? See my Ultimate Android Decompilation Guide.
2. In rooted android devices, you can just build an app which would parse through the .xml in the /data and display the shared_preferences of other app or just mail it to your server !
So for the developers it is foolish to store sensitive data in preferences, unless if you want to steal the user data some how ! and for the users it is foolish to install any app you see on the Google Play without looking through it . Think well, when you see an app asking for your user credentials and take some time to contact the developer to know how your data is being stored and for what it is used for.
There are other risks involved in web view applications using third party websites by exploiting the javascript exploits, I will keep it for the next session. Take care.
Thanks to AndrewChamp for the great Evil Android picture !

Continue reading “Security Vulnerability in third party IRCTC android applications in Google Play”

How to hijack a Facebook account and the need to use the secure feature – Part one (wired networks)

How to hijack a Facebook account and the need to use the secure feature – (wired networks)


Update : Facebook has enabled (secure browsing) https for everyone, so this attack is now not applicable. But still the procedure here applied to any website which has non secure login system.

This is a demonstration of  Session/Account hijacking vulnerability in Facebook if you do not use a secure connection over Facebook.

The part one of the series uses a wired network scenario for the demo.

Complete self explanatory video :


Attacks Employed :
1. Man in the middle attack/ ARP poisoning
2. Session Hijacking

Tools Used :

1.  Cain
2.  Wireshark
3.  Cookie editor (firefox Add on)

In this demo, I used a local wired network scenario. I used a Windows xp Virtual machine in my snow leopard machine to hijack  Facebook session of a Windows7 machine. I used windows since this demo can be reproduced easily in any realtime scenario. But this demo can be  tested on any Operating System.

How to :

1. Open Cain, Configure- set your Network card.
2. Use Mac Address Scanner to scan your local network  by specifying the range.
3. Identify your target PC, from the results.
4. Open a new ARP poisoning routing, set your ip and target ip.
5. Open Wireshark and filter http.
6. Wait for your target to open Facebook.
7. Check the Cain for poisoning status, Half-routing changes to Full-routing when the target uses the
8. Open  Facebook with firefox in your PC, use Cookie editor to note down the Cookie names
associated with Facebook.
9. Monitor the Wireshark for Facebook connection from the Target PC for
HTTP [Retransmission] GET /x/
10.  Copy the value of Cookies from the HTTP [GET].
11.  Open your firefox, delete the cookies of
12. Add the cookies and their values from the Wireshark you copied before.
13. After you have finished adding the cookies, save & close the Cookie editor.
14. Refresh your browser.
15. Congratulations. You have hijacked the Facebook account from your Target PC.

[display_adsense ad_type=”300×250″]

How to prevent this vulnerability :

1. As of this writing, Facebook has brought in secure layer (SSL) for connection. But it is still not full fledged (or) is left for user’s preference.
So enable the secure browsing under Security in Account Settings.

2. Better use HTTPS Everywhere browser plugin to force the use secure HTTPS connection for all the websites (if they provide one).

Conclusion :

HTTPS connection should be made mandatory for such high profile websites. My next demo would show session Hijacking through wifi networks.

This demo is purely meant for educational purpose and to insist the secure way of browsing.
indiandragon does not take any responsibility for any harmful actions carried over by using this demo.