Skip to content

Latest commit

 

History

History
69 lines (39 loc) · 2.85 KB

T1064.md

File metadata and controls

69 lines (39 loc) · 2.85 KB

T1064 - Scripting

Adversaries may use scripts to aid in operations and perform multiple actions that would otherwise be manual. Scripting is useful for speeding up operational tasks and reducing the time required to gain access to critical resources. Some scripting languages may be used to bypass process monitoring mechanisms by directly interacting with the operating system at an API level instead of calling other programs. Common scripting languages for Windows include VBScript and [PowerShell](https://attack.mitre.org/techniques/T1086) but could also be in the form of command-line batch scripts.

Scripts can be embedded inside Office documents as macros that can be set to execute when files used in Spearphishing Attachment and other types of spearphishing are opened. Malicious embedded macros are an alternative means of execution than software exploitation through Exploitation for Client Execution, where adversaries will rely on macros being allowed or that the user will accept to activate them.

Many popular offensive frameworks exist which use forms of scripting for security testers and adversaries alike. Metasploit (Citation: Metasploit_Ref), Veil (Citation: Veil_Ref), and PowerSploit (Citation: Powersploit) are three examples that are popular among penetration testers for exploit and post-compromise operations and include many features for evading defenses. Some adversaries are known to use PowerShell. (Citation: Alperovitch 2014)

Atomic Tests


Atomic Test #1 - Create and Execute Bash Shell Script

Creates and executes a simple bash script.

Supported Platforms: macOS, Linux

Attack Commands: Run with sh!

sh -c "echo 'echo Hello from the Atomic Red Team' > /tmp/art.sh"
sh -c "echo 'ping -c 4 8.8.8.8' >> /tmp/art.sh"
chmod +x /tmp/art.sh
sh /tmp/art.sh


Atomic Test #2 - Create and Execute Batch Script

Creates and executes a simple batch script.

Supported Platforms: Windows

Inputs:

Name Description Type Default Value
command_to_execute Command to execute within script. string dir
script_to_create Path of script to create. path C:\Windows\TEMP\execute.bat

Attack Commands: Run with command_prompt!

C:\Windows\system32\cmd.exe /Q /c echo #{command_to_execute} > #{script_to_create}
C:\Windows\system32\cmd.exe /Q /c #{script_to_create}

Cleanup Commands:

del #{script_to_create}