
Detecting Mobile Malware Behavior
FreeAnalyze and detect malicious behavior in mobile applications.
Free · Opens the source repo
What Detecting Mobile Malware Behavior does
The Detecting Mobile Malware Behavior skill provides a comprehensive approach to identifying and analyzing malicious activities within mobile applications. It is designed for security professionals and analysts who need to investigate suspicious apps for potential threats such as data exfiltration, command-and-control communication, and credential theft. By leveraging a combination of behavioral analysis, permission abuse detection, and network traffic monitoring, this skill enables users to conduct thorough app assessments in a controlled environment.
The skill operates through a structured workflow that begins with static analysis of mobile app indicators, such as permissions and hashes. Users can utilize tools like VirusTotal for initial checks and MobSF for automated scans, which provide insights into hardcoded command-and-control servers and dynamic code loading behaviors. This step is crucial for identifying red flags before deeper analysis.
Following static analysis, the skill supports dynamic monitoring of network behavior, allowing users to capture and analyze traffic patterns that could indicate malicious activities. By using tools like tcpdump or mitmproxy, analysts can detect unusual DNS lookups, data exfiltration attempts, and connections to known malicious infrastructures. Additionally, runtime behavior monitoring with Frida allows for real-time observation of app interactions, such as SMS access and file operations, which are critical for identifying malware functionalities.
This skill is particularly useful for incident response teams and mobile security experts who need to assess the safety of mobile applications in enterprise environments. It provides a structured methodology for malware triage, ensuring that analysts have the necessary tools and processes to identify and respond to mobile threats effectively.
When to use it
Use this skill when investigating suspicious mobile applications or during incident response to assess potential threats in an enterprise mobile fleet.
When not to use it
This skill is not suitable for creating or distributing malware, as it is strictly intended for defensive analysis and research.
What you can build with it
Incident Response Analysis
Use this skill to analyze suspicious mobile applications discovered during incident response, ensuring potential threats are identified and mitigated.
Enterprise Mobile Fleet Monitoring
Employ this skill to monitor an enterprise's mobile application fleet for indicators of malicious behavior, helping to maintain security across devices.
Malware Triage on APK/IPA Samples
Utilize this skill for thorough malware triage on APK or IPA samples, enabling detailed assessments of potential threats before deployment.
How to install Detecting Mobile Malware Behavior
View source1. Install with the skills CLI
npx skills add mukul975/anthropic-cybersecurity-skills/detecting-mobile-malware-behavior --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mukul975Detecting Mobile Malware Behavior
When to Use
Use this skill when:
- Analyzing suspicious mobile applications submitted by users or discovered during incident response
- Monitoring enterprise mobile fleet for malicious app indicators
- Performing malware triage on APK/IPA samples
- Investigating data exfiltration or unauthorized device access from mobile apps
Do not use this skill to create, enhance, or distribute malware. This skill is for defensive analysis only.
Prerequisites
- Isolated analysis environment (dedicated device or emulator, not connected to production networks)
- MobSF for automated static+dynamic analysis
- Frida/Objection for runtime behavior monitoring
- Wireshark/tcpdump for network traffic capture
- Android emulator (AVD) or Genymotion for safe execution
- VirusTotal API key for hash lookups
Workflow
Step 1: Static Indicator Analysis
# 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
Step 2: MobSF Automated Malware Scan
# 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)
Step 3: Network Behavior Monitoring
# 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
Step 4: Runtime Behavior Monitoring with Frida
// 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");
});
Step 5: Classify Malware Type
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 |
Key Concepts
| 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 |
Tools & Systems
- MobSF: Automated static and dynamic analysis for initial malware triage
- VirusTotal: Multi-engine malware scanning and hash reputation lookup
- Frida: Runtime behavior monitoring through method hooking
- Wireshark: Network traffic analysis for C2 communication patterns
- Cuckoo Sandbox / CuckooDroid: Automated malware analysis sandbox for Android samples
Common Pitfalls
- Anti-analysis evasion: Sophisticated malware detects emulators, debuggers, and Frida. Use hardware devices and stealthy Frida configurations for accurate analysis.
- Time-delayed payloads: Some malware activates only after a delay or specific trigger. Monitor for extended periods and simulate various conditions.
- Encrypted C2: Malware using encrypted communications requires TLS interception or memory inspection to observe payload content.
- Multi-stage payloads: Initial APK may be benign; malicious payload downloads later. Monitor for dynamic code loading and file downloads.
Frequently asked questions about Detecting Mobile Malware Behavior
Similar skills
Cloudflare Security Audit
Perform authorized security audits on codebases.
Authenticated Scan with OpenVAS
Perform deep vulnerability scans using OpenVAS with credentials.
Active Directory Penetration Test
Conduct focused AD penetration tests with ease.
Active Directory BloodHound Analysis
Visualize Active Directory attack paths and risks.
Orchestrating LLM Attacks with PyRIT
Automate multi-turn adversarial attacks against LLMs.
Operating Sliver C2
Deploy and manage Sliver C2 for red-team engagements.
