A Neural Implementation of NBSVM in Keras

NBSVM is an approach to text classification proposed by Wang and Manning¹ that takes a linear model such as SVM (or logistic regression) and infuses it with Bayesian probabilities by replacing word…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Android Apps version and vulnerability Detection

This is an automation module for finding the mobile app version from the android and then matching it with the CVE database to find out whether the app is vulnerable or not based on its version.

Python3

Subprocess python library

Regex python library

CVE Android Vulnerability Database

Knowledge of Data structures

ADB commands

OS: Windows

This is an automation module for finding the mobile app version from the android and then matching it with the CVE database to find out whether the app is vulnerable or not based on its version.

This article is divided into two modules:

Android App version detection Module

Vulnerability Module

Android App version detection automated module:

For finding the version and other details of the android application we used ADB Shell.

Finding a version using ADB in the terminal. Commands are as follows:

adb devices

adb shell pm list packages

adb shell dumpsys package <package name for instance(com.android.bluetooth.overlay.common)>| grep version

We’ll now automate these command in python script using subprocess and regex(re) module:

In subprocess getstatusoutput() function we pass the cmd command and it will return the status and output of the cmd command passed

subprocess.getstatusoutput(“adb devices”)

This will return the list of all the connected devices

subprocess.getstatusoutput(“adb shell pm list packages”)

This will return the status and all the package list installed in the android.

We now split the saved output using split function used in regex and then subtract the package word from the output list.

x=subprocess.getstatusoutput(“adb shell pm list packages”)

y=re.split(“:”, x[1]) #x[1] is the output of the above command(package list)

re.sub(“package”, “ ”,y[i] ) #use for loop to access every element in y

Save this result in a list.

for package in list1:

a=subprocess.getstatusoutput(“adb shell dumpsys package “ + package)

a[1] wil contain the output of the above command.

We’ll search the version in the output using re.search function

re.search(“versionName=\d*.\d*.\d*.\d*.”, a[1])

In the output we get the version name of the apps.

Vulnerability Module:

The sophisticated techniques used by the hackers has aided to increase the growth of android malware exponentially.And as most of the end-users are not technically aware to make an informed decision, they grant permissions and install the application without understanding the malicious intentions of application. This weak spot of Androidmulti-layered security has been picked by attackers and hence many malicious apps are intruding the end-user devices through various third-party malicious app stores.

Farther, the attackers targets the apps with high number of downloads-popular apps, for their malicious purpose by finding the vulnerabilities of the apps and exploiting it. For instance Instagram app is downloaded and used by more than 1 Billion users according to google play store.Thus, most of the attackers take this as opportunity to execute their attack at greater level by finding the vulnerability of the app.On the other side the unpopular apps has limited no of users.They can be outdated and their chances of non-reporting of the vulnerability is high.These apps can also be used by the attackers for their intents.Thus, there must be a method/application that will aware the end-users by the installed apps on the android and give them an overview which says, the outdated version of installed apps should be deleted or upgraded, aware the users about the present vulnerability of the installed apps according to CVE list. According CVE details of CVE-2019–3568 , a buffer overflow vulnerability in WhatsApp VOIP stack allowed remote code execution via specially crafted series of RTCP packets sent to a target phone number. The issue affects WhatsApp for Android prior to v2.19.134, WhatsApp Business for Android prior to v2.19.44, WhatsApp for iOS prior to v2.19.51, WhatsApp Business for iOS prior to v2.19.51, WhatsApp for Windows Phone prior to v2.18.348, and WhatsApp for Tizen prior to v2.18.15. The CVE score is 7.5 and the impact on Confidentiality, Integrity , and Availability is partial.Thus, WhatsApp had encouraged the users to update to the latest version of the app after discovering a vulnerability.

Like WhatsApp ,there are other apps as well.It has become difficult for the users to be updated every-time about the apps vulnerability and provided solution. The CVE Matcher solves this problem by providing the a platform for the users to get the collective information of the installed apps on their android, the reported vulnerability of the apps, re-comment the users to upgrade or delete the app according to CVE Report generated.

Complexity:

The android applications follows one-to-many relation with CVE Database. As the CVE database contains all the vulnareability of the applications which ranges from one to a finite number.By December 2019, CVE Database contains 5725 android vulnerabilities. Thus each application in the csv file is to be searched among these 5725 android vulnerabilities. To reduce the searching complexity, present string algorithms: Boyer–Moore string-search algorithm, Knuth–Morris–Pratt algorithm and Naïve string-search algorithm are used.

As it is known Boyer Moore String algorithm is well-suited for applications in which the pattern is much shorter than the text or where it persists across multiple searches.The Boyer-Moore algorithm uses information gathered during the preprocess step to skip sections of the text, resulting in a lower constant factor than many other string search algorithms . Thus, the best result is shown by Boyer Moore String algorithm.

We have used Boyer Morre sting algorithm for searching the app name and its version in the CVE database csv file. And generated that output in output.csv with the suggestion of updating or deleting the applications.

Authors:

Aman Kumar

Bhawna Yadav

Add a comment

Related posts:

Dylan Enright Joins The Org as Head of Growth

The Org has added Dylan Enright to its rapidly expanding team as the Head of Growth. Dylan will work out the New York office, and report to CEO Christian Wylonis. In his role as Head of Growth, Dylan…