powershell
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| powershell [2022/11/10 18:44] – [Simple TCP Portscan] baumi | powershell [2022/11/20 10:19] (current) – [Convert to PCAP] baumi | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| Test-NetConnection -ComputerName $target -Port $port | Test-NetConnection -ComputerName $target -Port $port | ||
| } | } | ||
| + | </ | ||
| + | ===== Packet Capture ===== | ||
| + | ==== Capture ==== | ||
| + | <code powershell> | ||
| + | $duration=90 | ||
| + | $env:HostIP = ( | ||
| + | Get-NetIPConfiguration | | ||
| + | Where-Object { | ||
| + | $_.IPv4DefaultGateway -ne $null -and | ||
| + | $_.NetAdapter.Status -ne " | ||
| + | } | ||
| + | ).IPv4Address.IPAddress | ||
| + | |||
| + | netsh trace start capture=yes IPv4.Address=$env: | ||
| + | Start-Sleep $duration | ||
| + | netsh trace stop | ||
| + | </ | ||
| + | ==== Convert to PCAP ==== | ||
| + | https:// | ||
| + | <code powershell> | ||
| + | Invoke-Webrequest -O etl2pcapng.exe https:// | ||
| + | ./ | ||
| </ | </ | ||
| ===== Useful Commandlets ===== | ===== Useful Commandlets ===== | ||
powershell.1668102253.txt.gz · Last modified:  by baumi
                
                