fix tcpdump usage

This commit is contained in:
Catalin-Emil Fetoiu 2023-10-20 16:24:53 -07:00
parent f2019b5e0b
commit bf268b1088
1 changed files with 9 additions and 2 deletions

View File

@ -60,7 +60,7 @@ netsh wfp capture start file="$folder/wfpdiag.cab"
$tcpdumpProcess = $null
try
{
$tcpdumpProcess = Start-Process wsl.exe -ArgumentList "-u root /bin/bash -c 'tcpdump -n -i any > $folder/tcpdump.log'" -PassThru
$tcpdumpProcess = Start-Process wsl.exe -ArgumentList "-u root tcpdump -n -i any > $folder/tcpdump.log" -PassThru
}
catch {}
@ -109,9 +109,10 @@ finally
{
try
{
wsl.exe -u root killall tcpdump
if ($tcpdumpProcess -ne $null)
{
Stop-Process -InputObject $tcpdumpProcess
Wait-Process -InputObject $tcpdumpProcess
}
}
catch {}
@ -169,6 +170,12 @@ try
}
catch {}
try
{
Get-NetFirewallRule -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallRule_ActiveStore.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVPort | Out-File -FilePath "$folder/Get-NetFirewallHyperVPort.log" -Append