performing-thick-client-application-penetration-test について
デスクトップアプリとバックエンド通信を評価するセキュリティテストスキルです。許可を得たテスター向けに、静的・動的解析、脆弱性確認、結果の記録を案内します。
主な機能
- 01アプリケーションバイナリの静的解析
- 02プロセスとファイル操作の監視
- 03クライアントとサーバー間通信の傍受
- 04認証、DLL、メモリ、入力の脆弱性テスト
- 05API セキュリティの確認と結果記録
活用シーン
- 01デスクトップアプリのセキュリティ評価
- 02認証情報漏えいの疑いの調査
- 03シッククライアント経由の API 認可テスト
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill performing-thick-client-application-penetration-testインストール後、Claude Code で/performing-thick-client-application-penetration-testを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEassets/template.mdreferences/api-reference.mdstandards.mdworkflows.mdscripts/agent.pyprocess.py詳細
シッククライアントアプリケーションの侵入テストの実施
概要
シッククライアント(ファットクライアント)の侵入テストでは、ユーザーのマシン上でローカルに実行され、バックエンドサーバーと通信するデスクトップアプリケーションのセキュリティを評価します。Webアプリケーションとは異なり、シッククライアントでは、ローカルファイルの保存、バイナリ解析、メモリ操作、DLL インジェクション、プロセスの傍受、クライアントとサーバー間の通信など、より広範な攻撃対象領域が存在します。一般的な対象には、銀行アプリケーション、ERP クライアント(SAP GUI)、取引プラットフォーム、医療システム、レガシーなエンタープライズソフトウェアが含まれます。
使用する場面
- シッククライアントアプリケーションの侵入テストを実施するセキュリティ評価を行う場合
- 関連するセキュリティインシデントについて、インシデント対応手順に従う場合
- 定期的なセキュリティテストや監査を実施する場合
- 実地テストを通じてセキュリティ制御を検証する場合
前提条件
- アプリケーションのインストーラーと有効な認証情報
- Windows/Linux テストマシン(隔離環境)
- ツール:dnSpy、Procmon、Process Hacker、Wireshark、Burp Suite、Echo Mirage、Fiddler、IDA Pro/Ghidra
- テストマシンへの管理者アクセス
法的通知: このスキルは、許可を得たセキュリティテストおよび教育目的に限り使用してください。所有していないシステム、またはテストの書面による許可を得ていないシステムに対する無許可の使用は違法であり、コンピューター詐欺に関する法律に違反する可能性があります。
フェーズ 1 — 情報収集
静的解析
# Identify application technology
# Check file properties, signatures, framework (.NET, Java, C++, Electron)
file application.exe
# .NET -> dnSpy, JetBrains dotPeek
# Java -> JD-GUI, JADX
# C/C++ -> Ghidra, IDA Pro
# Electron -> extract asar archive
# Check for .NET framework
Get-ChildItem -Path "C:\Program Files\TargetApp" -Recurse -Filter "*.dll" |
ForEach-Object { [System.Reflection.AssemblyName]::GetAssemblyName($_.FullName).FullName }
# Strings analysis
strings application.exe | findstr -i "password\|secret\|api\|key\|token\|jdbc\|connection"
# Check for hardcoded credentials
strings application.exe | findstr -i "username\|user=\|pass=\|pwd=\|admin"
# Review configuration files
type "C:\Program Files\TargetApp\app.config"
type "C:\Program Files\TargetApp\settings.xml"
type "%APPDATA%\TargetApp\config.json"
# Check for certificate pinning
strings application.exe | findstr -i "cert\|pin\|ssl\|tls"
dnSpy による .NET の逆コンパイル
# Open application in dnSpy
1. Launch dnSpy
2. File > Open > Select application.exe and DLLs
3. Search for:
- "password", "secret", "connectionString"
- Authentication methods
- Encryption/decryption functions
- API endpoints and keys
- License validation logic
# Look for:
- Hardcoded credentials in source
- Insecure encryption (DES, MD5, base64 "encryption")
- SQL queries (potential injection)
- Disabled certificate validation
- Debug/verbose logging with sensitive data
フェーズ 2 — 動的解析
プロセスの監視
# Monitor file system activity with Procmon
# Filters:
# Process Name = application.exe
# Operation = CreateFile, WriteFile, ReadFile, RegSetValue
# Key observations:
# - Where does the app store data? (AppData, temp, registry)
# - Does it write credentials to disk?
# - Does it create temporary files with sensitive data?
# - What registry keys does it access?
# Monitor with Process Hacker
# Check: loaded DLLs, network connections, handles, tokens
# Monitor network traffic
# Wireshark filter: ip.addr == <server_ip>
# Check for: unencrypted credentials, API keys, tokens
通信の傍受
# Intercept HTTP/HTTPS traffic with Burp Suite
# Configure system proxy: 127.0.0.1:8080
# Install Burp CA certificate in Windows certificate store
# For non-HTTP protocols, use Echo Mirage
# Inject into process and intercept TCP/UDP traffic
# For HTTPS with certificate pinning:
# Method 1: Patch certificate validation in dnSpy
# Method 2: Use Frida to hook SSL validation
frida -l bypass_ssl_pinning.js -f application.exe
# Fiddler for .NET applications
# Enable HTTPS decryption
# Monitor API calls, request/response bodies
フェーズ 3 — 脆弱性テスト
認証のバイパス
# Test local authentication bypass
1. Open dnSpy, find authentication method
2. Set breakpoint on credential validation
3. Modify return value to bypass (Debug > Set Next Statement)
4. Or: Patch binary to always return true
# Test for credential storage
# Check: registry, config files, SQLite databases, Windows Credential Manager
reg query "HKCU\Software\TargetApp" /s
type "%APPDATA%\TargetApp\user.db"
# SQLite: sqlite3 user.db ".dump"
DLL ハイジャック
# Identify DLL search order vulnerability
# Use Procmon to find DLLs loaded from writable paths
# Filter: Result = NAME NOT FOUND, Path ends with .dll
# Create malicious DLL
# msfvenom -p windows/exec CMD=calc.exe -f dll -o hijacked.dll
# Place in application directory or writable PATH directory
# DLL sideloading
# If app loads DLL without full path:
# 1. Create DLL with same exports
# 2. Place in app directory
# 3. DLL loads before legitimate version
メモリ解析
# Dump process memory
# Use Process Hacker > Process > Properties > Memory
# Search for plaintext credentials, tokens, session IDs
# Strings from memory dump
strings process_dump.dmp | findstr -i "password\|token\|session\|bearer"
# Modify memory values (license bypass, privilege escalation)
# Use Cheat Engine or x64dbg to:
# 1. Find memory address of authorization variable
# 2. Modify value (e.g., isAdmin = 0 -> isAdmin = 1)
入力検証
# SQL Injection in local database
# Test input fields with: ' OR 1=1--
# If app uses local SQLite/SQL Server Express
# Command injection
# Test fields that interact with OS:
# File paths: ..\..\..\..\windows\system32\cmd.exe
# Print/export: | calc.exe
# Buffer overflow
# Send oversized input to text fields
# Monitor with x64dbg for crashes
# Check for SEH-based or stack-based overflows
フェーズ 4 — API セキュリティテスト
# Capture API calls from thick client
# In Burp Suite, analyze:
# IDOR (Insecure Direct Object Reference)
# Change user IDs in requests to access other users' data
# GET /api/users/1001 -> GET /api/users/1002
# Authorization bypass
# Remove or modify JWT tokens
# Test role escalation: change role claim from "user" to "admin"
# Mass assignment
# Add additional parameters to API requests
# POST /api/profile {"name": "test", "isAdmin": true}
# Rate limiting
# Test for brute-force protection on login API
# Test for account lockout bypass
検出事項のテンプレート
| 検出事項 | 深刻度 | CVSS | 対策 |
|---|---|---|---|
| バイナリ内にハードコードされたデータベース認証情報 | 重大 | 9.1 | 安全な認証情報ストレージ(DPAPI、Vault)を使用する |
| 書き込み可能なアプリケーションディレクトリを介した DLL ハイジャック | 高 | 7.8 | DLL のフルパスを使用し、DLL の署名を検証する |
| メモリ内に平文で保存された認証情報 | 高 | 7.5 | 使用後にメモリをゼロ化し、SecureString を使用する |
| 証明書のピン留めがない | 中 | 6.5 | 証明書のピン留めを実装する |
| パスワードが平文で保存されたローカル SQLite データベース | 重大 | 9.0 | bcrypt/Argon2 のハッシュ化を使用する |
| コード内で SSL 検証が無効化されている | 高 | 8.1 | 適切な証明書検証を有効にする |
参考資料
- dnSpy:https://github.com/dnSpy/dnSpy
- Procmon:https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
- OWASP Thick Client Testing Guide:https://owasp.org/www-project-thick-client-top-10/
- Ghidra:https://ghidra-sre.org/
- Echo Mirage:https://sourceforge.net/projects/echomirage/
コメント
Markdown 対応