Join our Newsletter — 33% off our NHI Course
Home› Guides› Mobile T1623 Command and Scripting Interpreter: Spotting Shell…
Guide Endpoint Security

Mobile T1623 Command and Scripting Interpreter: Spotting Shell Abuse on Android and iOS

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 12 November 2026 9 min read
On this page

Mobile malware that reaches a command interpreter can run arbitrary commands, scripts and binaries, and with root or a jailbreak it can change protected system files. MITRE ATT&CK for Mobile tracks this as T1623 Command and Scripting Interpreter, under the Execution tactic, with one sub-technique, T1623.001 Unix Shell. ATT&CK lists both Android and iOS. This guide explains how the technique differs on each platform, what real malware has done with it, and how app vetting, MDM compliance, attestation and forensics expose it. It is for mobile security engineers, SOC analysts and incident responders. For the wider matrix, see the MITRE ATT&CK for Mobile Guide.

Key takeaways

  • Both platforms, different exposure. Android is UNIX-like and exposes a shell through Android Debug Bridge (ADB) or Java's Runtime package; on stock iOS, ATT&CK's detection guidance treats any shell spawn as a jailbreak indicator.
  • Root changes the stakes. ATT&CK notes some shell commands need elevated privileges available only on rooted or jailbroken devices, where malware may invoke a superuser binary.
  • Interpreters are not only shells. ATT&CK records TianySpy stealing data with malicious JavaScript and NGate using Java to load and verify runtime configuration.
  • Detection lives in vetting and compliance. Watch for apps that call Runtime.exec() or ProcessBuilder.start() with sh, toybox or su, and for rooted or jailbroken devices.
  • Two mitigations. ATT&CK lists M1002 Attestation and M1010 Deploy Compromised Device Detection Method, because both can detect jailbroken or rooted devices.

What T1623 is

ATT&CK describes the technique as abusing command and script interpreters to execute commands, scripts or binaries. Commands can be embedded in initial access payloads, delivered as second-stage payloads from C2, or run through interactive shells. The enterprise equivalent is T1059, covered in the T1059 Command and Scripting Interpreter Defensive Guide; this page covers the mobile differences only.

Android and iOS compared

AspectAndroidiOS
Shell access for appsATT&CK: a basic Unix shell is reachable via ADB or Java's Runtime packageApple: third-party apps are sandboxed, run without the ability to escalate their own privileges, and unnecessary tools such as remote login services are not included in the system software
What an unprivileged shell can doRuns with the calling app's sandbox permissionsATT&CK's iOS analytics treat any shell spawn on stock iOS as a jailbreak indicator
Path to elevated commandsRoot via exploit or existing root, then a superuser binaryJailbreak or kernel exploit
Main enterprise signalApp vetting for process creation; attestation and MDM root detectionJailbreak detection in MDM or MTD; app vetting on supervised devices
Development interface to controlUSB debugging (ADB) in Developer optionsSupervised device restrictions through MDM

T1623.001 Unix Shell

ATT&CK describes Unix shells as the underlying command prompts on Android and iOS, able to control every aspect of the system, with some commands needing elevated privileges available only after rooting or jailbreaking. Shells also run scripts with conditionals and loops, may be reached through C2 channels or SSH, and may be used for persistence. On a rooted or jailbroken device, adversaries may locate and invoke a superuser binary and act as root.

Real cases recorded by ATT&CK for the sub-technique include:

SoftwareBehaviour recorded by ATT&CKPlatform
AbstractEmu (S1061)Included encoded shell scripts to potentially aid the rooting process; first seen in Google Play and other stores in October 2021Android
BusyGasper (S0655)Can run shell commandsAndroid
CHEMISTGAMES (S0555)Can run bash commandsAndroid
DoubleAgent (S0550)Can run arbitrary shell commandsAndroid
HenBox (S0544)Can run commands as rootAndroid
Sunbird (S1082)Can try to run arbitrary commands as rootAndroid

Parent technique cases

  • LightSpy (S1185): plugins execute shell commands from the C2 server or from a library file called zt.dylib. ATT&CK describes LightSpy as modular malware first observed in 2018 that initially targeted iOS devices in Southern Asia before expanding to Android and macOS. It is the clearest iOS example for this technique.
  • TianySpy (S1056): steals information via malicious JavaScript (Android).
  • NGate (S9040): used Java to load and verify runtime configuration and to disable the launcher if decryption or parsing failed (Android).

For spyware response, see the Mobile Spyware Infection Response Playbook.

Detection

EvidenceAndroidiOS
Process creationApp invokes Runtime.exec(), ProcessBuilder.start() or a JNI-backed launcher with sh, bash, toybox, toolbox or su, and is not on an approved listManaged app triggers process launch that results in a shell child process on a supervised device
Command executionShell child process of an app with arguments that indicate scripted operationShell or command-executing child process under an app context
Device stateFailed Play Integrity deviceIntegrity labels, unlocked bootloader in key attestation, MTD root detectionMDM or MTD jailbreak detection
Forensic artefactsSuperuser binaries, root framework packages, unexplained scripts in app dataJailbreak artefacts; analysis of backups, filesystem dumps and sysdiagnose archives with MVT

These rows follow ATT&CK's detection strategies DET0655 (parent) and DET0607 (Unix Shell). Most of the process-level evidence comes from instrumented app vetting, not from production devices: neither platform gives MDM a process list for every app. In production, rely on device state and MTD. For forensics, the Mobile Verification Toolkit (MVT) supports consensual analysis of iOS backups, filesystem dumps and sysdiagnose archives, and of Android backups.

Prevention

  • Block rooted and jailbroken devices: ATT&CK M1002 and M1010. Require attestation for corporate access and mark compromised devices non-compliant.
  • Control ADB: on managed Android devices, disable USB debugging and Developer options through MDM policy, since ADB is a documented route to the shell. See Android Platform Tools and ADB.
  • Restrict app sources: block unknown sources on Android and use supervised iOS devices with managed app distribution, so apps carrying shell payloads are less likely to land.
  • Patch promptly: rooting and jailbreaking usually need an unpatched flaw (see T1404 Exploitation for Privilege Escalation). ATT&CK maps M1001 Security Updates and M1006 Use Recent OS Version to that precondition, not to T1623 itself, which ATT&CK v20 maps to M1002 Attestation and M1010 Deploy Compromised Device Detection Method.
  • App developers: do not build shell commands from user input or remote data in your own app; MASVS-CODE covers input handling and MASVS-RESILIENCE covers detecting an untrusted platform.

How to implement

  1. Baseline device state. Report root, jailbreak and attestation results across the fleet in audit mode for two weeks.
  2. Enforce compliance. Block corporate access from compromised devices through conditional access; keep a documented exception path for test devices.
  3. Lock down debug interfaces. Disable Developer options and USB debugging on managed Android devices; restrict host pairing on supervised iOS devices.
  4. Add vetting rules. Flag apps that spawn shells or call su, and require justification for any approved exception.
  5. Prepare response. Define when to collect an MVT or commercial acquisition, and when to wipe and re-provision.
  6. Roll back safely. If developers or test teams are blocked, scope exceptions to named devices rather than relaxing fleet policy.

Decision guidance

  • Fully managed or supervised devices: disable debug interfaces and enforce compliance strictly.
  • BYOD: you cannot disable ADB on personal profiles in every model; rely on attestation and MTD and restrict what corporate data reaches the device.
  • High-risk users: where spyware like LightSpy is a realistic threat, add iOS Lockdown Mode or Android Advanced Protection and periodic forensic checks. See Android Advanced Protection and Mobile Communications Protection for High-Risk Individuals Guide.

Where identity fits

A shell running as root can read any app's private storage, including OAuth refresh tokens, API keys and MDM enrolment credentials. Treat a confirmed shell compromise on a device as a credential exposure: revoke and reissue tokens issued to that device, rotate any service credentials stored in apps on it, and re-enrol rather than clean in place. See the Mobile Access Credentials guide.

Metrics that show it is working

  • Managed devices with Developer options or USB debugging enabled (target: zero outside named test devices).
  • Rooted or jailbroken devices with corporate access (target: zero).
  • Apps in vetting flagged for shell execution, and the share removed or justified.
  • Time from compromised-device detection to token revocation.

Framework mapping

FrameworkReferenceRelevance
MITRE ATT&CK for MobileT1623, T1623.001; DET0655, DET0607; M1002, M1010Technique, detection strategies and listed mitigations
NIST CSF 2.0PR.PS-05, DE.CM-09Preventing unauthorised software; monitoring runtime environments
NIST SP 800-53 Rev 5CM-7, AC-19, SI-7, SI-3Least functionality, mobile device access control, integrity, malicious code protection
ISO/IEC 27001:2022 Annex AA.8.1, A.8.7User endpoint devices, protection against malware
OWASP MASVSMASVS-CODE, MASVS-RESILIENCEInput handling; platform trust checks

Common failure patterns

  • Developer options left on: debug interfaces enabled for one-off support remain on across the fleet.
  • Assuming iOS is immune: LightSpy shows shell-executing plugins on iOS; jailbreak detection still matters.
  • Trusting on-device root checks: root frameworks can hide themselves; verify attestation on the server.
  • Cleaning in place: a device that ran root shell commands should be wiped and re-enrolled, with its tokens revoked.
  • Ignoring non-shell interpreters: JavaScript in WebViews and Java runtime loading are also listed by ATT&CK. See the Mobile WebView Security Guide.

Practitioner checklist

  • Disable Developer options and USB debugging on managed Android devices.
  • Block corporate access from rooted or jailbroken devices.
  • Verify attestation on the server.
  • Flag shell and su execution in app vetting.
  • Keep OS and security patches current through compliance rules.
  • Revoke tokens and re-enrol any device with confirmed shell compromise.
  • Define when to run an MVT or commercial forensic acquisition.

Standards and references

Related NHI Mgmt Group resources: MITRE ATT&CK for Mobile Guide · T1059 Command and Scripting Interpreter Defensive Guide · Rooted, jailbroken and emulated devices · Mobile Forensics Guide · Mobile Device Management Security Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 12 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org