• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

War Room

Shells from above

RSM logo

  • Home
  • About
  • Blog
  • Talks/Whitepapers
  • Tools
  • Recreation
Home > Offense > Vulnerability scanning your Android apps

Vulnerability scanning your Android apps

November 30, 2020 By Austin Marck

A lesser known feature of the Mobile Secuirty Framework scanner MobSF from ‘https://opensecurity.in/’ is its ability to quickly scan a folder of APK files. This isn’t normally something most users would need if they were only targeting a single app but if you’re trying to assess the security of a device you might find it necessary to look at every piece of software, from the firmware to the apps loaded onto it. With many IoT devices using Android as a base OS I find that I regularly need to quickly pull and assess a series of apps quickly in a search for low hanging fruit.

After selecting your device, even your own Android phone, connect it over USB.

Ensure ADB is installed.

apt-get install adb
yum install android-tools

Install MobSF

git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF

start mobsf

./run.sh


Note the rest_api_key, we’ll need it later.

Gather APKs

There are many ways to get APKs from an Android device but this one-liner has always worked well for me. It does a good job of renaming the packages from base.apk to their package name as well, which helps when you’re assessing an entire device.

for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv base.apk $i.apk 2&> /dev/null ;done

This should give you a folder full of APKs ready for analysis, we might want to remove those that are heavily reviewed (default apks). Next we’ll turn our attention to a script provided by MobSF

Mobile-Security-Framework-MobSF/scripts/mass_static_analysis.py
https://mobsf.github.io/docs/#/extras?id=mass-static-analysis

run this tool with the -d option the location of the MobSF server, and the api key we noted earlier.

./mass_static_analysis.py -d /pathtoextracted -s 127.0.0.1:8000 -k <rest_api_key>

Review the results within MobSF…

draw the rest of the owl…

 

This is only a small piece of device security, but in this guide we briefly went over performing static analysis on the apps within an Android device. This approach is largely automated and a great place to start your user level static analysis.

 

Further learning:
https://mobile-security.gitbook.io/mobile-security-testing-guide/

https://mobsf.github.io/docs/#/extras?id=mass-static-analysis

Share this...
  • Reddit
  • Email
  • Facebook
  • Twitter
  • Linkedin

Austin Marck

Primary Sidebar

Categories

  • Defense
  • Forensics
  • Offense
  • Physical
  • R&D

Most Viewed Posts

  • DLL Injection Part 1: SetWindowsHookEx 10.8k views
  • Sophos UTM Home Edition – 3 – The Setup 10.8k views
  • Leveraging MS16-032 with PowerShell Empire 10k views
  • Bypassing Gmail’s Malicious Macro Signatures 9.8k views
  • How to Bypass SEP with Admin Access 8.9k views

Footer

  • RSS
  • Twitter
  • Tools
  • About
  • RSM US LLP

+1 800 903 6264

1 S Wacker Dr Suite 800
Chicago, IL 60606

Copyright © 2023 RSM US LLP. All rights reserved. RSM US LLP is a limited liability partnership and the U.S. member firm of RSM International, a global network of independent audit, tax and consulting firms. The member firms of RSM International collaborate to provide services to global clients, but are separate and distinct legal entities that cannot obligate each other. Each member firm is responsible only for its own acts and omissions, and not those of any other party. Visit for more information regarding RSM US LLP and RSM International.