Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
start [2025/12/08 20:09] jango |
start [2026/02/19 22:31] (aktuell) jango |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| < | < | ||
| - | mkdir mini && cd mini | + | param( |
| + | [string]$Url = " | ||
| + | [string]$Username = " | ||
| + | [string]$Password = " | ||
| + | [switch]$IgnoreCertErrors | ||
| + | ) | ||
| - | lb config \ | + | [Net.ServicePointManager]:: |
| - | | + | if ($IgnoreCertErrors) { [System.Net.ServicePointManager]:: |
| - | | + | |
| - | --debian-installer-gui false \ | + | function New-BasicAuthValue([string]$User, |
| - | --apt-indices false \ | + | |
| - | | + | "Basic " + [Convert]:: |
| - | --debootstrap-options | + | } |
| - | | + | |
| - | --memtest none \ | + | $req = [System.Net.HttpWebRequest]:: |
| - | --chroot-squashfs-compression-type xz \ | + | $req.Method = "GET" |
| - | --chroot-squashfs-compression-level 9 | + | $req.AllowAutoRedirect = $false |
| - | echo "user-setup sudo" | + | $req.Headers.Add(" |
| - | echo "ifupdown isc-dhcp-client" | + | $req.UserAgent = "OWA-BasicTest/ |
| - | sudo lb build | + | |
| + | try { $resp = $req.GetResponse() } | ||
| + | catch [System.Net.WebException] { $resp = $_.Exception.Response } | ||
| + | |||
| + | if ($resp) { | ||
| + | | ||
| + | | ||
| + | "WWW-Authenticate: | ||
| + | $resp.Close() | ||
| + | } | ||
| </ | </ | ||
| + | < | ||
| + | param( | ||
| + | [string]$Url = " | ||
| + | [switch]$IgnoreCertErrors | ||
| + | ) | ||
| + | |||
| + | [Net.ServicePointManager]:: | ||
| + | if ($IgnoreCertErrors) { [System.Net.ServicePointManager]:: | ||
| + | |||
| + | $req = [System.Net.HttpWebRequest]:: | ||
| + | $req.Method = " | ||
| + | $req.AllowAutoRedirect = $false | ||
| + | |||
| + | try { | ||
| + | $resp = $req.GetResponse() | ||
| + | } catch [System.Net.WebException] { | ||
| + | $resp = $_.Exception.Response | ||
| + | } | ||
| + | |||
| + | if ($resp) { | ||
| + | "HTTP: {0}" -f ([int]$resp.StatusCode) | ||
| + | " | ||
| + | $resp.Headers.GetValues(" | ||
| + | $resp.Close() | ||
| + | } else { | ||
| + | "No response (TLS/ | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | PS C: | ||
| + | Target: https:// | ||
| + | User: | ||
| + | Count: | ||
| + | |||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | [13: | ||
| + | |||
| + | PS C: | ||
| + | </ | ||
| Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, | Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, | ||
| Zeile 30: | Zeile 102: | ||
| + | |||
| + | <code powershell> | ||
| + | <# | ||
| + | PowerShell 5.1 – EAS Basic-Auth Test (sendet IMMER weiter, auch bei 429) | ||
| + | |||
| + | Optional: | ||
| + | - -IgnoreCertErrors (nur Test!) | ||
| + | - -LogHeaders um X-EAS-FAIL / X-Blocked-By etc. zu sehen, falls du die in HAProxy setzt. | ||
| + | #> | ||
| + | |||
| + | param( | ||
| + | [string]$Url = " | ||
| + | [string]$Username = " | ||
| + | [string]$Password = " | ||
| + | [int]$Count = 20, | ||
| + | [int]$DelayMs = 100, | ||
| + | [int]$TimeoutSec = 10, | ||
| + | [switch]$IgnoreCertErrors, | ||
| + | [switch]$LogHeaders | ||
| + | ) | ||
| + | |||
| + | # TLS 1.2 erzwingen | ||
| + | [Net.ServicePointManager]:: | ||
| + | |||
| + | # Optional: Zertifikatsfehler ignorieren (nur Tests) | ||
| + | if ($IgnoreCertErrors) { | ||
| + | [System.Net.ServicePointManager]:: | ||
| + | } | ||
| + | |||
| + | function New-BasicAuthValue { | ||
| + | param([string]$User, | ||
| + | $pair = " | ||
| + | $b64 = [Convert]:: | ||
| + | return "Basic $b64" | ||
| + | } | ||
| + | |||
| + | $auth = New-BasicAuthValue -User $Username -Pass $Password | ||
| + | |||
| + | Write-Host (" | ||
| + | Write-Host (" | ||
| + | Write-Host (" | ||
| + | Write-Host "" | ||
| + | |||
| + | for ($i=1; $i -le $Count; $i++) { | ||
| + | $sw = [Diagnostics.Stopwatch]:: | ||
| + | $code = -1 | ||
| + | $err = $null | ||
| + | $h = @{} | ||
| + | |||
| + | try { | ||
| + | $req = [System.Net.HttpWebRequest]:: | ||
| + | $req.Method = " | ||
| + | $req.AllowAutoRedirect = $false | ||
| + | $req.Timeout = $TimeoutSec * 1000 | ||
| + | $req.ReadWriteTimeout = $TimeoutSec * 1000 | ||
| + | $req.UserAgent = " | ||
| + | $req.Headers.Add(" | ||
| + | $req.Headers.Add(" | ||
| + | |||
| + | $resp = $req.GetResponse() | ||
| + | $code = [int]$resp.StatusCode | ||
| + | if ($LogHeaders) { | ||
| + | foreach ($k in $resp.Headers.AllKeys) { $h[$k] = $resp.Headers[$k] } | ||
| + | } | ||
| + | $resp.Close() | ||
| + | } | ||
| + | catch [System.Net.WebException] { | ||
| + | if ($_.Exception.Response) { | ||
| + | $resp = $_.Exception.Response | ||
| + | $code = [int]$resp.StatusCode | ||
| + | if ($LogHeaders) { | ||
| + | foreach ($k in $resp.Headers.AllKeys) { $h[$k] = $resp.Headers[$k] } | ||
| + | } | ||
| + | $resp.Close() | ||
| + | } else { | ||
| + | $err = $_.Exception.Message | ||
| + | } | ||
| + | } | ||
| + | catch { | ||
| + | $err = $_.Exception.Message | ||
| + | } | ||
| + | |||
| + | $sw.Stop() | ||
| + | $ts = (Get-Date).ToString(" | ||
| + | |||
| + | if ($code -eq -1) { | ||
| + | Write-Host (" | ||
| + | } else { | ||
| + | if ($LogHeaders) { | ||
| + | $xFail = $h[" | ||
| + | $xBlk = $h[" | ||
| + | $extra = @() | ||
| + | if ($xFail) { $extra += (" | ||
| + | if ($xBlk) | ||
| + | $suffix = "" | ||
| + | if ($extra.Count -gt 0) { $suffix = " | ||
| + | Write-Host (" | ||
| + | } else { | ||
| + | Write-Host (" | ||
| + | } | ||
| + | } | ||
| + | |||
| + | # WICHTIG: NICHT abbrechen bei 429 – weiter senden | ||
| + | Start-Sleep -Milliseconds $DelayMs | ||
| + | } | ||
| + | </ | ||