From cfe2a5fd43cc5818427927f1d878e9f5d9096828 Mon Sep 17 00:00:00 2001 From: "Nikhil \"SamratAshok\" Mittal" Date: Sun, 12 Nov 2017 17:15:25 +0530 Subject: [PATCH] Minor changes to Out-Excel --- Client/Out-Excel.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/Out-Excel.ps1 b/Client/Out-Excel.ps1 index 8018d38..fb1e19a 100644 --- a/Client/Out-Excel.ps1 +++ b/Client/Out-Excel.ps1 @@ -4,7 +4,7 @@ function Out-Excel <# .SYNOPSIS -Nishang Script which can generate and "infect" existing excel files with an auto executable macro. +Nishang Script which can generate and "infect" existing excel files with an auto executable macro or DDE. .DESCRIPTION The script can create as well as "infect" existing excel files with an auto executable macro or DDE. Powershell or other payloads @@ -405,6 +405,7 @@ https://github.com/samratashok/nishang Write-Output "Deleting $($ExcelFile.FullName)" Remove-Item -Path $ExcelFile.FullName } + #Cleanup Excel COM $Excel.Quit() [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() @@ -463,6 +464,8 @@ https://github.com/samratashok/nishang $WorkBook.SaveAs($OutputFile, 18) Write-Output "Saved to file $OutputFile" + + #Cleanup Excel COM $Excel.Workbooks.Close() $Excel.Quit() [System.GC]::Collect()