{ "type": "bundle", "id": "bundle--5edc4ff1-62ee-4a4f-b82c-195bd9aeeb1c", "spec_version": "2.0", "objects": [ { "x_mitre_platforms": [ "Windows", "macOS", "Linux" ], "x_mitre_domains": [ "enterprise-attack" ], "x_mitre_contributors": [ "Cody Thomas, SpecterOps" ], "object_marking_refs": [ "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" ], "id": "attack-pattern--0f4a0c76-ab2d-4cb0-85d3-3f0efb8cba0d", "type": "attack-pattern", "created": "2020-06-23T19:12:24.924Z", "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", "external_references": [ { "source_name": "mitre-attack", "external_id": "T1059.007", "url": "https://attack.mitre.org/techniques/T1059/007" }, { "source_name": "NodeJS", "url": "https://nodejs.org/", "description": "OpenJS Foundation. (n.d.). Node.js. Retrieved June 23, 2020." }, { "source_name": "JScrip May 2018", "url": "https://docs.microsoft.com/windows/win32/com/translating-to-jscript", "description": "Microsoft. (2018, May 31). Translating to JScript. Retrieved June 23, 2020." }, { "source_name": "Microsoft JScript 2007", "url": "https://docs.microsoft.com/archive/blogs/gauravseth/the-world-of-jscript-javascript-ecmascript", "description": "Microsoft. (2007, August 15). The World of JScript, JavaScript, ECMAScript \u2026. Retrieved June 23, 2020." }, { "source_name": "Microsoft Windows Scripts", "url": "https://docs.microsoft.com/scripting/winscript/windows-script-interfaces", "description": "Microsoft. (2017, January 18). Windows Script Interfaces. Retrieved June 23, 2020." }, { "source_name": "Apple About Mac Scripting 2016", "url": "https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/index.html", "description": "Apple. (2016, June 13). About Mac Scripting. Retrieved April 14, 2021." }, { "source_name": "SpecterOps JXA 2020", "url": "https://posts.specterops.io/persistent-jxa-66e1c3cd1cf5", "description": "Pitt, L. (2020, August 6). Persistent JXA. Retrieved April 14, 2021." }, { "source_name": "SentinelOne macOS Red Team", "url": "https://www.sentinelone.com/blog/macos-red-team-calling-apple-apis-without-building-binaries/", "description": "Phil Stokes. (2019, December 5). macOS Red Team: Calling Apple APIs Without Building Binaries. Retrieved July 17, 2020." }, { "source_name": "Red Canary Silver Sparrow Feb2021", "url": "https://redcanary.com/blog/clipping-silver-sparrows-wings/", "description": "Tony Lambert. (2021, February 18). Clipping Silver Sparrow\u2019s wings: Outing macOS malware before it takes flight. Retrieved April 20, 2021." }, { "source_name": "MDSec macOS JXA and VSCode", "url": "https://www.mdsec.co.uk/2021/01/macos-post-exploitation-shenanigans-with-vscode-extensions/", "description": "Dominic Chell. (2021, January 1). macOS Post-Exploitation Shenanigans with VSCode Extensions. Retrieved April 20, 2021." } ], "modified": "2021-08-16T21:02:05.142Z", "name": "JavaScript", "description": "Adversaries may abuse various implementations of JavaScript for execution. JavaScript (JS) is a platform-independent scripting language (compiled just-in-time at runtime) commonly associated with scripts in webpages, though JS can be executed in runtime environments outside the browser.(Citation: NodeJS)\n\nJScript is the Microsoft implementation of the same scripting standard. JScript is interpreted via the Windows Script engine and thus integrated with many components of Windows such as the [Component Object Model](https://attack.mitre.org/techniques/T1559/001) and Internet Explorer HTML Application (HTA) pages.(Citation: JScrip May 2018)(Citation: Microsoft JScript 2007)(Citation: Microsoft Windows Scripts)\n\nJavaScript for Automation (JXA) is a macOS scripting language based on JavaScript, included as part of Apple\u2019s Open Scripting Architecture (OSA), that was introduced in OSX 10.10. Apple\u2019s OSA provides scripting capabilities to control applications, interface with the operating system, and bridge access into the rest of Apple\u2019s internal APIs. As of OSX 10.10, OSA only supports two languages, JXA and [AppleScript](https://attack.mitre.org/techniques/T1059/002). Scripts can be executed via the command line utility osascript, they can be compiled into applications or script files via osacompile, and they can be compiled and executed in memory of other programs by leveraging the OSAKit Framework.(Citation: Apple About Mac Scripting 2016)(Citation: SpecterOps JXA 2020)(Citation: SentinelOne macOS Red Team)(Citation: Red Canary Silver Sparrow Feb2021)(Citation: MDSec macOS JXA and VSCode)\n\nAdversaries may abuse various implementations of JavaScript to execute various behaviors. Common uses include hosting malicious scripts on websites as part of a [Drive-by Compromise](https://attack.mitre.org/techniques/T1189) or downloading and executing these script files as secondary payloads. Since these payloads are text-based, it is also very common for adversaries to obfuscate their content as part of [Obfuscated Files or Information](https://attack.mitre.org/techniques/T1027).", "kill_chain_phases": [ { "kill_chain_name": "mitre-attack", "phase_name": "execution" } ], "x_mitre_detection": "Monitor for events associated with scripting execution, such as process activity, usage of the Windows Script Host (typically cscript.exe or wscript.exe), file activity involving scripts, or loading of modules associated with scripting languages (ex: JScript.dll). Scripting execution is likely to perform actions with various effects on a system that may generate events, depending on the types of monitoring used. Monitor processes and command-line arguments for execution and subsequent behavior. Actions may be related to network and system information [Discovery](https://attack.mitre.org/tactics/TA0007), [Collection](https://attack.mitre.org/tactics/TA0009), or other programmable post-compromise behaviors and could be used as indicators of detection leading back to the source.\n\nMonitor for execution of JXA through osascript and usage of OSAScript API that may be related to other suspicious behavior occurring on the system.\n\nUnderstanding standard usage patterns is important to avoid a high number of false positives. If scripting is restricted for normal users, then any attempts to enable related components running on a system would be considered suspicious. If scripting is not commonly used on a system, but enabled, execution running out of cycle from patching or other administrator functions is suspicious. Scripts should be captured from the file system when possible to determine their actions and intent.", "x_mitre_is_subtechnique": true, "x_mitre_version": "2.1", "x_mitre_modified_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", "x_mitre_data_sources": [ "Module: Module Load", "Script: Script Execution", "Command: Command Execution", "Process: Process Creation" ], "x_mitre_permissions_required": [ "User", "Administrator", "SYSTEM" ] } ] }