From e389b3f97eb1b8c2c4e594147d22f4332e8ec1bb Mon Sep 17 00:00:00 2001 From: Filippo Anarratone Date: Sat, 10 Feb 2018 14:46:26 +0000 Subject: [PATCH] Fix hostname variable when disabling Windows Defender --- Vagrant/Vagrantfile | 1 - Vagrant/scripts/install-utilities.ps1 | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrant/Vagrantfile b/Vagrant/Vagrantfile index 338246c..68604cb 100644 --- a/Vagrant/Vagrantfile +++ b/Vagrant/Vagrantfile @@ -119,7 +119,6 @@ Vagrant.configure("2") do |config| cfg.vm.hostname = "win10" cfg.vm.communicator = "winrm" - cfg.vm.provision "shell", inline: "Set-MpPreference -ExclusionPath C:\\commander.exe, C:\\Tools" cfg.vm.network :private_network, ip: "192.168.38.4", gateway: "192.168.38.1", dns: "192.168.38.2" cfg.vm.provision "shell", path: "scripts/fix-second-network.ps1", privileged: false, args: "-ip 192.168.38.4 -dns 192.168.38.2" diff --git a/Vagrant/scripts/install-utilities.ps1 b/Vagrant/scripts/install-utilities.ps1 index 6db1045..6272a19 100755 --- a/Vagrant/scripts/install-utilities.ps1 +++ b/Vagrant/scripts/install-utilities.ps1 @@ -20,8 +20,9 @@ apm install language-batch apm install language-docker # Disable Windows Defender realtime scanning before downloading Mimikatz -If ($hostname -eq "win10") { +If ($env:computername -eq "WIN10") { set-MpPreference -DisableRealtimeMonitoring $true + Set-MpPreference -ExclusionPath C:\commander.exe, C:\Tools } # Purpose: Downloads and unzips a copy of the latest Mimikatz trunk