Skip to content

Add new Quark rules for BRATA malware detection#917

Merged
haeter525 merged 9 commits into
ev-flow:masterfrom
pulorsok:add-brata-report
May 27, 2026
Merged

Add new Quark rules for BRATA malware detection#917
haeter525 merged 9 commits into
ev-flow:masterfrom
pulorsok:add-brata-report

Conversation

@pulorsok
Copy link
Copy Markdown
Member

@pulorsok pulorsok commented May 8, 2026

Brata Malware Family Analysis Report

Quark's existing rule set already detects the brata malware family — no new rule was required. Check here for the rule set.

With these rules, Quark is able to identify the brata malware family as high-risk. In our experiment, Quark achieved 100% accuracy and 100% precision. See tested APKs below.

Identified Well-Known Threats

This section uses MITRE ATT&CK Mobile as its reference taxonomy. The table below lists every technique documented for BRATA (per software entry S1094 BRATA) alongside how each manifests in real-world campaigns — all of which the current Quark rule set can detect statically from APK bytecode.

MITRE Technique Real-world manifestation
T1418.001 Security Software Discovery Detecting antivirus or security products to evade analysis and detection
T1513 Screen Capture Recording device screen content to harvest credentials and sensitive user data
T1533 Data from Local System Exfiltrating contacts, messages, photos, and other locally stored personal information

All behavior maps below were rendered from sample 2d15bc6c736c5422f3673d94c8f9d3d28ac1512eae6f459cd768842103266937.apk — chosen as the representative sample whose detected behaviors most fully cover the documented profile of BRATA. The other 21 family samples were used to compute the accuracy and precision figures above.

Each section below corresponds to one technique from the table above. Within each section we first quote the MITRE definition, then show the Quark behavior map extracted from the representative sample's bytecode, then walk through the call sequence and list the underlying rules.

1. T1418.001 Security Software Discovery

T1418.001 Security Software Discovery — attack.mitre.org

MITRE definition (T1418.001): Adversaries may attempt to get a listing of security applications and configurations that are installed on a device. This may include things such as mobile security products.

T1418.001 Security Software Discovery

The behavior map above shows BRATA querying the package manager for a single application's information and display label (GetApplicationLabel). Malware uses this same lookup to check for security software: by querying the package names of known antivirus or mobile-security apps, it can tell whether any are installed. This is the Security Software Discovery (T1418.001) behavior documented for BRATA — it lets the malware decide whether to keep operating or stay dormant to avoid detection.

Behaviors detected by Quark:

2. T1513 Screen Capture

T1513 Screen Capture — attack.mitre.org

MITRE definition (T1513): Adversaries may use screen capture to collect additional information about a target device, such as applications running in the foreground, user data, credentials, or other sensitive information.

T1513 Screen Capture

onImageAvailable copies pixels from the latest rendered image into a Bitmap object. This call enables the malware to capture screenshots of the device screen in real time.

Behaviors detected by Quark:

3. T1533 Data from Local System

T1533 Data from Local System — attack.mitre.org

MITRE definition (T1533): Adversaries may search local system sources, such as file systems or local databases, to find files of interest and sensitive data prior to exfiltration. Access to local system data, which includes information stored by the operating system, often requires escalated privileges.

T1533 Data from Local System

FindByMail calls getAllContacts to read records from a content provider via ContentResolver, iterating the returned cursor. Both are methods of the app's B4A ContactsWrapper, indicating the queries target the device's contact database. The behavior map evidences these generic content-provider reads; it does not pin down a specific field such as email address.

Behaviors detected by Quark:

List of Tested APKs

The table below lists the APKs we tested.

index sha256
1 27E0EC79DBB7C7F99B43C8C01A94188D1071D1245B1745D0E066AE774C78A8F8
2 2846C9DDA06A052049D89B1586CFF21F44D1D28F153A2FF4726051AC27CA3BA7
3 2D15BC6C736C5422F3673D94C8F9D3D28AC1512EAE6F459CD768842103266937
4 32552C098CD0E8075583162B1E895F1089A3E97FA9AC6281C0D0272D9AF132E2
5 37A0F317B897F23F5A6BA4A6B1C5E03A80333FF81BC8C1FADC09EB4C1914797D
6 4392358E24121C8C9C1BD36341286CEAD074ECE01B5E615EC56C572F5583E0B0
7 46F4F981BE30D60795164F97B45219C523DBF8F59608901EB29DA42BCF941CFE
8 4C57C5EAE5A1BAE1A50BEED28AFFDFF722C89416886E5EDA8088A06771CC29C8
9 5395936963DF4D72B365FD30AB52A00A88F8A5F75336BA84AC8A9FC369E0F811
10 6327B82AAAB714DC17322E1F215BCA9219F937A1DF6F71C8892BF75FCFA53830
11 80443FF27C7D665E1D9DB78CE70E67478C2A2F47DB4F84AF7BA4DB85C0EAD677
12 98B778F619E1C0F822B9514C81B9869F0302A2FEF53754739BB92C67D02609E0
13 9BF89B33609973D48C7D09D5774C39BFCEFD3922202DB0D872F12B3FFDB28529
14 B2EC5CBCA08D8AEF4F638FFB479FDF613EEAA31FF9C30C73DBEDA7FF8EB4A25B
15 B5A64791728AA641838D2A478375F5D46F91C91B8DF0CDE34B21DDA2D4D7D8A1
16 B64123E4FF92CD7BE104B21CA0DEAEFD89E8270572746C61EFC3E7CD05999B5D
17 D774779A1E53D5C1012EC855CD6567D6E9F779299DDF0D07E96DDE6C0679F4DF
18 D7AF3C8E53B2B1B5B84E5542353FC80C28B2297238469E189F7C83ACB666943B
19 DCDCACAFACB1F8A9474FF714DD418E0104E854B87AD07220CE5E4564568CE997
20 ED1C4B8B6F7ED4F93A9B06F4FBE4BB28782994BC121CD0540F9DE62FF22FA78F
21 F690E30B6EE25C153EFFC5620FD7EC61481A449A127B54A67C7AFC4C13D7917F
22 FA816C631249922539EEEB3E8F73D3EF4EA997AB729751ADEBCEA3D0DE32A63B

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.40%. Comparing base (5337c50) to head (81bcf00).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #917   +/-   ##
=======================================
  Coverage   81.40%   81.40%           
=======================================
  Files          80       80           
  Lines        6969     6969           
=======================================
  Hits         5673     5673           
  Misses       1296     1296           
Flag Coverage Δ
unittests 81.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pulorsok pulorsok force-pushed the add-brata-report branch 4 times, most recently from 3d3a06f to 740cadf Compare May 14, 2026 10:26
pulorsok added 4 commits May 25, 2026 18:30
Add a malware report section for the BRATA Android banking trojan
(MITRE ATT&CK Mobile S1094) covering rule ev-flow#276.  The report walks
through 4 techniques the family employs — security software discovery,
screen capture, input injection, and data from local system — with a
behavior map and rule citations for each.
Sync the BRATA section with the same structure used for GodFather
and TangleBot:

* Restructure intro — move MITRE framing and sample provenance from
  intro into the "Identified Well-Known Threats" section, leaving the
  intro to just the rule announcement and accuracy claim.
* Reorder each technique block: MITRE definition now comes before the
  behavior map image so readers see the technique definition first,
  then the Quark evidence.
* Drop the "Cluster reflects ... see description below" disclaimer
  and fold the cluster-to-technique rationale directly into the
  descriptive prose for T1418.001.
* Drop the T1516 Input Injection section entirely.  Its image file
  was missing (the behavior_map step did not render or upload it)
  and the section had no "Behaviors detected by Quark" bullet list,
  so the rendered output would have shown a broken image link with
  no rule citations.  The T1516 row in the MITRE table is removed
  too so the table and the per-technique walkthrough stay aligned.
* Fix spelling and style: behaviour -> behavior, BRATA
  capitalisation in prose, drop "sample(s)" plural marker,
  "literature profile" -> "documented profile".
* Update intro wording to state that MITRE ATT&CK Mobile is the
  reference taxonomy and that the current Quark rule set detects
  all listed techniques statically from APK bytecode.
* Add the missing blank line between the TangleBot APK table and
  the BRATA section heading so the RST renders cleanly.
* T1513 description: switch from plural "Combined, these APIs allow"
  to singular "This call enables" so the verb agrees with the single
  rule (ev-flow#210) cited below.
* T1513 description: change adverbial "in real-time" to "in real
  time" (no hyphen for adverbial use; the hyphenated form is the
  adjective).
* T1533 heading: lowercase "from" in "Data from Local System" to
  match MITRE's official wording and the row in the technique table.
The previous wording claimed BRATA "enumerates installed
applications" and "lists every installed app", but the Quark
cluster behind this section contains a single rule (ev-flow#265 "Get
application info and label") — a one-shot application-metadata
lookup, not an iteration over all installed apps.

Rewrite the description to state what Quark actually observed (the
single-app lookup primitive) and then explain that T1418.001
Security Software Discovery is the documented BRATA use case for
that primitive — calling it against a list of known mobile-security
product package names.  This keeps the report's claims aligned with
the underlying evidence.
@pulorsok pulorsok force-pushed the add-brata-report branch from 20270d6 to 24d5582 Compare May 25, 2026 10:30
pulorsok added 5 commits May 26, 2026 15:41
The previous description claimed BRATA "harvests contact data
including email addresses", but the behavior map does not support
the email-address specificity.  The three underlying rules
(ev-flow#187, ev-flow#212, ev-flow#215) detect only generic ContentResolver/Cursor
operations (query + moveToNext / getString / getCount) — none of
them evidences extraction of a specific field such as email.  The
"email" wording was inferred from the B4A method name FindByMail,
not from the detected behavior.

Reword to state what the behavior map actually shows: generic
content-provider reads via the app's B4A ContactsWrapper, whose
contact-oriented method names indicate the contact database is the
target, while explicitly noting the rules do not pin down a
specific field.
The previous wording ("Quark observes the single-app lookup
primitive; ... calling this primitive against a list of known
mobile-security product package names ...") was dense and hard to
follow.  Rewrite as three plain sentences: what Quark detected (a
single-app package-manager lookup), how malware turns that into
security-software discovery (querying known AV package names), and
the T1418.001 mapping plus its purpose (deciding whether to keep
operating or stay dormant).
Added BRATA banking trojan details to the README.
The BRATA rules PR was closed: analysis showed BRATA needs no new
rule (its detectable behaviors are already covered by existing
rules, and the only L5-passing candidate had no malware-vs-benign
discrimination).  The section intro still announced "New Quark rule
(ev-flow#276) is now available", which is no longer true.

Reword the heading and intro to state that Quark's existing rule
set already detects BRATA, with no new rule required.  The
technique walkthrough is unchanged — it already cites only existing
rules (ev-flow#265, ev-flow#210, ev-flow#187/ev-flow#212/ev-flow#215).
…Report"

Align the section title with the wording used in the X post
announcement.
Copy link
Copy Markdown
Member

@haeter525 haeter525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@haeter525 haeter525 merged commit a71a827 into ev-flow:master May 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants