Skip to content

Add Quark malware analysis report for AndroRAT - #954

Merged
haeter525 merged 7 commits into
ev-flow:masterfrom
pulorsok:add-androrat-report
Jul 22, 2026
Merged

haeter525 merged 7 commits into
ev-flow:masterfrom
pulorsok:add-androrat-report

Conversation

@pulorsok

@pulorsok pulorsok commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

AndroRAT Malware Family Analysis Report

This report analyzes the AndroRAT malware family using Quark's rule classification. AndroRAT is one of the earliest open-source Android remote access trojans, originating from a 2012 university project (DesignativeDave/AndroRAT). Its source code has been extensively forked and repackaged over the years — including the DroidJack commercial fork, the karma9874 revival, and various trojanized carrier apps in third-party stores. A new Quark rule (#278) was generated to detect the video-capture pattern used by the DroidJack fork (MediaRecorder.setVideoSource + setProfile); other distinctive bytecode patterns (microphone audio capture, last-known-location lookups, SMS send + inbox reads, phone-call intents, call-log reads via ContentResolver) are already covered by Quark's existing rule set. Check here for the rule set details.

Quark's rule classification flagged 5 of 5 AndroRAT samples as high-risk in this experiment (detection rate 100%). Benign-cohort false-positive rate was not measured here. See tested APKs below.

Identified Well-Known Threats

This section uses MITRE ATT&CK Mobile as its reference taxonomy, anchored to the S0292 AndroRAT software entry. Of the 10 techniques documented for the family, Quark's static bytecode analysis surfaces the 7 listed below; see the coverage-gap notes at the end of this section for why the other 3 are not demonstrated here.

MITRE Technique Real-world manifestation in AndroRAT
T1429 Audio Capture Recording ambient microphone audio via MediaRecorder from a background service for on-device surveillance
T1430 Location Tracking Reading the device's last-known GPS coordinates via LocationManager.getLastKnownLocation for later collection by the RAT dispatcher
T1582 SMS Control Receiving operator commands over the C2 socket and issuing outbound SmsManager.sendTextMessage sends from the command dispatcher
T1616 Call Control Constructing an Intent.ACTION_CALL intent with an operator-supplied phone number and invoking startActivity to place the call
T1512 Video Capture Configuring a MediaRecorder video source and camcorder profile inside a helper class that records video for exfiltration
T1636.002 Call Log Querying the call-log ContentResolver URI to extract call history for exfiltration
T1636.004 SMS Messages Reading SMS inbox contents (sender address, message body) via ContentResolver for exfiltration

All cluster representatives below were extracted from either sample 48d25786... (net.droidjack.sandrorat — the DroidJack fork) or sample 9c8d02ff... (my.app.client — the pristine AndroRAT builder default) or sample 347f1b01... (com.example.reverseshell2 — a widely-forked open-source variant). Different techniques picked different samples as their strongest evidence source. The remaining samples were used to compute the detection-rate figure above.

Each section below corresponds to one technique from the table above. Within each section we first quote the MITRE definition, then walk through the call sequence and list the underlying rules.

1. T1429 Audio Capture

T1429 Audio Capture — attack.mitre.org

MITRE definition (T1429): Adversaries may capture audio to collect information by leveraging standard operating system APIs of a mobile device. Examples of audio information adversaries may target include user conversations, surroundings, phone calls, or other sensitive information.

T1429 Audio Capture

Lnet/droidjack/sandrorat/VideoCap;a (an attacker-authored capture helper in the DroidJack fork) initializes a MediaRecorder with the microphone as its audio source and starts recording ambient audio to a file. The captured audio is then read back by the RAT dispatcher for delivery to the operator.

Behaviors detected by Quark:

2. T1430 Location Tracking

T1430 Location Tracking — attack.mitre.org

MITRE definition (T1430): Adversaries may track a device's physical location through use of standard operating system APIs via malicious or exploited applications on the compromised device. On Android, applications holding the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permissions provide access to the device's physical location.

T1430 Location Tracking

Lnet/droidjack/sandrorat/GPSLocation;e (an attacker-authored location helper in the DroidJack fork) calls LocationManager.getLastKnownLocation and reads the latitude/longitude off the returned Location instance. The call sequence returns the device's last-known GPS coordinates to the RAT dispatcher.

Behaviors detected by Quark:

3. T1582 SMS Control

T1582 SMS Control — attack.mitre.org

MITRE definition (T1582): Adversaries may delete, alter, or send SMS messages without user authorization. This could be used to hide C2 SMS messages, spread malware via SMS, or various external effects.

T1582 SMS Control

Lmy/app/client/ProcessCommand;process (the C2 command dispatcher in the pristine AndroRAT builder namespace) receives operator commands over the socket and routes each command to a helper. Two of those helpers — the SMS-send branch reaching SmsManager.sendTextMessage and the SMS-read branch reaching SMSLister;listSMS — together let the remote operator both inject outbound SMS and pull inbox content on demand.

Behaviors detected by Quark:

4. T1616 Call Control

T1616 Call Control — attack.mitre.org

MITRE definition (T1616): Adversaries may make, forward, or block phone calls without user authorization. This could be used for adversary goals such as audio surveillance, blocking or forwarding calls from the device owner, or C2 communication.

T1616 Call Control

Lnet/droidjack/sandrorat/m;a (an attacker-authored call helper in the DroidJack fork) constructs an Intent with the ACTION_CALL action, packs an operator-supplied phone number into the intent's URI via setData, and invokes startActivity — placing an outbound phone call without user consent.

Behaviors detected by Quark:

5. T1512 Video Capture

T1512 Video Capture — attack.mitre.org

MITRE definition (T1512): An adversary can leverage a device's cameras to gather information by capturing video recordings. Images may also be captured, potentially in specified intervals, in lieu of video files.

T1512 Video Capture

Lnet/droidjack/sandrorat/VideoCap;a (an attacker-authored capture helper in the DroidJack fork) calls MediaRecorder.setVideoSource to select the device camera as the recording input, then MediaRecorder.setProfile to apply a camcorder recording profile in preparation for exfiltrating the captured video to the RAT dispatcher. Rule #278 was added in this run to cover this pair.

Behaviors detected by Quark:

6. T1636.002 Call Log

T1636.002 Call Log — attack.mitre.org

MITRE definition (T1636.002): Adversaries may utilize standard operating system APIs to gather call log data. On Android, this can be accomplished using the Call Log Content Provider.

T1636.002 Call Log

Lcom/example/reverseshell2/Payloads/readSMS;readSMSBox (an attacker-authored payload class in the reverseshell2 open-source variant — despite the SMS-suggestive name, the method queries both the SMS and call-log content-provider URIs) opens a ContentResolver cursor against those URIs and copies the returned rows into an exfiltration buffer.

Behaviors detected by Quark:

7. T1636.004 SMS Messages

T1636.004 SMS Messages — attack.mitre.org

MITRE definition (T1636.004): Adversaries may utilize standard operating system APIs to gather SMS messages. On Android, this can be accomplished using the SMS Content Provider.

T1636.004 SMS Messages

Lnet/droidjack/sandrorat/bd;b (an attacker-authored SMS reader in the DroidJack fork) opens a ContentResolver cursor against the SMS content URI, iterates the result set, and extracts sender address, inbox row IDs, and message body strings for exfiltration.

Behaviors detected by Quark:

Coverage-gap notes

The 3 MITRE techniques documented for AndroRAT that this report does NOT demonstrate:

  • T1422 System Network Configuration Discovery — the samples do read SIM operator and SIM state, but the reads are single-API calls (TelephonyManager.getSimOperator, getSimState) whose bytecode is indistinguishable from what carrier, dual-SIM, roaming-detector, and MFA apps do for legitimate reasons. Quark's rule format requires two APIs linked by data flow, so this single-API dual-use surface cannot be expressed as a stand-alone rule without a companion API that isolates the malware use case — a rule of that shape does not currently exist in the pool.
  • T1636.003 Contact List — reading the contacts content provider is likewise a single-step call (ContentResolver.query(Contacts.CONTENT_URI)) that every messenger, dialer, and address-book app performs. This hits the same Quark architectural limit as T1422: no discriminative two-API pattern is available.
  • T1655.001 Match Legitimate Name or Location — this is a runtime impersonation technique (app icon / name / package-name similarity to a real app) requiring cross-app comparison at install time; it is out of scope for static bytecode analysis.

List of Tested APKs

The table below lists the APKs we tested.

index sha256
1 347F1B018F643DE0B9C946C94BD490A7426503869A0828B0A70B4D318FA097D6
2 48D25786B7512761ED561BB50DE4C0BD8A19DF0E5DE2BC40CD9D84DDDF11C16D
3 9C8D02FF190F5929BC6745A541C326B2CD387D3145C759823D24972E65398A99
4 C5AB0ADAEDF391A395387DF33B0BF6854F1CCC9C5DA937915EA86B5EEC6E6103
5 D62705186C488BB26FCCDB1404931223A887004FD6704AC1483E599A15E92792

AndroRAT (MITRE S0292) is one of the earliest open-source Android
RATs (2012 university project), extensively forked into DroidJack,
karma9874, and various trojanized carrier apps.  We tested 5 publicly
available samples across the major variants and flagged all 5 as
high-risk via existing Quark rules — detection rate 100%.  No new
rule is added; the family is covered by the SMS-send / call-log /
SMS-inbox / location / audio / phone-call rules already in the pool.

Of MITRE's 10 documented techniques for AndroRAT, the report
surfaces the 6 that Quark's static bytecode analysis can bind.  A
"Coverage-gap notes" section transparently explains why the other 4
(T1512 Video Capture, T1422 SIM Discovery, T1636.003 Contact List,
T1655.001 Match Legitimate Name) are not demonstrated here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.29%. Comparing base (0a39d96) to head (03bdd4a).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #954      +/-   ##
==========================================
+ Coverage   80.27%   80.29%   +0.01%     
==========================================
  Files          82       82              
  Lines        7185     7190       +5     
==========================================
+ Hits         5768     5773       +5     
  Misses       1417     1417              
Flag Coverage Δ
unittests 80.29% <ø> (+0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@haeter525
haeter525 self-requested a review July 14, 2026 19:05
@haeter525 haeter525 added the documentation Improvements or additions to documentation label Jul 14, 2026
pulorsok and others added 2 commits July 15, 2026 11:01
Drop pipeline-internal jargon (MATCH/RENAME, cluster-forming, stage-5
register-flow, pool-wide trained score) that reviewers don't need.
Keep the per-technique statement of what is not detected and why in
domain terms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pulorsok and others added 3 commits July 20, 2026 17:05
Rule ev-flow#278 (MediaRecorder.setVideoSource + setProfile) was added in
this run to cover the DroidJack fork's video-capture helper class
Lnet/droidjack/sandrorat/VideoCap;a.  The prior report body claimed
no new rule was generated and listed T1512 as a coverage gap; both
were stale.

Update:
- Intro paragraph now mentions rule ev-flow#278.
- Section 5 = T1512 Video Capture with a description of the
  setVideoSource + setProfile pair.
- Section-count changes from "6 listed below" -> "7 listed below" and
  "other 4 not demonstrated" -> "other 3 not demonstrated".
- Coverage-gap list drops the T1512 bullet.
- Sections renumbered: T1636.002 -> 6, T1636.004 -> 7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The prior text said "no existing rule in the pool detects" the SIM
read and the Contacts read, which reads as a rule-authoring oversight.
The real reason is architectural: both behaviors are single-API calls
whose bytecode is used by many legitimate apps, so any two-API rule
built around them is fundamentally dual-use.  Rewrite each bullet to
name the API, name the legitimate app classes that share it, and
attribute the miss to Quark's API-pair rule format rather than to a
missing rule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…v-flow#115)

The section text says "reads the latitude/longitude off the returned
Location instance", which is the API pair covered by rule ev-flow#115
(getLastKnownLocation + getLongitude).  Rule ev-flow#137 pairs
getLastKnownLocation with Location.toString and is a different
observation pattern.  The on-disk cluster fired ev-flow#115, matching the
text; the AhRat report (with identical narrative) also cites ev-flow#115.
The previous "ev-flow#137" was a paste-time typo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
haeter525 pushed a commit to ev-flow/quark-rules that referenced this pull request Jul 21, 2026
… rules (#84)

Add rule #00278 for AndroRAT's video-capture pattern (MediaRecorder
setVideoSource + setProfile), the canonical DroidJack-fork video
recorder signature.  The rule triggers only when both APIs are called
on the same MediaRecorder instance inside one parent method, which
matches the AndroRAT-specific code shape.

Also sync score-adjusted weights for all 277 existing pool rules
retrained against the AndroRAT-inclusive corpus, matching the
convention of recent malware-detection PRs (#82 NGate, #80 Cerberus,
#76 TangleBot, #74 Godfather).

- rule 00278: mal L5 = 1/589, ben L5 = 0/239, mal:ben ratio infinity
  (zero benign false positive), trained score -1.20 (specific but
  low recall — fires only on the exact video-capture pair)
- 244 rule files touched, 243 with a score change plus the new rule

Companion analysis report PR: ev-flow/quark-engine#954

@haeter525 haeter525 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Added new malware entries with descriptions and links.
@haeter525
haeter525 merged commit e59fd72 into ev-flow:master Jul 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants