Try it using Invoke-Atomic

Deobfuscate/Decode Files or Information

Description from ATT&CK

Adversaries may use Obfuscated Files or Information to hide artifacts of an intrusion from analysis. They may require separate mechanisms to decode or deobfuscate that information depending on how they intend to use it. Methods for doing that include built-in functionality of malware or by using utilities present on the system.

One such example is use of certutil to decode a remote access tool portable executable file that has been hidden inside a certificate file. (Citation: Malwarebytes Targeted Attack against Saudi Arabia) Another example is using the Windows <code>copy /b</code> command to reassemble binary fragments into a malicious payload. (Citation: Carbon Black Obfuscation Sept 2016)

Sometimes a user's action may be required to open it for deobfuscation or decryption as part of User Execution. The user may also be required to input a password to open a password protected compressed/encrypted file that was provided by the adversary. (Citation: Volexity PowerDuke November 2016) https://www.aleksandrhovhannisyan.com/blog/how-to-add-a-copy-to-clipboard-button-to-your-jekyll-blog/

Atomic Tests

Atomic Test #1 - Deobfuscate/Decode Files Or Information

Encode/Decode executable Upon execution a file named T1140_calc_decoded.exe will be placed in the temp folder

Supported Platforms: windows

auto_generated_guid: dc6fe391-69e6-4506-bd06-ea5eeb4082f8

Inputs:

Name Description Type Default Value
executable name of executable path C:\Windows\System32\calc.exe

Attack Commands: Run with command_prompt!

1
2
3
certutil -encode #{executable} %temp%\T1140_calc.txt
certutil -decode %temp%\T1140_calc.txt %temp%\T1140_calc_decoded.exe

Cleanup Commands:

1
2
3
del %temp%\T1140_calc.txt >nul 2>&1
del %temp%\T1140_calc_decoded.exe >nul 2>&1

Atomic Test #2 - Certutil Rename and Decode

Rename certutil and decode a file. This is in reference to latest research by FireEye here

Supported Platforms: windows

auto_generated_guid: 71abc534-3c05-4d0c-80f7-cbe93cb2aa94

Inputs:

Name Description Type Default Value
executable name of executable/file to decode path C:\Windows\System32\calc.exe

Attack Commands: Run with command_prompt!

1
2
3
4
copy %windir%\system32\certutil.exe %temp%\tcm.tmp
%temp%\tcm.tmp -encode #{executable} %temp%\T1140_calc2.txt
%temp%\tcm.tmp -decode %temp%\T1140_calc2.txt %temp%\T1140_calc2_decoded.exe

Cleanup Commands:

1
2
3
4
del %temp%\tcm.tmp >nul 2>&1
del %temp%\T1140_calc2.txt >nul 2>&1
del %temp%\T1140_calc2_decoded.exe >nul 2>&1

source