The application is a PoC that helps in identifying modern bankers, potentially malicious and remote controlling applications abusing Android AccessibilityService.

Overview

Motivation

Project aims to help in:

  • identifying keyloggers and events hijacking malicious applications such as Anubis/TeaBot,
  • identifying a "fake bank consultant scenario" when a victim is requested to install a remote control application and then log in to a bank account,
  • identifying other suspicious applications abusing Android AccessibilityService mechanisms

The methods implemented in RemoteDetector class should not be considered as a comprehensive list of checks. It's a PoC that provides you a way to collect more pieces of information about potentially suspicious applications and implement propper checks. However, some of the presented checks may be highly effective in your environments.

Furthermore, you may want to implement your custom checks to outpace bad actors.

Demos

Anubis Detection

DemoAnubisPoC.mp4

Remote Control App Detection

DemoTeamViewerPoC.mp4

Description

The project aims to provide a way to detect when an Android device might be controlled or some events hijacked/keylogged. The application is a PoC that helps in identifying modern bankers such as Anubis/TeaBot, potentially malicious and remote controlling applications abusing Android AccessibilityService.

Modern banker apps abuse AccessibilityService that was created to assist users with disabilities in using Android devices and apps. They run in the background and receive callbacks by the system when AccessibilityEvents are fired. Such events denote some state transition in the user interface, for example, the focus has changed, a button has been clicked, etc.

RemoteDetector Java class allows to:

  • list suspicious applications (configurable by a list of packages)
  • list installed applications with suspicious AccessibilityService capabilities
  • list applications with enabled AccessibilityService which uses suspicious capabilities
  • list applications that uses suspicious ports (PoC currently works for Android < 10)
  • list suspicious applications installed in last 15minutes
  • list suspicious applications that installTime is similar to AccessibilityService package installTime (if different packages)

Usage

Example usage can be found in MainActivity class. Specifically, the following code performs checks if a suspicious application was installed in last 15minutes and is currently enabled as AccessibilityService:

Set<String> appsWithSuspiciousASvcsEnabled = remoteDetector.getSuspiciousAccessibilityServicesEnabled();
Set<String> appsInstalledInLastQuarter = remoteDetector.getAvailabilityServicesInstalledInLastQuarter();
Set<String> appsWithCorrelatedInstallTimesWithSuspiciousApps = remoteDetector.getAppsWithCorrelatedInstallTimesWithSuspiciousApps();

if (Sets.intersection(
                Sets.intersection(appsWithSuspiciousASvcsEnabled, appsInstalledInLastQuarter),
                appsWithCorrelatedInstallTimesWithSuspiciousApps).size() > 0) {
            Log.d(logTag, "Recently installed and enabled suspicious AccessibilityService!");
        }

Another example that may aid with detection malicious application that can draw over other apps:

Set<String> accessibilityServicesPermittedToOverlay = remoteDetector.getAccessibilityServicesPermittedToOverlay();
Set<String> appsWithSuspiciousASvcsSettings = remoteDetector.getAccessibilityServicesWithSuspiciousSettingsInstalled();

if (Sets.intersection(
                Sets.intersection(remoteDetector.getAccessibilityServiceIDsEnabled(), appsWithSuspiciousASvcsSettings),
                accessibilityServicesPermittedToOverlay)
                .size() > 0) {
            Log.d(logTag, "Suspicious AccessibilityService enabled and can draw over apps");
            ((Switch) findViewById(R.id.switch31)).setChecked(true);
        }

List of detectable remote control application can be configured via /res/raw/appconfigs.json file

More methods can be found in "RemoteDetector" class.

Details

The RemoteDetector uses information provided by Android API, especially by AccessiblityManager and PackageManager.

AccessibilityServices currently enabled on a device can be listed via getEnabledAccessibilityServiceList.

To obtain capabilities used by AccessibilityServices getCapabilities method is used. For example, to verify if a service can perform gestures, the following code returns true:

if ((svc.getCapabilities() & CAPABILITY_CAN_PERFORM_GESTURES) != 0)
    return true;

Specific pieces of information about suspicious applications are obtained from PackageManager class.

To draw over application the SYSTEM_ALERT_WINDOW is commonly utilised by malicious applications.

Documentation

Code contains document comments, especially in RemoteDetector class.

Credits to

All Android malware analytics publishing their researches, especially for:

You might also like...

Sample Android App for WebRTC with Firebase as backend

Sample Android App for WebRTC with Firebase as backend

Android WebRTC Firebase Simple Demo App for Android WebRTC video call using Firebase Realtime Database as Signalling server. Prerequisites Firebase Ac

Dec 17, 2022

Android app for Ribbit, Broker API Reference App

Android app for Ribbit, Broker API Reference App

Ribbit Reference Implementation (Android) The reference implementation for designing the Android user interface of a broker-dealer trading application

Nov 24, 2022

A simple hello word Android Studio project for Haxe/Heaps

Heaps Android - Hello World An Android Studio project for a simple Heaps.io Hello World. I'm probably not maintaining this, but it may work and if not

Nov 30, 2022

Обучающий репозиторий по Android разработке, в котором содержатся приложения, в каждом из которых проработана та или иная тема.

Обучающий репозиторий по Android разработке, в котором содержатся приложения, в каждом из которых проработана та или иная тема.

LearningApps Проект LearningApps содержит в себе различные приложения, в каждом из которых проработано несколько тем по Android разработке. Дополнител

Nov 22, 2022

Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android

ORMLite Core This package provides the core functionality for the JDBC and Android packages. Users that are connecting to SQL databases via JDBC shoul

Dec 25, 2022

Connecting Java Application With a TDengine Database.

Connecting Java Application With a TDengine Database.

TDengine Java Connector English | 简体中文 'taos-jdbcdriver' is TDengine's official Java language connector, which allows Java developers to develop appli

Dec 10, 2022

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Dec 30, 2022
Releases(v1,0)
Owner
Krzysztof Pranczk
Software engineer and security researcher
Krzysztof Pranczk
Realtime SOS Android Application. Location (GPS + Cellular Network) tracing application by alerting guardians of the User.

WomenSaftey Women Safety Android Application: Realtime SOS Android Application. Designed a Location (GPS + Cellular Network) tracing application by al

jatin kasera 6 Nov 19, 2022
SceneView is a 3D/AR Android View with ARCore and Google Filament. This is the newest way to make your Android 3D/AR app.

SceneView is a 3D/AR Android View with ARCore and Google Filament This is Sceneform replacement Features Use SceneView for 3D only or ArSceneView for

SceneView Open Community 235 Jan 4, 2023
Clone of real world Chatting application Whatsapp built on Android Studio and Firebase

WhatsappChatApp About This Project Clone of real world Chatting application Whatsapp built on Android Studio and Firebase Programming Language Used :

Aditya Bonde 11 May 23, 2022
Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB. It allows you to run bounded aggregation queries against Amazon Keyspaces and DynamoDB services.

AWS Samples 3 Jul 18, 2022
ESA Cabin is a lightweight class isolation container for Java applications.

Cabin Cabin是一款Java类隔离框架,用于隔离各个模块之间、模块和业务之间使用的第三方依赖库。使用Cabin后,模块SDK将只是用自己指定 版本的三方依赖,不会被业务引入的依赖所影响,保证业务正常运行,提高业务的开发效率,减少中间件同学此类重复的支持工作。 概述 ESA Cabin用于解决

ESA Stack 22 Dec 1, 2022
Hi, Spring fans! In this installment, we'll look at how to build tenancy-aware JDBC applications

Multitenant JDBC You'll need to spin up two separate PostgreSQL instances. Put this script into a file called postgres.sh: #!/usr/bin/env bash NAME=${

Spring Tips 19 Nov 7, 2022
A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left.

AndRatingBar A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left. 安卓RatingBar终极方案,继承自原

dqq 271 Aug 14, 2021
eXist Native XML Database and Application Platform

eXist-db Native XML Database eXist-db is a high-performance open source native XML database—a NoSQL document database and application platform built e

eXist-db.org 363 Dec 30, 2022
A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

HiddenApiRefinePlugin A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs. Backgr

Rikka apps 125 Jan 5, 2023