Attackers Making Use Of PowerShell and Macros for Malicious Activity
By John Atienza on April 1, 2016
- Goes over Sandbox and VM Conciousness: http://www.theregister.co.uk/2016/03/15/attackers_packing_malware_into_powershell/
Malicious MS-Office macros are being used to both compromise machines and deliver ransomware. Powersniff is a file-less malware that runs completely in memory. Powerware is ransomware ran via PowerShell. Powersniff targets victims mostly in the United States, but countries in Europe and specifically Canada were also affected. Powerware was first seen targeting a healthcare organization according to researchers at Carbon Black. The following is a breakdown of both of the attacks and their weaknesses / counter-measures.
Cyber Kill Chain Breakdown
- Reconnaissance – Collection of emails targeting possible victims (No specific targeted industries for Powersniff campaign, but most of the emails targeted professional services, hospitality, manufacturing, wholesale, energy, and high-tech industries.
- Weaponization – Malicious macro in a MS-Office document
- Delivery – Spam emails with the attached malicious Word document
- Exploitation – Tricks user into opening malicious office document (ex: docx) requests to enable macros if they are disabled otherwise it is automatically executed. This is where Word docs with malicious macros can be stopped. Organizations need user security awareness training and macros to be disabled in MS Office.
- Installation –
- Powersniff (Ursnif family) is sandbox and vm aware, and it invokes Windows Management Instrumentation service (WMI) to open a hidden instance of PowerShell via command prompt and runs completely in memory. If the system is locked down, powersniff will request permissions to run. Powershell downloads a shellcode script that is placed in a specified location depending on the target operating system being 32 or 64 bit. The shellcode is decrypted and executes a payload. The malware scans the machine for strings to detect what sort of target it has infected. If the victim is involved in healthcare or education it skips the target, but “financial systems (ex: POS systems) are preferred and marked.” Cached URLs are checked for Citrix, XenApp, and dana-na (Juniper VPN).
- Powerware (PowerShell Ransomware) executes 2 instances of PowerShell via cmd.exe. Powershell is then used to download the ransomware script. Another instance of PowerShell is used for input. The script generates random numbers for the encryption key and a UUID is assigned to the victim computer.
- Command & Control –
- Powersniff – Connects to C&C servers (Palo Alto Networks could not find any responsive C&C servers at the time of this research)
- Powerware – The script sends the encryption key and the UUID back to the attacker via HTPP in plaintext. This is where there is an operational weakness. Victims with full packet capture solutions can identify the correct domain and IP then retrieve the encryption key. After communicating with the C&C server the script encrypts files that have specific extensions it can encrypt a broad range of file formats. HTML with instructions on how to pay the $500 ransom is placed on every folder where files have been encrypted.
- Actions on Objectives –
- Powersniff – Not enough data
- Powerware – None.