[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $domains = @( "fundacjaadmar.org.pl", "ichmoc.pl", "opokadlawas.pl", "sakopoka.pl", "szkolasakopoka.pl", "wtzborkowice.pl", "wtzostalowek.pl", "wtzprzysucha.org.pl" ) Write-Host "===============================================================" -ForegroundColor Cyan Write-Host " SPRAWDZENIE BEZPIECZEŃSTWA (WERSJA SKORYGOWANA) " -ForegroundColor Cyan Write-Host "===============================================================" -ForegroundColor Cyan foreach ($domain in $domains) { Write-Host "`n>>> Domena: https://$domain" -ForegroundColor Yellow # 1. TEST: Weryfikacja czystości bufora HTML (czy nie wyciekają notatki) try { $webPage = Invoke-WebRequest -Uri "https://$domain" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop if ($webPage.Content -match "\?author=1") { Write-Host " [!] BŁĄD BUFORA: Na stronie widoczny jest tekst notatki '?author=1'!" -ForegroundColor Red } else { Write-Host " [OK] Bufor HTML: Czysty (brak wycieku kodu na stronie głównej)" -ForegroundColor Green } } catch { Write-Host " [-] Strona główna niedostępna: $($_.Exception.Message)" -ForegroundColor DarkGray } # 2. TEST: Blokada REST API Users (/wp-json/wp/v2/users) try { $rest = Invoke-WebRequest -Uri "https://$domain/wp-json/wp/v2/users" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop if ($rest.Content -match '"slug":') { Write-Host " [!] REST API: Podatne! Zwraca listę autorów" -ForegroundColor Red } else { Write-Host " [OK] REST API: Lista użytkowników ukryta/zablokowana" -ForegroundColor Green } } catch { $status = $_.Exception.Response.StatusCode.value__ Write-Host " [OK] REST API: Zablokowane (kod HTTP: $status)" -ForegroundColor Green } # 3. TEST: Enumeracja autorów przez ?author=1 try { $req = [System.Net.HttpWebRequest]::Create("https://$domain/?author=1") $req.AllowAutoRedirect = $false $req.Timeout = 10000 $res = $req.GetResponse() $loc = $res.Headers["Location"] $res.Close() if ($loc -and $loc -match "/author/") { Write-Host " [!] ENUMERACJA ?author=1: Przekierowuje do $loc" -ForegroundColor Red } else { Write-Host " [OK] ENUMERACJA ?author=1: Zabezpieczona (brak ujawnienia loginu)" -ForegroundColor Green } } catch [System.Net.WebException] { $errRes = $_.Exception.Response if ($errRes) { $loc = $errRes.Headers["Location"] $statusCode = $errRes.StatusCode.value__ $errRes.Close() if ($loc -and $loc -match "/author/") { Write-Host " [!] ENUMERACJA ?author=1: Ujawnia autora w Location: $loc" -ForegroundColor Red } else { Write-Host " [OK] ENUMERACJA ?author=1: Zablokowana (kod HTTP: $statusCode)" -ForegroundColor Green } } } catch { Write-Host " [-] Błąd testu ?author=1: $($_.Exception.Message)" -ForegroundColor DarkGray } # 4. TEST: Weryfikacja formularza komentarzy try { $postParams = @{ comment_post_ID = 1 comment = "test_audit" author = "audit" email = "audit@test.pl" } $cRes = Invoke-WebRequest -Uri "https://$domain/wp-comments-post.php" -Method Post -Body $postParams -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop if ($cRes.Content -match "wyłączone|closed|disabled|nieprawidłowy|Brak") { Write-Host " [OK] KOMENTARZE: Zablokowane w treści odpowiedzi WordPressa" -ForegroundColor Green } else { Write-Host " [?] KOMENTARZE: Zwrócono kod 200 (wymaga weryfikacji)" -ForegroundColor Yellow } } catch { $status = $_.Exception.Response.StatusCode.value__ Write-Host " [OK] KOMENTARZE: Zablokowane na poziomie serwera (kod HTTP: $status)" -ForegroundColor Green } } Write-Host "`n===============================================================" -ForegroundColor Cyan Write-Host " AUDYT ZAKOŃCZONY " -ForegroundColor Cyan Write-Host "===============================================================" -ForegroundColor Cyan https://www.sakopoka.pl/wp-sitemap-posts-page-1.xml