1️⃣ Eventos de segurança (onde tudo começa)
Pra caçar logon suspeito, alteração de grupo, falha de senha, etc:
Get-WinEvent -LogName Security -MaxEvents 50
Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4625}
Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4720}
2️⃣ Processos estranhos
Get-Process | Sort-Object CPU -Descending
Get-Process | Where-Object {$_.Name -like "*chrome*"}
Stop-Process -Name "suspeito" -Force
3️⃣ Conexões de rede
Get-NetTCPConnection
Get-NetTCPConnection | Where-Object {$_.RemoteAddress -notlike "192.*"}
Resolve-DnsName google.com
Test-NetConnection google.com -Port 443
4️⃣ Firewall, o porteiro da balada
Get-NetFirewallRule
New-NetFirewallRule -DisplayName "BLOCKMALWARE" -RemoteAddress 1.2.3.4 -Action Block
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
5️⃣ Usuários & grupos
Get-LocalUser
Get-LocalGroupMember -Group "Administrators"
Get-ADUser -Filter * | Select Name,Enabled
Get-ADGroupMember "Domain Admins"
6️⃣ Serviços (quem devia estar rodando?)
Get-Service | Sort-Object Status
Get-Service -Name "*Defender*"
Stop-Service -Name "suspeito" -Force
7️⃣ Windows Defender (o fiel escudeiro)
Get-MpComputerStatus
Start-MpScan -ScanType QuickScan
Start-MpScan -ScanType FullScan
Get-MpThreat
8️⃣ Hash de arquivo (IOC check)
Get-FileHash arquivo.exe -Algorithm SHA256
9️⃣ Ler logs sem travar o mundo
Get-Content .\log.txt -Tail 50
Select-String -Path .\log.txt -Pattern "error"
🔟 Persistência (onde malware ama morar)
Get-ItemProperty "HKLM:\...\Run"
Get-ScheduledTask
Get-ScheduledTask | Where-Object {$_.TaskName -like "*update*"}
1️⃣ 1️⃣ Exportar evidências pra CSV
Get-NetTCPConnection | Export-Csv conexoes.csv -NoTypeInformation
Get-LocalUser | Export-Csv usuarios.csv
1️⃣ 2️⃣ Inventário rápido
Get-ComputerInfo
Get-WmiObject Win32_ComputerSystem
Get-WmiObject Win32_LogicalDisk
1️⃣ 3️⃣ DLL hijacking / módulos carregados
DLL é um arquivo com funções usadas pelos programas do Windows, e DLL Hijacking acontece quando o app carrega uma DLL falsa colocada pelo atacante, fazendo o malware rodar disfarçado dentro do processo legítimo:
(Get-Process notepad).Modules
Pra caçar logon suspeito, alteração de grupo, falha de senha, etc:
Get-WinEvent -LogName Security -MaxEvents 50
Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4625}
Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4720}
2️⃣ Processos estranhos
Get-Process | Sort-Object CPU -Descending
Get-Process | Where-Object {$_.Name -like "*chrome*"}
Stop-Process -Name "suspeito" -Force
3️⃣ Conexões de rede
Get-NetTCPConnection
Get-NetTCPConnection | Where-Object {$_.RemoteAddress -notlike "192.*"}
Resolve-DnsName google.com
Test-NetConnection google.com -Port 443
4️⃣ Firewall, o porteiro da balada
Get-NetFirewallRule
New-NetFirewallRule -DisplayName "BLOCKMALWARE" -RemoteAddress 1.2.3.4 -Action Block
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
5️⃣ Usuários & grupos
Get-LocalUser
Get-LocalGroupMember -Group "Administrators"
Get-ADUser -Filter * | Select Name,Enabled
Get-ADGroupMember "Domain Admins"
6️⃣ Serviços (quem devia estar rodando?)
Get-Service | Sort-Object Status
Get-Service -Name "*Defender*"
Stop-Service -Name "suspeito" -Force
7️⃣ Windows Defender (o fiel escudeiro)
Get-MpComputerStatus
Start-MpScan -ScanType QuickScan
Start-MpScan -ScanType FullScan
Get-MpThreat
8️⃣ Hash de arquivo (IOC check)
Get-FileHash arquivo.exe -Algorithm SHA256
9️⃣ Ler logs sem travar o mundo
Get-Content .\log.txt -Tail 50
Select-String -Path .\log.txt -Pattern "error"
🔟 Persistência (onde malware ama morar)
Get-ItemProperty "HKLM:\...\Run"
Get-ScheduledTask
Get-ScheduledTask | Where-Object {$_.TaskName -like "*update*"}
1️⃣ 1️⃣ Exportar evidências pra CSV
Get-NetTCPConnection | Export-Csv conexoes.csv -NoTypeInformation
Get-LocalUser | Export-Csv usuarios.csv
1️⃣ 2️⃣ Inventário rápido
Get-ComputerInfo
Get-WmiObject Win32_ComputerSystem
Get-WmiObject Win32_LogicalDisk
1️⃣ 3️⃣ DLL hijacking / módulos carregados
DLL é um arquivo com funções usadas pelos programas do Windows, e DLL Hijacking acontece quando o app carrega uma DLL falsa colocada pelo atacante, fazendo o malware rodar disfarçado dentro do processo legítimo:
(Get-Process notepad).Modules
Comentários
Postar um comentário