Flutter Mobile Apps

Flutter mobile app reversing using automated scripts and tools in bulk.

Introduction

Googleโ€™s open source Flutter has quickly become one of the most popular development toolkits for building cross platform mobile applications. In this article we will examine vulnerabilities in fultter mobile apps through reverse engineering.

Flutter is an open-source UI framework developed by Google for building natively compiled mobile, web, and desktop applications from a single codebase.

Advantages

  • Cross-Platform Functionality

  • High Performance

  • Powerful Design Capabilities

  • Time Efficiency

  • Lower Development Costs

Research Process

  • Gather apps (Selenium and Python)

  • Inspect (Bash)

  • Blutter (Reverse Engineering Tool for Flutter)

  • Scan (Gitleak)

  • Analyze


Gather Applications

Python script with Selenium was used to bulk download applications from APKCombo.com website.

Inspect

Bash script was used to verify whether the applications were built with Flutter

Blutter (Reverse Engineering Tool)

  • B(l)utter was used to reverse engineer each Flutter application.

  • Bash script was used to automate the process.

To reverse engineer Flutter applications using B(l)utter, you can automate the process with a Bash script. The B(l)utter tool provides functionality to extract Dart code from Flutter APKs.

Here's an example Bash script that automates the reverse engineering of multiple Flutter APKs using B(l)utter:

A Flutter Mobile Application Reverse Engineering Tool by Compiling Dart AOT Runtime. It Directly analyzes the libapp.so to extract Dart objects directly from binary and generates Frida scripts to dump data in a running Flutter application.

Scan (Gitleak)

Gitleaks is an open-source secret scanner for git repositories, files, and directories.

Gitleaks was used to scan the pp.txt file of each application. A Bash script was used to automate the process.

A Bash script was created to search for keywords within the pp.txt file of each application.

Analyze

The results from the scan phase were used to analyze the ASM folder and the pp.txt file.


Types of Sensitive Data

Password

Passwords that are inserted directly into software applicationโ€™s source code are referred to as hardcoded or embedded passwords.

API Key

  • Requests connected to a project can be authenticated using the API key, which is a special identification.

  • Some developers may choose to leave it on public shares or hardcode them.

Private Key

  • A cryptographic variable called a private key is used to encrypt and decrypt data along with an algorithm.

  • Only those who are allowed to decrypt the material or the key generator should have access to private keys.

Access Token

  • Access tokens grant users access to a website, application, or API and are utilized in token-based authentication.

  • The token acts as the user's entry ticket, so once their identity has been verified, they won't need to enter their credentials again for the duration of the token.

  • Example: AWS Access Token, JWT, etc

API Endpoint

  • When an application programming interface (API) is visible to ecosystems outside of its immediate environment, it's known as API exposure.


Case Study Commands

Reverse engineer an application with blutter

Gitleaks to scan for hardcoded password in pp.txt file

Curl command to make API request

Search for assembly files that contains "private"

ripgrep is a command line tool that searches files for patterns that was given.

AWS Configuration

Hooking function with Frida

Frida is a powerful dynamic instrumentation tool that lets you interact with running applications in real time, which is useful for extracting sensitive information, like secret keys, from mobile applications.

If you have the function address, you can hook it directly using Fridaโ€™s Interceptor API, which allows you to hook functions at specific memory addresses rather than by class and function names.

hook_by_address.js


REFERENCES

Last updated

Was this helpful?