Files
scripts/sergey-ssh-diag.ps1

12 lines
2.2 KiB
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# sergey-ssh-diag.ps1 — почему не доходит SSH по служебной сети (kit H225). Запуск: irm https://git.dttb.ru/oleg/scripts/raw/branch/main/sergey-ssh-diag.ps1 | iex
Write-Host "== sshd ==" -ForegroundColor Cyan; Get-Service sshd,WinRM -EA SilentlyContinue | Format-Table Name,Status,StartType -AutoSize | Out-String | Write-Host
Write-Host "== слушает 22/5985 ==" -ForegroundColor Cyan; Get-NetTCPConnection -State Listen -EA SilentlyContinue | Where-Object { $_.LocalPort -in 22,5985 } | Format-Table LocalAddress,LocalPort,OwningProcess -AutoSize | Out-String | Write-Host
Write-Host "== firewall-правила kit/ssh ==" -ForegroundColor Cyan; Get-NetFirewallRule -EA SilentlyContinue | Where-Object { $_.DisplayName -match 'kit|ssh|OpenSSH|WinRM' } | Format-Table DisplayName,Enabled,Direction,Action,Profile -AutoSize | Out-String | Write-Host
Write-Host "== NetBird ==" -ForegroundColor Cyan; & "C:\Program Files\Netbird\netbird.exe" status 2>&1 | Select-String 'NetBird IP|Management|Signal|Peers' | Out-String | Write-Host
Write-Host "== Amnezia ==" -ForegroundColor Cyan; Get-Process -EA SilentlyContinue | Where-Object { $_.Name -match 'Amnezia' } | Format-Table Name,Id -AutoSize | Out-String | Write-Host
Get-Service -EA SilentlyContinue | Where-Object { $_.DisplayName -match 'Amnezia' } | Format-Table Name,Status -AutoSize | Out-String | Write-Host
Get-NetAdapter -EA SilentlyContinue | Where-Object { $_.InterfaceDescription -match 'Amnezia|WireGuard|wintun|netbird' } | Format-Table Name,InterfaceDescription,Status -AutoSize | Out-String | Write-Host
Write-Host "== WFP-фильтры Amnezia (kill switch) ==" -ForegroundColor Cyan; $wfp = netsh wfp show filters file=- 2>$null | Select-String -Pattern 'Amnezia' | Select-Object -First 5; if($wfp){ Write-Host " ЕСТЬ фильтры Amnezia в WFP -> kill switch активен" -ForegroundColor Yellow } else { Write-Host " фильтров Amnezia нет" }
Write-Host "== до Мака 100.70.37.64 ==" -ForegroundColor Cyan; ping -n 2 100.70.37.64 | Select-String 'TTL|время|timed|Превышен' | Out-String | Write-Host
Write-Host "Готово. Скриншот этого окна -> Олегу." -ForegroundColor Green