# =================================== # ウイルス風演出スクリプト(テスト環境用) # =================================== # 新しいウィンドウを開く関数 function Start-ChaosWindow { param([int]$id) $windowScript = @' $host.UI.RawUI.WindowTitle = "警告 - システムプロセス {0}" $colors = @("Red", "Green", "Yellow", "Cyan", "Magenta", "White") while ($true) { try { $randomColor = $colors | Get-Random Clear-Host $host.UI.RawUI.BackgroundColor = "Black" $host.UI.RawUI.ForegroundColor = $randomColor Clear-Host Write-Host "┌────────────────────────────────────┐" -ForegroundColor $randomColor Write-Host "│ 警告: 不審なプロセス検出 #{0} │" -ForegroundColor $randomColor Write-Host "└────────────────────────────────────┘" -ForegroundColor $randomColor Write-Host "" # ランダムなファイルパスを表示 $drives = @("C:", "D:", "E:") $folders = @("Windows", "System32", "Program Files", "Users", "AppData") 1..20 | ForEach-Object { $fakePath = "{0}\{1}\{2}.exe" -f ($drives | Get-Random), ($folders | Get-Random), (-join ((65..90) | Get-Random -Count 8 | ForEach-Object {[char]$_})) Write-Host ">> $fakePath" -ForegroundColor $randomColor Start-Sleep -Milliseconds 100 } Write-Host "" Write-Host "データ送信中..." -ForegroundColor Yellow # ランダムな16進数を表示 1..10 | ForEach-Object { $hex = -join ((0..255) | Get-Random -Count 16 | ForEach-Object { "{0:X2}" -f $_ }) Write-Host "0x$hex" -ForegroundColor $randomColor } Start-Sleep -Seconds (Get-Random -Minimum 2 -Maximum 5) } catch { Start-Sleep -Seconds 1 } } '@ -f $id, $id Start-Process powershell.exe -ArgumentList "-NoExit", "-Command", $windowScript -WindowStyle Normal } # メイン処理 Write-Host "==========================================" -ForegroundColor Cyan Write-Host " ウイルス風演出スクリプト 起動中..." -ForegroundColor Cyan Write-Host "==========================================" -ForegroundColor Cyan Write-Host "" Write-Host "注意: これはテスト用の演出です" -ForegroundColor Yellow Write-Host "停止するには全ウィンドウで Ctrl+C を押してください" -ForegroundColor Yellow Write-Host "" Write-Host "3秒後に開始します..." -ForegroundColor Green Start-Sleep -Seconds 3 $windowCounter = 0 $maxWindows = 5 $openWindows = @() # メインループ while ($true) { try { # 背景色をランダムに変更 $bgColors = @("Black", "DarkBlue", "DarkRed", "DarkGreen") $host.UI.RawUI.BackgroundColor = $bgColors | Get-Random $textColors = @("Red", "Green", "Yellow", "Cyan", "Magenta", "White") $currentColor = $textColors | Get-Random Clear-Host # ASCIIアート風の警告表示 Write-Host "" Write-Host " ██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ " -ForegroundColor $currentColor Write-Host " ██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ " -ForegroundColor $currentColor Write-Host " ██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗" -ForegroundColor $currentColor Write-Host " ██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║" -ForegroundColor $currentColor Write-Host " ╚███╔═██║██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝" -ForegroundColor $currentColor Write-Host " ╚══╝╚══╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ " -ForegroundColor $currentColor Write-Host "" Write-Host " =============================================" -ForegroundColor Red Write-Host " システムが侵害されました!" -ForegroundColor Red Write-Host " =============================================" -ForegroundColor Red Write-Host "" Write-Host " [!] アクティブな不正プロセス: $windowCounter" -ForegroundColor Yellow Write-Host " [!] データ流出中..." -ForegroundColor Yellow Write-Host "" # ディレクトリのループ表示 Write-Host " スキャン中のファイル:" -ForegroundColor Cyan Write-Host " " + ("-" * 50) -ForegroundColor Cyan # C:\のファイルを表示(エラーは無視) Get-ChildItem -Path "C:\" -Force -ErrorAction SilentlyContinue | Select-Object -First 15 | ForEach-Object { Write-Host " >> $($_.FullName)" -ForegroundColor $currentColor } Write-Host "" Write-Host " 暗号化進行中..." -ForegroundColor Red # プログレスバー表示 1..100 | ForEach-Object { Write-Progress -Activity "ファイル暗号化" -Status "$_ % 完了" -PercentComplete $_ Start-Sleep -Milliseconds 20 } # ランダムに新しいウィンドウを開く $randomChance = Get-Random -Minimum 1 -Maximum 10 if ($randomChance -gt 6 -and $windowCounter -lt $maxWindows) { $windowCounter++ Write-Host "" Write-Host " [!!!] 新しい不正プロセスが起動しました! [ID: $windowCounter]" -ForegroundColor Red -BackgroundColor Yellow Start-Sleep -Milliseconds 500 Start-ChaosWindow -id $windowCounter Start-Sleep -Milliseconds 500 } # ランダムでウィンドウを閉じる(開いているウィンドウが2つ以上ある場合) if ($windowCounter -gt 1) { $closeChance = Get-Random -Minimum 1 -Maximum 10 if ($closeChance -gt 8) { Write-Host "" Write-Host " [!] プロセスが終了しました" -ForegroundColor Green $windowCounter-- Start-Sleep -Milliseconds 500 } } Write-Host "" Write-Host " 次の更新まで..." -ForegroundColor DarkGray Start-Sleep -Seconds 2 } catch { # エラーが発生しても続行 Start-Sleep -Seconds 1 } }