Quick Shortcut Maker APK analysis using MobSF
Outline: [Article Title]
Keyword: [Enter Targeted Keyword]
Keyword MSV: [Enter Targeted Keyword’s Monthly Search Volume]
Author: [Enter Author Name]
Due Date: [Enter Due Date]
Publish Date: [Enter Desired Publish Date]
User Persona: [Enter Targeted Reader and/or User Persona]
QuickShortcutMaker apk analysis using MobSF
Smart phones and mobile technology has been more powerful as well as prominent in every sphere of society over the previous decade. Cell phones and tablets are widely used to access the web, run apps, receive email, post to social media, make financial and banking activities, and so on. The use of mobile devices for both personal and corporate purposes has increased dramatically. Mobility and flexibility have been greatly facilitated by the introduction of mobile devices and the proliferation of mobile applications. As a result, questions have been expressed regarding maintaining security when navigating across the digital world.
According to the survey, there are around 6.378 billion mobile phone users worldwide, which is equivalent to 95 percent of the global population. Mobile device security is becoming increasingly important as a source of concern for users’ privacy. Regardless of the fact that mobile device companies are concerned about a user’s security and data privacy, the use of internet-based applications poses significant challenges in terms of resolving threats and vulnerabilities while maintaining a user’s confidentiality. The majority of software programs are designed to do a specific task and are optimized for a specific set of devices, such as smartphones and tablets. Due to many risks and weaknesses, protecting data on mobile devices is a risky endeavor.
Issues Faced with Mobile Device Security.
The mobile phones market is growing as wireless technology advances and mobile device usage improves. The growth in the development and maintenance of secure identities for mobile devices has created a huge challenge for individuals, society, and businesses, particularly in mobile added value services such as mobile banking, mobile ticketing and various other services. The following are a few of the most notable difficulties with mobile devices as a result of threats and vulnerabilities.
Sensitive Data & Information leaks:
When sensitive data & information such as password credentials, secret keys, access tokens, sensitive business logic, are defined / hardcoded into the application code, it opens the door for an attacker to discover this information by reverse engineering it. Once such information is in the hands of an attacker, the situation might become very chaotic.
Unguarded data storage:
General non-encryption, caching of information which are not intended for long-term storage and a lack of platform best practices can lead to the exposing of sensitive information.
Weak Authentication :
When it comes to security, weak authorization and authentication techniques that depend on device-identifiers such as the International Mobile Equipment Identity (IMEI) and universally unique identifier (UUID) values are a perfect recipe for disaster.
Server-Side control:
In the backend side, failure to apply effective security measures like patches / updates & secure configs can result into massive data breach.
Brute force:
There are several mobile applications today that use password-based authentication as a single-factor authentication. Because of this, the proprietors of these programs don’t enforce strong passwords or the protection of valuable credentials. User’s credentials can be stolen, and automated brute force assaults can be launched against them.
Improper Session handling:
Session handling has been flagged as a security problem for web applications on mobile devices. When using internet apps on any platform, such as mobile devices or PCs, improper session handling creates risks. When executing financial transactions, sessions with long expiry durations create vulnerabilities. Session hijacking on mobile devices can be traced back to poor session management.
Lack of Transport Layer Protection:
In mobile applications, it is common to see no encryption for sent data. However, disregarding certificate validation issues or reverting to plain text communication after failures can put security in peril and have significant consequences such as data tampering and can encourage man-in-the-middle attacks if they are not addressed immediately.
Client-Side Injection:
On mobile devices, malicious applications are executed via application or web browsing client-side injection. Client-side injection can take the form of HTML injection or SQL injection . It’s possible for hackers to launch a text-based assault and take advantage of a targeted users. By using this method hackers can inject any data source, including resource-targeted files or software, into the system.
Mobile Threats and Vulnerabilities:
Mobile devices are increasingly being targeted by cyber criminals. Many popular application and programs for mobile devices are available on the internet, making them a prime target for attackers looking to disrupt security systems, create hazards, and spread vulnerabilities. The capacity of a hacker and the security of a firm are becoming increasingly disparate. Mobile device security solutions and regulations must be made more flexible and tightly regulated to resist this kind of trend.
Threats and assaults that were previously successful on desktop computers are now being tested on mobile devices. As the level of defense rises, so does the quantity of simple targets. Hackers and attackers are focusing on the weakest link in the chain, resulting in a slew of successful frauds.
- Physical Threats:
- Application-based Threats:
- Network based Threats:
- Web based Threats:
Understanding the depth of mobile security.
It’s difficult to be secure these days, and our dependency on mobile technology makes it even more difficult. Our mobile phones store personal social network accounts, emails, important texts, and even bank account information. We keep these data on file despite the fact that they are frequently sensitive and may include useful information. Furthermore, the majority of business-to-business transactions are conducted through cellphones. The majority of people also use social media on their cellphones. As a result, a company without a smartphone or mobile app is ineffective. It’s no secret that mobile technology is advancing at a breakneck pace. The internet is used by millions and billions of people, with many of them relying significantly on their cellphones.
Getting started with MobSF.
MobSF is an open-source project that is actively being developed. So, the documentation is subject to change. Therefore, be sure to always use the most up-to-date
documentation from MobSF’s official documentation page. There are several methods of Installing and running MobSF:
First Method of installing MobSF:
The first method of installing MobSF is to manually install all of the prerequisite requirements and then run the setup script for your Host Operating System.
Prerequisites requirements
For Mac users
- Install Git
- Install Python 3.8-3.9
- After installing Python 3.8+, go to
/Applications/Python 3.8/
and runUpdate Shell Profile.command
first and thenInstall Certificates.command
- Install JDK 8+
- Install command line tools
xcode-select --install
- Download & Install wkhtmltopdf
- Windows App Static analysis requires a Windows Host or Windows VM for Mac and Linux. More Info
For Ubuntu/Debian based Linux users:
- Install Git
sudo apt-get install git
- Install Python 3.8-3.9
sudo apt-get install python3.8
- Install JDK 8+
sudo apt-get install openjdk-8-jdk
- Install the following dependencies
sudo apt install python3-dev python3-venv python3-pip build-essential libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev wkhtmltopdf
- Windows App Static analysis requires a Windows Host or Windows VM for Mac and Linux. More info
For Windows users
- Install Git
- Install Python 3.8-3.9
- Install JDK 8+
- Install Microsoft Visual C++ Build Tools
- Install OpenSSL (non-light)
- Download & Install wkhtmltopdf .
- Add the folder that contains
wkhtmltopdf
binary to environment variable PATH.
NOTE: Set
JAVA_HOME
environment variable. iOS IPA Analysis works only on Mac, Linux and Docker containers.
So, once all of the prerequisites have been installed, you can proceed to the installation stage
.
_ Second method of installing MobSF _:
You can always use prebuilt MobSF docker images if you solely need to do static analysis
and don’t want to do dynamic analysis
. Copy and paste the following commands into the command line
to pull and deploy prebuilt MobSF docker images:
Note: Ensure that Docker is running on your computer.
docker pull opensecurity/mobile-security-framework-mobsf
docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
_ Third method of running MobSF _:
You can use the cloud version of MobSF instead of installing it on your computer if you don’t want to install MobSF on your PC. To do so, go to Mobsf.live.
Static Analysis using MobSF
MobSF Installation
What is a static analysis?
Static analysis is also often known as static code analysis, it is the practice of looking for faults in a computer program without running it. Static analysis is most typically performed on a program’s source code using tools that convert the code to an abstract syntax tree (AST) in order to completely evaluate the code’s structure and, as a result, find flaws in it. An Abstract Syntax Tree (AST) is a tree representation of a computer program’s source code that shows the source code’s structure.
Let’s get started and run MobSF static analysis.
- First, make sure your host
PC
has all of the necessary requirements loaded and then proceed to clone the entire repository in a specific folder on your computer.
Note: In this tutorial, we will use ‘Windows’ as the host operating system and FreeOTP apk ‘Android’ apk binaries for static/dynamic analysis.
- Installing all the packages/dependencies.
For Linux / mac:
./setup.sh
For Windows:
./setup.bat
- Execute the ‘
Run
’ command now.
For Linux & mac:
./run.sh
For Windows:
./run.bat
MobSF can now be accessed directly from the browser. To begin the static analysis process, simply drag and drop or select the apk file you want to study.
Features of MobSF static analysis
Information Section:
The app’s various scores, such as the average CVSS, security score, and number of recognized trackers, are displayed in this section at the top. The file’s name, size, and basic hashes are displayed in the File information section, which is positioned next to the App score. The App Information part, which appears next to the File Information section, offers numerous characteristics about the app, such as the package name, main activity, and current version of the application.
APP scores
The app’s various scores are displayed in this section, including the average CVSS, security score, and number of trackers recognized.
MobSF scorecard
This section contains a detailed visual representation of the scores for various findings.
The security score is determined by the severity, whereas the average CVSS score is determined by calculating the average CVSS score.
Each and every analyzed app receives a perfect 100 score. For each finding with a high severity, MobSF deducts 15 points from the score. MobSF deducts ten points for each finding with a severity warning and adds five points for each find with a good severity. As long as the calculated score is greater than 100, the app security score is considered 100. If the estimated value is less than zero, the app security score is set to 10.
File information
The File information section, which is located next to the App score, displays the file’s name, size, and basic hashes.
App Information
The App Information section, located next to the File Information section, contains information about the app’s package name, main activity, and current version.
Playstore description
This section simply lists the app’s description as it appears on the ‘Google Play Store
’
Component section
The various fundamental components used in Android apps are listed in this section, including Activities
which is simply, a single screen in your app with a user-interactive interface, Services
is a background-running part of the app, Receivers
allows users to register for system or application events, and Providers
provides its own UI for working with the data.
Scan Option
There are severqal options available in this section include ‘Rescan
’ and ‘dynamic analysis
’ It also has a decompiled code section, which displays decompiled versions of android manifest files
, java source code
, andsmali source code
, as well as the ability to download the java source code
,smali code
, and even the ‘apk' file itself
.
Signer Certificate
The Signer Certificate section contains fundamental information about a code signing certificate, such as the signature version, hash algorithms used, fingerprints, and issuer identifications. If anything, good or bad, is discovered, it will be listed in the certificate status box with a brief description.
Application permission
All of the permissions used by the application (Open camera apk
) are listed in the Permissions section, along with their status
, information
, and descriptions
.
Android API
Android API section provides the information about all the api which is being used inside this particular application.
Browsable activities
This Browsable activities
section will simply lists out all the browsable activities, such as all the activities which can be browsed by a particular scheme.
Security Analysis:
The security analysis section includes manifest, code, binary, NIAP, and file analysis.
Network Security
Manifest Analysis
MobSF runs a static analysis on Android Manifest files to find any vulnerabilities. It then lists all of the issues/concerns, as well as their severity and a full description, inside this section.
Code analysis
MobSF performs static analysis on all decompiled java source code and then provides a report that includes all issues encountered, as well as their severity, standard, and file location, which is displayed in this section.
Binary Analysis
MobSF lists out all of the issues that have been detected on the shared objects and displays it inside this particular section.
NIAP Analysis
The Department of Defense and other government agencies must ensure that their mobile apps meet the National Information Assurance Partnership’s security guidelines (NIAP). The National Intelligence Assessment Program (NIAP) certifies commercial hardware and software used in national security systems. So this section will showcase all of the NIAP results, including their Identifier
, requirement
, characteristics
, and brief explanations
.
File analysis
Currently it is absolutely blank but inside this section MobSF lists out all of the sensitive files, such as certificates, that are hard coded within the application.
Malware analysis
APKiD analysis
This section provides a solid understanding/picture of the application’s behavior from a code perspective.
Server location
This is MobSF’s best feature because it includes a beautiful World Map UI that displays the evaluated app’s entire server location in great detail.
Quark analysis
Domain malware check
MobSF extracts domains from binaries and compares them to non-malicious domains in its database. As a result, based on this information, it determines whether a domain is good or harmful.
Reconnaissance
URLs
All of the URLs found in the various source code files for that application will be listed and displayed in this area by MobSf.
Firebase DB
MobSF is capable of extracting all of the Firebase database URLs from the app, as well as doing a secondary check to determine if the database is publicly accessible.
Emails
All of the emails contained in the source code can be extracted by MobSF and displays it inside this particular section.
Trackers
MobSF is capable of extracting out all the possible trackers that are currently being used inside the application and display it inside this particular section.
Trackers are simply a development toolkits or add-ons that collect data and information on the application’s behalf.
Strings
MobSF lists out all the hard coded strings in the binary, especially the ones from the strings resource.
Possible hardcoded secrets
Components
Components refer to the different sections of the application. This section includes a list of all the activities
, services
, receivers
, providers
, and libraries
that this application employs. It also contains all files found in the application’s binaries.
Activities
Activities are simply a single screen in your app with an interface that the user can interact with.
Services
Services are part of application which runs in the background.
Receviers
Receviers allows users to register for system or in any kind of application events.
Providers
Providers each have their own UI for working with data.
PDF report
The PDF report section enables you to create a professional-looking PDF report containing high-level information about the various findings of the analyzed application.
Visit this link to see the full report on the Quick Shortcut Maker apk application.
What is Dynamic analysis ?
The process of testing and analyzing a program while it is running is known as dynamic analysis
. It, also known as dynamic code scanning, aids in the detection and correction of errors, memory problems, and other program execution issues. Static analysis is required before moving on to dynamic analysis.
Dynamic analysis mechanism
Before instrumenting the genymotion vm, MobSf will install the apk. For instrumentation, Xposed and Frida are used; Frida is used for Android 5.0 and up, and Xposed is used for Android 5.0 and below. There are also some agents installed in the genymotion VM. Once the app has been instrumented, the agents will begin capturing and gathering data relevant to it. After the report is completed, the collected data will be emailed back to MobSF, and the app’s full data will be dumped into the device for further investigation.
Always make sure you’ve configured the dynamic analyzer for MobSF before starting the analysis. You must start a genymotion VM before launching MobSF to perform android dynamic analysis flawlessly.
This error will be thrown if mobsf fails to detect the vurtual machine.
You must start a genymotion VM before launching MobSF to perform android dynamic analysis without any issues.
Starting Dynamic analysis
Open the ‘scan options
’ menu and select ‘Start Dynamic Analysis
. You should be able to see the dashboard
if everything went well.
MobSF Dynamic analysis features and functionality:
Show/Stop Screen:
This feature allows you to display the screen of the emulated device on the web interface. Some basic functions, such as touches and clicks, can be performed directly from the web interface itself.
Remove Root Certificate(CA):
This feature is responsible for intercepting the traffic of the device.
TLS/ SSL test:
The TLS/SSL
Security test allows you to evaluate your application’s network security. These tests are only applicable to applications that use the HTTP protocol to connect to the internet.
Exported Activity Tester:
This test allows you to dynamically test for exported actions, which is important for developing dynamic proof of concepts and verifying the static analysis results.
Activity Tester:
This test can be used to forcefully test all non-exported actions.
Get Dependencies:
This functionality helps in the gathering of all information regarding the application’s runtime
dependencies.
Take Screenshots:
This feature enables you to capture a screenshot
of a device that is currently running in a virtual machine.
Logcat Stream:
The Logcat stream shows all of the device’s logs in real time.
A new window will be opened, and all real-time logs will begin to stream.
MobSF does not yet have the capability to perform autonomous dynamic analysis. This is due to MobSF’s lack of understanding of your app’s business logic, how to fill in the login and password fields, or what data it should provide. To get the most out of MobSF dynamic analysis, you must walk through the application’s various business logic and difficulties while MobSF performs security analysis in the background.
Initializing the Dynamic Analysis Process :
The first step in the dynamic analysis process is to select start instrumentation
, which loads the application and allows MobSF to instrument it.
Instrumentation with Frida
To see the output of these Frida scripts, use the console or look in the Frida live logs
folder. Whether you’re running or writing a custom Frida script, Frida live logs
will display all of the output from the various Frida scripts.
Once the instrumentation process is complete, the Live API monitor
button will be enabled. The live API monitor simply logs all API calls that occur during the course of the application.
Frida Code editor
The MobSF dynamic analyzer also includes access to the Frida code editor, where custom or pre-built Frida scripts can be loaded.
Generate Report:
MobSF is advised to stop all analysis and generate a report when the Generate Report option is selected.After the dynamic analysis is completed, the final report should look somewhat like this.
Click here to see the full dynamic analysis report of the Quick Shortcut Maker apk application.
Closing
MobSF is a very useful tool for developers because it helps them find security flaws in apps while they’re still being developed, as well as do static analysis directly on the source code of those apps. It also aids security engineers in performing mobile app security audits by allowing them to conduct security analysis on both the final production-ready binaries and source code. MobSF also offers a REST API that DevSecOps professionals may use to integrate it directly into CI/CD pipelines, and malware researchers can use to quickly and effectively discover harmful behavior and malware signatures in applications.This article may have been entertaining as well as instructive in terms of how to install MobSF and use it from the ground up on a variety of platforms. Join Aviyel’s community to learn more about the open source project, get tips on how to contribute, and join active dev groups.
Call-to-Action
Aviyel is a collaborative platform that assists open source project communities in monetizing and long-term sustainability. To know more visit Aviyel.com and find great blogs and events, just like this one! Sign up now for early access, and don’t forget to follow us on our socials!