There are a number of excellent tools that exist when it comes to testing mobile web applications. Unfortunately many of them cost a significant amount of mulah. There are a few though that currently are free to use and we are going to take a deep dive into getting you your first Mobile Security Framework report from the Mobile Web App that you are testing today.
Before testing Mobile Web Applications please be sure that your organization has the required documentation and written consent from the organization in order for you to do so. Typically this will be included in a SOW (Statement of Work) and ROE (Rules of Engagement)
MobSF Install and Use:
Now that we have the .APK and have it in our Kali box, lets get our Mobile Security Framework up and running.
I would be doing you a disservice if I tried to go step by step on the setup and did not tell you that MobSF and
Feel free to visit their page or continue on and follow the next few steps.
**For Windows or Mac please see MobSF documentation at this link **
The reason I use Kali in a Virtual Environment is so I can suspend it, have a dedicated MobSF VM, and it saves my MobSF reports in the ‘recent MobSF reports’ so I can actively switch back and forth to it and analyze source code.
For Kali Linux follow along here and run this syntax:
Pull up your terminal/command line in Kali Linux and run:
git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git cd Mobile-Security-Framework-MobSF
clone the file, then switch your directory as shown above.
sudo apt install build-essential libssl-dev libffi-dev python-dev pip install -r requirements.txt --user
Then install these libraries which are essential to getting up and running, along with installing the requirements and dependencies.
Now in every pentest I have been apart of, there is always a pentester who claims to have done the work but has NO report to back it up…..Don’t be that GUY/GAL!
Run this command
apt-get install wkhtmltopdf
This will give you the option at the end of uploading your .APK file to download the pdf and have a report to show that the analysis has at least been run, an artifact exists, and that it can be referenced back to.
After this, we are ready to start the MobSF Server.
In your terminal run
python manage.py runserver
Now you have your server running, but wait there is nowhere to insert my APK file!?
Thats because MobSF is AWESOME!
Pull up your browser and go to http://localhost:8000/
You will now see the Web Interface that is click and drag ready for that .APK file that you have already downloaded from your Google Drive/Dropbox Account
Throw it in, and you will see the server in the background have fun analyzing this .APK while you sit back and relax.
Be sure you are aware of the OWASP Mobile Security Checklist this is essential to making sure you cover your bases as a pentester. You are not required to know everything, but you are required to have to know how and where to find EVERYTHING.
So hop to it, get analyzing you have your report, at the bottom left side you can see download report as a pdf, but please use the web interface, it allows you to download the Java code for the application and really get your hands dirty along with be more user friendly than the PDF report (which you should still keep as an artifact).
Here is the certificate for the Application which you are able to make sure it is up to industry standards.
Also make sure the permissions for your application Make Sense! Go through these while testing the functionality of the application and make sure that the user is asked for the appropriate permissions and they are not assumed (many a lawsuit has happened by the creator of mobile applications assuming that data can be taken and/or shared).
As you can see in the Manifest Analysis MobSF rates many items as high severity. There is a fine line between Customer Experience and Security which is why you see what you see, read the description and use your God given critical thinking skills to analyze them, do not just throw this report at your Project Manager or client and say fix these things! If you find something out of the ordinary, or seriously think you have a few items that may lead to vulnerabilities, do some research, or crazier yet ASK someone!
MobSF allows you to download the Android manifest, the java code, and the smali code. Unfortunately this tool does generate false positives. Verify the issues described by Mobile Security Framework by downloading the code and analyzing it. Do your due diligence. Prove vulnerabilities exist.
Have fun, learn lots.
~Cyber Incision out