Add Quark malware analysis report for AndroRAT - #954
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
haeter525
self-requested a review
July 14, 2026 19:05
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>
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
Added new malware entries with descriptions and links.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viaContentResolver) 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.
MediaRecorderfrom a background service for on-device surveillanceLocationManager.getLastKnownLocationfor later collection by the RAT dispatcherSmsManager.sendTextMessagesends from the command dispatcherIntent.ACTION_CALLintent with an operator-supplied phone number and invokingstartActivityto place the callMediaRecordervideo source and camcorder profile inside a helper class that records video for exfiltrationContentResolverURI to extract call history for exfiltrationContentResolverfor exfiltrationAll cluster representatives below were extracted from either sample
48d25786...(net.droidjack.sandrorat — the DroidJack fork) or sample9c8d02ff...(my.app.client — the pristine AndroRAT builder default) or sample347f1b01...(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
Lnet/droidjack/sandrorat/VideoCap;a(an attacker-authored capture helper in the DroidJack fork) initializes aMediaRecorderwith 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
Lnet/droidjack/sandrorat/GPSLocation;e(an attacker-authored location helper in the DroidJack fork) callsLocationManager.getLastKnownLocationand reads the latitude/longitude off the returnedLocationinstance. 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
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 reachingSmsManager.sendTextMessageand the SMS-read branch reachingSMSLister;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
Lnet/droidjack/sandrorat/m;a(an attacker-authored call helper in the DroidJack fork) constructs anIntentwith theACTION_CALLaction, packs an operator-supplied phone number into the intent's URI viasetData, and invokesstartActivity— placing an outbound phone call without user consent.Behaviors detected by Quark:
5. T1512 Video Capture
T1512 Video Capture — attack.mitre.org
Lnet/droidjack/sandrorat/VideoCap;a(an attacker-authored capture helper in the DroidJack fork) callsMediaRecorder.setVideoSourceto select the device camera as the recording input, thenMediaRecorder.setProfileto 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
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 aContentResolvercursor 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
Lnet/droidjack/sandrorat/bd;b(an attacker-authored SMS reader in the DroidJack fork) opens aContentResolvercursor 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:
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.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.List of Tested APKs
The table below lists the APKs we tested.