Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Detects and analyzes malicious behavior in mobile applications through behavioral analysis, permission abuse detection, network traffic monitoring, and dynamic instrumentation. Use when analyzing suspicious mobile applications for data exfiltration, command-and-control communication, credential stealing, SMS interception, or other malware indicators. Activates for requests involving mobile malware analysis, app behavior monitoring, trojan detection, or suspicious app investigation.
.claude/skills/detecting-mobile-malware-behavior/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
| case-22 | ✗→✓ | ▲ Improved | — | — |
| case-17 | ✓→✓ | = Same ✓ | — | — |
| case-13 | ✓→✓ | = Same ✓ | — | — |
Use this skill when:
Do not use this skill to create, enhance, or distribute malware. This skill is for defensive analysis only.
bash# Hash the sample sha256sum suspicious.apk # Check VirusTotal curl -s "https://www.virustotal.com/api/v3/files/<SHA256>" \ -H "x-apikey: <VT_API_KEY>" | jq '.data.attributes.last_analysis_stats' # Extract permissions from AndroidManifest.xml aapt dump permissions suspicious.apk # High-risk permission combinations: # READ_SMS + INTERNET = SMS stealer # RECEIVE_SMS + SEND_SMS = SMS interceptor/banker trojan # ACCESSIBILITY_SERVICE + INTERNET = overlay attack capability # CAMERA + RECORD_AUDIO + INTERNET = spyware # DEVICE_ADMIN + INTERNET = ransomware capability # READ_CONTACTS + INTERNET = contact exfiltration
bash# Upload to MobSF curl -F "file=@suspicious.apk" http://localhost:8000/api/v1/upload \ -H "Authorization: <API_KEY>" # Review malware indicators in report: # - Hardcoded C2 server addresses # - Dynamic code loading (DexClassLoader) # - Reflection-based API calls (to evade static analysis) # - Encrypted/obfuscated payloads # - Root detection (malware often checks for root) # - Anti-emulator checks (malware evades sandbox)
bash# Start packet capture on emulator tcpdump -i any -w malware_traffic.pcap # Or use mitmproxy for HTTP/HTTPS mitmproxy --mode transparent # Monitor for: # - DNS lookups to suspicious/newly registered domains # - Connections to known C2 infrastructure # - Data exfiltration patterns (large POST requests) # - Beaconing behavior (regular interval connections) # - Non-standard ports and protocols # - Domain Generation Algorithm (DGA) patterns
javascript// monitor_malware.js - Comprehensive behavior monitoring Java.perform(function() { // Monitor SMS access var SmsManager = Java.use("android.telephony.SmsManager"); SmsManager.sendTextMessage.overload("java.lang.String", "java.lang.String", "java.lang.String", "android.app.PendingIntent", "android.app.PendingIntent") .implementation = function(dest, sc, text, sent, delivery) { console.log("[SMS] Sending to: " + dest + " Text: " + text); // Allow or block based on analysis needs return this.sendTextMessage(dest, sc, text, sent, delivery); }; // Monitor file operations var FileOutputStream = Java.use("java.io.FileOutputStream"); FileOutputStream.$init.overload("java.lang.String").implementation = function(path) { console.log("[FILE-WRITE] " + path); return this.$init(path); }; // Monitor network connections var URL = Java.use("java.net.URL"); URL.openConnection.overload().implementation = function() { console.log("[NET] " + this.toString()); return this.openConnection(); }; // Monitor dynamic code loading var DexClassLoader = Java.use("dalvik.system.DexClassLoader"); DexClassLoader.$init.implementation = function(dexPath, optDir, libPath, parent) { console.log("[DEX-LOAD] Loading: " + dexPath); return this.$init(dexPath, optDir, libPath, parent); }; // Monitor command execution var Runtime = Java.use("java.lang.Runtime"); Runtime.exec.overload("java.lang.String").implementation = function(cmd) { console.log("[EXEC] " + cmd); return this.exec(cmd); }; // Monitor camera/audio access var Camera = Java.use("android.hardware.Camera"); Camera.open.overload("int").implementation = function(id) { console.log("[CAMERA] Camera opened: " + id); return this.open(id); }; // Monitor content provider access (contacts, call log) var ContentResolver = Java.use("android.content.ContentResolver"); ContentResolver.query.overload("android.net.Uri", "[Ljava.lang.String;", "java.lang.String", "[Ljava.lang.String;", "java.lang.String") .implementation = function(uri, proj, sel, selArgs, sort) { console.log("[QUERY] " + uri.toString()); return this.query(uri, proj, sel, selArgs, sort); }; console.log("[*] Malware behavior monitor active"); });
Based on observed behaviors, classify the sample:
| Behavior Pattern | Malware Type | |-----------------|-------------| | SMS interception + C2 communication | Banking Trojan | | Camera/mic access + data upload | Spyware/Stalkerware | | File encryption + ransom note display | Mobile Ransomware | | Ad injection + click fraud traffic | Adware | | Root exploit + persistence | Rootkit | | Contact harvesting + SMS spam | Worm/SMS Spammer | | Overlay attacks + credential capture | Credential Stealer | | Crypto mining network activity | Cryptojacker |
| Term | Definition | |------|-----------| | Dynamic Code Loading | Loading executable code at runtime from external sources, commonly used by malware to evade static analysis | | C2 Beacon | Regular network check-in from malware to command-and-control server, identifiable by periodic timing patterns | | DGA | Domain Generation Algorithm creating pseudo-random domain names for resilient C2 infrastructure | | Overlay Attack | Drawing fake UI over legitimate apps to capture credentials, requiring SYSTEM_ALERT_WINDOW permission | | Anti-Emulator | Techniques malware uses to detect sandbox/emulator environments and suppress malicious behavior |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.