Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 2.3 KB

T1064.md

File metadata and controls

33 lines (17 loc) · 2.3 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 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 macos 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. (Citation: Metasploit) (Citation: Metasploit), (Citation: Veil) (Citation: Veil), 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)

How to Detect

Simulating the attack

Creates and executes a simple bash script.

Data sources required to detect the attack

auditlogs (audit.rules)

Splunk Queries to detect the attack

auditlogs(syscalls)

index=linux sourcetype=linux_audit syscall=59 OR syscall=322 | table host,syscall,syscall_name,exe,auid

This could be very overwhelming if whitelisting is not done.

bash_history

Caution/Caveat

This could be any malicious script run. To catch this, we need to know what is normal in our environment - which files/binaries are getting executed, when, at what intreval, who executes it etc. Once we have that data then any script out of that knowledgebase(whitelist) should be flagged.