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

AnalysisReport

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.

Statistics

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.

Difficulties

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:

Information leak

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:

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 :

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:

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:

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:

Improper Session Handle

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:

Transport Layer

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:

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:

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.

Understanding 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

Mac Installation

  • Install Git
  • Install Python 3.8-3.9
  • After installing Python 3.8+, go to /Applications/Python 3.8/ and run Update Shell Profile.command first and then Install 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:

Ubiuntu Debian

  • 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

Windows

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 _:

Docker

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:

Docker Running

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

dockerhub

_ 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.

MobSF live

MobSF live

MobSF live

Static Analysis using MobSF

Static Analysis

MobSF Installation

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.

Clone

  • Installing all the packages/dependencies.

Installing dependencies

For Linux / mac:

Linux and mac

./setup.sh

For Windows:

Windows

./setup.bat

installation

installation

installation

MobSF

  • Execute the ‘Run’ command now.

For Linux & mac:

Linux and mac

./run.sh

For Windows:

Windows

./run.bat

Mobsf running

MobSF running

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.

File selection

MobSF

Features of MobSF static analysis

Features

Information Section:

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.

Information Section

APP scores

App scores

The app’s various scores are displayed in this section, including the average CVSS, security score, and number of trackers recognized.

App scores

MobSF scorecard

scorecard

This section contains a detailed visual representation of the scores for various findings.

MobSF card

The security score is determined by the severity, whereas the average CVSS score is determined by calculating the average CVSS score.

CVSS

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

File info

The File information section, which is located next to the App score, displays the file’s name, size, and basic hashes.

File Information

App Information

App info

The App Information section, located next to the File Information section, contains information about the app’s package name, main activity, and current version.

App Information

Playstore description

Playstore

This section simply lists the app’s description as it appears on the ‘Google Play Store

Playstore Section

Playstore Section

Component section

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.

Component Section

Scan Option

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.

Scan Options

Signer Certificate

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.

Signer Certificate

Application permission

Application Logo

All of the permissions used by the application (Open camera apk) are listed in the Permissions section, along with their status, information, and descriptions.

Application Permission

Android API

Android API logo

Android API section provides the information about all the api which is being used inside this particular application.

Android API

Android API

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.

Browsable Activities

Security Analysis:

Logo

The security analysis section includes manifest, code, binary, NIAP, and file analysis.

Security Analysis

Network Security

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.

Manifest Analysis

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.

Code Analysis

Binary Analysis

MobSF lists out all of the issues that have been detected on the shared objects and displays it inside this particular section.

Binary Analysis

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.

NIAP Analysis

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.

File Analysis

Malware analysis

malware analysis logo

Malware Analysis

APKiD analysis

This section provides a solid understanding/picture of the application’s behavior from a code perspective.

ApkID analysis

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.

Server Location

Quark analysis

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.

Domain Malware Check

Domain Malware Check

Reconnaissance

Reconnaissance

Reconnassance

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.

URLs

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.

Firebase DB

Emails

All of the emails contained in the source code can be extracted by MobSF and displays it inside this particular section.

Emails

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

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.

Strings

Possible hardcoded secrets

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.

Components

Activities

Activities are simply a single screen in your app with an interface that the user can interact with.

Activities

Activities

Services

Services are part of application which runs in the background.

Services

Services

Receviers

Receviers allows users to register for system or in any kind of application events.

Receivers

Receivers

Providers

Providers each have their own UI for working with data.

Providers

Providers

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.

report report report report report report report report report report report report report report

Visit this link to see the full report on the Quick Shortcut Maker apk application.

What is Dynamic analysis ?

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.

Error

Error

Error

You must start a genymotion VM before launching MobSF to perform android dynamic analysis without any issues.

virtual machine

virtual machine

virtual machine

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.

Dashboard

MobSF Dynamic analysis features and functionality:

Logo

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.

Show and stop screen

Remove Root Certificate(CA):

This feature is responsible for intercepting the traffic of the device.

install

remove

TLS/ SSL test:

Tls ssl

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.

tls ssl

tls ssl

command line

image

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

Activity Tester:

This test can be used to forcefully test all non-exported actions.

Activity Tester

Get Dependencies:

This functionality helps in the gathering of all information regarding the application’s runtime dependencies.

Get dependencies

Take Screenshots:

This feature enables you to capture a screenshot of a device that is currently running in a virtual machine.

screenshot

Logcat Stream:

The Logcat stream shows all of the device’s logs in real time.

Logcat Stream

A new window will be opened, and all real-time logs will begin to stream.

Logcat 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.

Instrumention

Frida

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.

Frida

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.

API

API

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.

Live Code Editor

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.

Report

Report

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!