From d5d16ce16b144843cc308ffd1ae9df3c3e0c16bb Mon Sep 17 00:00:00 2001 From: alexfort Date: Thu, 29 Oct 2026 16:45:00 +0100 Subject: [PATCH] Init commit --- ...den_Passworter_im_Browser_gespeischert.ps1 | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Pruefung_werden_Passworter_im_Browser_gespeischert.ps1 diff --git a/Pruefung_werden_Passworter_im_Browser_gespeischert.ps1 b/Pruefung_werden_Passworter_im_Browser_gespeischert.ps1 new file mode 100644 index 0000000..f025364 --- /dev/null +++ b/Pruefung_werden_Passworter_im_Browser_gespeischert.ps1 @@ -0,0 +1,54 @@ +# Speicherpfade für Chromium-basierte Browser (Edge/Chrome) und Firefox +$ChromiumPaths = @( + "AppData\Local\Google\Chrome\User Data\Default\Login Data", + "AppData\Local\Microsoft\Edge\User Data\Default\Login Data" +) +$FirefoxPathPart = "AppData\Roaming\Mozilla\Firefox\Profiles" + +$Report = @() + +# Holt alle lokalen Benutzerprofile auf dem Rechner (außer Systemkonten) +$UserProfiles = Get-CimInstance -ClassName Win32_UserProfile | Where-Object { $_.Special -eq $false -and $_.LocalPath -notlike "*\Windows*" } + +foreach ($Profile in $UserProfiles) { + $UserName = Split-Path $Profile.LocalPath -Leaf + $Path = $Profile.LocalPath + + $HasSavedPasswords = $false + $DetectedBrowsers = @() + + # 1. Prüfe Chrome & Edge (Suchen nach der Datei 'Login Data') + foreach ($RelPath in $ChromiumPaths) { + $FullCheckPath = Join-Path $Path $RelPath + if (Test-Path $FullCheckPath) { + # Da die Datei immer existiert, prüfen wir, ob sie größer als die Standard-Leergröße ist (meist > 24KB) + if ((Get-Item $FullCheckPath).Length -gt 30000) { + $HasSavedPasswords = $true + $BrowserName = if ($RelPath -match "Chrome") { "Google Chrome" } else { "Microsoft Edge" } + $DetectedBrowsers += $BrowserName + } + } + } + + # 2. Prüfe Firefox (Suchen nach 'logins.json') + $FFProfilePath = Join-Path $Path $FirefoxPathPart + if (Test-Path $FFProfilePath) { + $LoginsFile = Get-ChildItem -Path $FFProfilePath -Filter "logins.json" -Recurse -ErrorAction SilentlyContinue + if ($LoginsFile -and $LoginsFile.Length -gt 100) { + $HasSavedPasswords = $true + $DetectedBrowsers += "Mozilla Firefox" + } + } + + # Ergebnis sammeln + if ($HasSavedPasswords) { + $Report += [PSCustomObject]@{ + "Benutzer" = $UserName + "Speichert" = "Ja" + "Browser" = ($DetectedBrowsers -join ", ") + } + } +} + +# Ausgabe des Berichts +$Report | Format-Table -AutoSize