CyberThreatIntel/Pakistan/APT/Gorgon/23-08-19/Malware analysis 25-08-19.md
2019-08-26 01:10:49 +02:00

8.6 KiB

Malware analysis on Gorgon APT campaign (23-08-19)

Table of Contents

Malware-analysis

Initial vector

Use a document with a macro as initial vector. On the code of the macro, some functions with differents names are used with the same code inside for obfuscate and make more harder the analysis.

alt text

Use in more at the function, strReverse for reverse the data. Finally, combine it and execute it with a Shell request.

alt text

This use mshta command for download and execute the external content. The bitly URL go on the pastebin share and is the first stage.

First stage

The first stage executed on the computer is a js script who use nested unescape (3 times).

alt text

At the 3th layer, we can see a vb script using some obfuscating methods (StrReverse, splited variables, multiples Wscript objects)

alt text

Finally, the script kills the word, excel, publisher and powerpoint instances, add a persistence for re-executes this script for reinfecting the computer and create two schedule task for the second stage and close the hidden window. The persistence by Run key can look like useless but it used like an updating vector for change the TTPs or executing a kill switch on the operation.

alt text

Second stage

The first pastebin use too a js script with with 3 layers of unescape and the previous obfuscating methods.

alt text

alt text

Loader + Frombook

Loader

The loader have one layer of obfuscation in using the getstring method for have the command and the data of the future dll.

alt text

After this replace the caracters %_ by 0x with the replace function for get a valid array of hex bytes and execute it in memory.

alt text

The dll is protected with the ConfuserEx (1.0.0.0) protector, we can see the escaped caracters and the reference module.

alt text alt text

Once the protection removed, we can see the functions used by the dll.

alt text

The run method get the payload string push by the second PE, decode it and execute it.

alt text

Frombook

We can observe on the structure, the encoding for scale the data and add junk code on the PE for avoid the detection of the AV (here, in the "Currentversion" string.

alt text

This sample is programming in C++ (Frombook is available in many language : VB, C, C++, C#...) and check the PE structure.

alt text

This continue to detect and steal the data from the navigators.

alt text alt text

This parsed and steal the passwords.

alt text

We can observe the useragent settings who send the data to the C2.

alt text

This use a run key as persistence for the frombook module.
Some features of Frombook form the cyberbit analysis can be observed in this analysis and the execution on the anyrun sandbox :
  • Keystroke logging
  • Clipboard monitoring
  • HTTP/HTTPS/SPDY/HTTP2 form and network request grabbing
  • Browser and email client password grabbing
  • Capturing screenshots
  • Bot updating
  • Downloading and executing files
  • Bot removing
  • Launching commands via ShellExecute
  • Clear browser cookies
  • Reboot the system
  • Shutdown the system
  • Download and unpack ZIP archive

Cyber kill chain

These process graphs represents the cyber kill chain of the initial vector and the Frombook module.

alt text alt text

Cyber Threat Intel

References MITRE ATT&CK Matrix

List of all the references with MITRE ATT&CK Matrix
Enterprise tactics Technics used Ref URL

Indicators Of Compromise (IOC)

List of all the Indicators Of Compromise (IOC)
Indicator Description
IP C2
http[:]// URL request
Domain C2
This can be exported as JSON format Export in JSON