mobile-forensics について
mobile-forensics は、iOS と Android のバックアップや端末抽出データを調べるフォレンジック向けスキルです。調査担当者が通信、アプリデータ、位置情報、メディアなどを分析し、タイムライン作成や削除データの復元を試みられます。
主な機能
- 01iOSバックアップとファイルシステムイメージの解析
- 02Androidバックアップと抽出データの解析
- 03通信記録とアプリデータの分析
- 04位置情報、連絡先、ブラウザー痕跡の抽出
- 05メディアとメタデータの整理
- 06タイムライン作成と削除データの復元
活用シーン
- 01端末バックアップ内のメッセージや通話履歴の確認
- 02調査でのアプリデータベースとキャッシュの分析
- 03位置情報と通信のタイムライン再構成
- 04メディアメタデータの確認と削除データ復元の試行
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ sherifeldeeb/ agentskills --skill mobile-forensicsインストール後、Claude Code で/mobile-forensicsを入力して読み込まれたか確認します。
詳細
モバイルフォレンジック
iOS および Android デバイスのデータを分析するための、包括的なモバイルフォレンジックのスキルです。モバイルデバイスのバックアップや抽出データから、通信、アプリデータ、位置情報履歴、メディアファイル、システムアーティファクトを抽出して分析できます。
機能
- iOS 分析:iTunes/Finder のバックアップ、ファイルシステムイメージを解析します
- Android 分析:ADB バックアップ、ファイルシステムの抽出データを解析します
- 通信分析:SMS、MMS、通話、メッセージングアプリからデータを抽出します
- アプリデータ分析:アプリケーションのデータベースとキャッシュを解析します
- 位置情報分析:GPS データ、位置情報履歴、ジオフェンスを抽出します
- メディア分析:写真や動画をメタデータとともにカタログ化します
- 連絡先分析:すべてのソースから連絡先を抽出します
- ブラウザー履歴:モバイルブラウザーのアーティファクトを分析します
- クラウドデータ:同期されたクラウドサービスのデータを分析します
- タイムライン生成:デバイスのアクティビティタイムラインを作成します
クイックスタート
from mobile_forensics import MobileAnalyzer, iOSParser, AndroidParser
# Analyze iOS backup
ios = iOSParser("/evidence/ios_backup/")
messages = ios.get_messages()
calls = ios.get_call_history()
# Analyze Android extraction
android = AndroidParser("/evidence/android_extraction/")
contacts = android.get_contacts()
使用方法
タスク 1:iOS バックアップ分析
入力:iTunes/Finder のバックアップディレクトリ
処理:
- バックアップを読み込み、(暗号化されている場合は)復号します
- Manifest データベースを解析します
- データを抽出して分析します
- アプリケーションデータを解析します
- デバイスレポートを生成します
出力:iOS バックアップの包括的な分析
例:
from mobile_forensics import iOSParser
# Initialize parser
parser = iOSParser("/evidence/ios_backup/")
# Get backup info
info = parser.get_backup_info()
print(f"Device: {info.device_name}")
print(f"iOS Version: {info.ios_version}")
print(f"Serial: {info.serial_number}")
print(f"IMEI: {info.imei}")
print(f"Backup Date: {info.backup_date}")
print(f"Encrypted: {info.is_encrypted}")
# Decrypt if needed
if info.is_encrypted:
parser.decrypt(password="backup_password")
# Get messages (SMS/iMessage)
messages = parser.get_messages()
for msg in messages:
print(f"[{msg.date}] {msg.sender} -> {msg.recipient}")
print(f" Text: {msg.text}")
print(f" Type: {msg.message_type}")
print(f" Delivered: {msg.is_delivered}")
print(f" Read: {msg.is_read}")
# Get call history
calls = parser.get_call_history()
for call in calls:
print(f"[{call.date}] {call.call_type}: {call.phone_number}")
print(f" Duration: {call.duration}s")
print(f" Location: {call.location}")
# Get contacts
contacts = parser.get_contacts()
for contact in contacts:
print(f"Contact: {contact.name}")
print(f" Phone: {contact.phone_numbers}")
print(f" Email: {contact.emails}")
# Get Safari history
safari = parser.get_safari_history()
for entry in safari:
print(f"[{entry.visit_date}] {entry.title}")
print(f" URL: {entry.url}")
# Get photos
photos = parser.get_photos()
for photo in photos:
print(f"Photo: {photo.filename}")
print(f" Date: {photo.date_taken}")
print(f" Location: {photo.gps_location}")
print(f" Camera: {photo.camera_info}")
# Get location history
locations = parser.get_location_history()
for loc in locations:
print(f"[{loc.timestamp}] {loc.latitude}, {loc.longitude}")
print(f" Accuracy: {loc.accuracy}m")
print(f" Source: {loc.source}")
# Export all data
parser.export_all("/evidence/ios_export/")
parser.generate_report("/evidence/ios_report.html")
タスク 2:Android 分析
入力:Android のバックアップまたは抽出データ
処理:
- Android データを読み込みます
- データベースを解析します
- 通信データを抽出します
- アプリケーションを分析します
- レポートを生成します
出力:Android デバイスの分析
例:
from mobile_forensics import AndroidParser
# Initialize parser
parser = AndroidParser("/evidence/android_extraction/")
# Get device info
info = parser.get_device_info()
print(f"Device: {info.manufacturer} {info.model}")
print(f"Android: {info.android_version}")
print(f"Build: {info.build_number}")
print(f"Serial: {info.serial_number}")
print(f"IMEI: {info.imei}")
# Get SMS messages
sms = parser.get_sms()
for msg in sms:
print(f"[{msg.date}] {msg.direction}: {msg.address}")
print(f" Body: {msg.body}")
print(f" Read: {msg.read}")
# Get call logs
calls = parser.get_call_logs()
for call in calls:
print(f"[{call.date}] {call.type}: {call.number}")
print(f" Duration: {call.duration}s")
print(f" Name: {call.cached_name}")
# Get contacts
contacts = parser.get_contacts()
for contact in contacts:
print(f"Contact: {contact.display_name}")
print(f" Numbers: {contact.phone_numbers}")
print(f" Account: {contact.account_type}")
# Get Chrome history
chrome = parser.get_chrome_history()
for entry in chrome:
print(f"[{entry.visit_time}] {entry.title}")
print(f" URL: {entry.url}")
# Get WiFi networks
wifi = parser.get_wifi_networks()
for network in wifi:
print(f"SSID: {network.ssid}")
print(f" Security: {network.security}")
print(f" First connected: {network.first_connected}")
# Get installed apps
apps = parser.get_installed_apps()
for app in apps:
print(f"App: {app.name}")
print(f" Package: {app.package_name}")
print(f" Version: {app.version}")
print(f" Installed: {app.install_date}")
# Get location data
locations = parser.get_locations()
# Export and report
parser.export_all("/evidence/android_export/")
parser.generate_report("/evidence/android_report.html")
タスク 3:メッセージングアプリ分析
入力:モバイルデバイスのデータ
処理:
- インストール済みのメッセージングアプリを特定します
- アプリのデータベースを探します
- メッセージの内容を解析します
- メディアと添付ファイルを抽出します
- 会話のタイムラインを作成します
出力:メッセージングアプリの分析
例:
from mobile_forensics import MessagingAnalyzer
# Initialize analyzer
analyzer = MessagingAnalyzer("/evidence/device_extraction/")
# Detect available messaging apps
apps = analyzer.detect_messaging_apps()
for app in apps:
print(f"Found: {app.name}")
print(f" Data available: {app.has_data}")
# Parse WhatsApp
whatsapp = analyzer.parse_whatsapp()
print(f"WhatsApp messages: {len(whatsapp.messages)}")
print(f"WhatsApp contacts: {len(whatsapp.contacts)}")
print(f"WhatsApp groups: {len(whatsapp.groups)}")
for chat in whatsapp.chats:
print(f"Chat with: {chat.contact_name}")
print(f" Messages: {chat.message_count}")
print(f" Last message: {chat.last_message_date}")
for msg in chat.messages[-5:]: # Last 5 messages
print(f" [{msg.timestamp}] {msg.sender}: {msg.content}")
# Parse Telegram
telegram = analyzer.parse_telegram()
for chat in telegram.chats:
print(f"Telegram: {chat.title}")
print(f" Type: {chat.chat_type}")
print(f" Messages: {chat.message_count}")
# Parse Signal
signal = analyzer.parse_signal()
for conversation in signal.conversations:
print(f"Signal: {conversation.recipient}")
print(f" Messages: {conversation.message_count}")
# Parse Facebook Messenger
messenger = analyzer.parse_messenger()
# Parse Instagram DMs
instagram = analyzer.parse_instagram()
# Export media
analyzer.export_media("/evidence/messaging_media/")
# Generate unified timeline
timeline = analyzer.create_timeline()
for event in timeline:
print(f"[{event.timestamp}] {event.app}: {event.summary}")
# Generate report
analyzer.generate_report("/evidence/messaging_report.html")
タスク 4:位置情報分析
入力:モバイルデバイスのデータ
処理:
- 写真から GPS データを抽出します
- 位置情報データベースを解析します
- 位置情報履歴を分析します
- 重要な場所を特定します
- 位置情報タイムラインを作成します
出力:地図付きの位置情報分析
例:
from mobile_forensics import LocationAnalyzer
# Initialize analyzer
analyzer = LocationAnalyzer("/evidence/device_extraction/")
# Get all location data
locations = analyzer.get_all_locations()
print(f"Total location points: {len(locations)}")
for loc in locations[:10]:
print(f"[{loc.timestamp}] {loc.latitude}, {loc.longitude}")
print(f" Source: {loc.source}") # GPS, WiFi, Cell, Photo
print(f" Accuracy: {loc.accuracy}m")
print(f" Address: {loc.reverse_geocode}")
# Get significant locations (iOS)
significant = analyzer.get_significant_locations()
for loc in significant:
print(f"Significant: {loc.label}")
print(f" Visits: {loc.visit_count}")
print(f" Average duration: {loc.avg_duration}")
# Get location history from Google
google_history = analyzer.get_google_location_history()
# Get photo locations
photo_locations = analyzer.get_photo_locations()
for photo in photo_locations:
print(f"Photo: {photo.filename}")
print(f" Location: {photo.latitude}, {photo.longitude}")
print(f" Time: {photo.timestamp}")
# Find locations at specific time
time_locations = analyzer.get_locations_at_time(
start="2024-01-15 09:00",
end="2024-01-15 18:00"
)
# Find visits to location
visits = analyzer.find_visits_to_location(
latitude=40.7128,
longitude=-74.0060,
radius_meters=100
)
# Create KML export
analyzer.export_kml("/evidence/locations.kml")
# Create timeline map
analyzer.create_map("/evidence/location_map.html")
# Generate location report
analyzer.generate_report("/evidence/location_report.html")
タスク 5:アプリケーションデータ分析
入力:モバイルデバイスの抽出データ
処理:
- インストール済みアプリケーションの一覧を作成します
- アプリのデータディレクトリを探します
- アプリのデータベースを解析します
- キャッシュデータを抽出します
- ユーザーのアクティビティを分析します
出力:アプリケーション分析レポート
例:
from mobile_forensics import AppAnalyzer
# Initialize analyzer
analyzer = AppAnalyzer("/evidence/device_extraction/")
# Get installed apps
apps = analyzer.get_installed_apps()
for app in apps:
print(f"App: {app.name}")
print(f" Package: {app.package_name}")
print(f" Version: {app.version}")
print(f" Install date: {app.install_date}")
print(f" Last used: {app.last_used}")
print(f" Data size: {app.data_size_mb}MB")
# Analyze specific app
app_data = analyzer.analyze_app("com.example.app")
print(f"Databases: {app_data.databases}")
print(f"Shared prefs: {app_data.shared_preferences}")
print(f"Cache files: {app_data.cache_files}")
# Parse SQLite databases in app
for db in app_data.databases:
tables = analyzer.get_db_tables(db)
print(f"Database: {db.name}")
for table in tables:
print(f" Table: {table.name} ({table.row_count} rows)")
# Get app permissions
permissions = analyzer.get_app_permissions("com.example.app")
for perm in permissions:
print(f"Permission: {perm.name}")
print(f" Granted: {perm.granted}")
print(f" Dangerous: {perm.is_dangerous}")
# Find apps with sensitive permissions
sensitive_apps = analyzer.find_apps_with_permissions([
"READ_CONTACTS",
"READ_SMS",
"ACCESS_FINE_LOCATION",
"CAMERA"
])
# Export app data
analyzer.export_app_data("com.example.app", "/evidence/app_export/")
# Generate app inventory report
analyzer.generate_report("/evidence/app_report.html")
タスク 6:通信タイムライン
入力:モバイルデバイスのデータ
処理:
- すべての種類の通信データを抽出します
- タイムスタンプを解析します
- 統合タイムラインを作成します
- パターンを特定します
- 異常を検出します
出力:統合通信タイムライン
例:
from mobile_forensics import CommunicationsTimeline
# Initialize timeline
timeline = CommunicationsTimeline("/evidence/device_extraction/")
# Add all sources
timeline.add_sms()
timeline.add_calls()
timeline.add_imessage()
timeline.add_whatsapp()
timeline.add_telegram()
timeline.add_messenger()
timeline.add_email()
# Build unified timeline
events = timeline.build()
for event in events:
print(f"[{event.timestamp}] {event.type} - {event.app}")
print(f" From: {event.sender}")
print(f" To: {event.recipient}")
print(f" Summary: {event.summary}")
# Filter by contact
contact_timeline = timeline.filter_by_contact("+1234567890")
print(f"Communications with contact: {len(contact_timeline)}")
# Filter by date range
date_timeline = timeline.filter_by_date(
start="2024-01-01",
end="2024-01-31"
)
# Get communication patterns
patterns = timeline.analyze_patterns()
print(f"Most contacted: {patterns.top_contacts}")
print(f"Peak hours: {patterns.peak_hours}")
print(f"App usage: {patterns.app_distribution}")
# Detect anomalies
anomalies = timeline.detect_anomalies()
for a in anomalies:
print(f"ANOMALY: {a.description}")
print(f" Time: {a.timestamp}")
print(f" Significance: {a.significance}")
# Export timeline
timeline.export_csv("/evidence/communications_timeline.csv")
timeline.generate_report("/evidence/communications_report.html")
タスク 7:メディア分析
入力:モバイルデバイスの写真と動画
処理:
- すべてのメディアファイルを抽出します
- EXIF メタデータを解析します
- GPS 座標を抽出します
- 顔や物体を特定します
- メディアタイムラインを作成します
出力:メタデータ付きのメディア分析
例:
from mobile_forensics import MediaAnalyzer
# Initialize analyzer
analyzer = MediaAnalyzer("/evidence/device_extraction/")
# Get all media
media = analyzer.get_all_media()
print(f"Total photos: {media.photo_count}")
print(f"Total videos: {media.video_count}")
print(f"Total size: {media.total_size_gb}GB")
# Analyze photos
photos = analyzer.get_photos()
for photo in photos:
print(f"Photo: {photo.filename}")
print(f" Date taken: {photo.date_taken}")
print(f" Camera: {photo.camera_make} {photo.camera_model}")
print(f" Location: {photo.latitude}, {photo.longitude}")
print(f" Size: {photo.width}x{photo.height}")
# Analyze videos
videos = analyzer.get_videos()
for video in videos:
print(f"Video: {video.filename}")
print(f" Duration: {video.duration}s")
print(f" Date: {video.date_created}")
print(f" Location: {video.latitude}, {video.longitude}")
# Get media with locations
geotagged = analyzer.get_geotagged_media()
print(f"Media with GPS: {len(geotagged)}")
# Find media in date range
dated = analyzer.find_by_date(
start="2024-01-01",
end="2024-01-31"
)
# Find media by location
location_media = analyzer.find_by_location(
latitude=40.7128,
longitude=-74.0060,
radius_km=1
)
# Export with metadata
analyzer.export_media("/evidence/media_export/")
analyzer.export_metadata("/evidence/media_metadata.csv")
# Generate media report
analyzer.generate_report("/evidence/media_report.html")
タスク 8:クラウドデータ分析
入力:モバイルデバイスのクラウド同期データ
処理:
- 同期されたサービスを特定します
- クラウドトークンを抽出します
- 同期データを分析します
- クラウドアカウントを特定します
- クラウド上のアクティビティを記録します
出力:クラウドサービスの分析
例:
from mobile_forensics import CloudAnalyzer
# Initialize analyzer
analyzer = CloudAnalyzer("/evidence/device_extraction/")
# Detect cloud services
services = analyzer.detect_cloud_services()
for service in services:
print(f"Cloud service: {service.name}")
print(f" Account: {service.account}")
print(f" Data available: {service.has_data}")
# Analyze iCloud data
icloud = analyzer.analyze_icloud()
print(f"iCloud account: {icloud.account_email}")
print(f"iCloud Drive files: {len(icloud.drive_files)}")
print(f"iCloud Photos: {icloud.photo_count}")
print(f"Synced contacts: {icloud.contact_count}")
# Analyze Google account data
google = analyzer.analyze_google()
print(f"Google account: {google.account_email}")
print(f"Drive files: {len(google.drive_files)}")
print(f"Photos: {google.photo_count}")
# Get cloud tokens (for authorized access)
tokens = analyzer.extract_cloud_tokens()
for token in tokens:
print(f"Token for: {token.service}")
print(f" Type: {token.token_type}")
print(f" Expires: {token.expiry}")
# Analyze cloud backup data
backups = analyzer.get_cloud_backups()
for backup in backups:
print(f"Backup: {backup.service}")
print(f" Date: {backup.backup_date}")
print(f" Size: {backup.size_mb}MB")
# Generate cloud report
analyzer.generate_report("/evidence/cloud_report.html")
タスク 9:削除データの復元
入力:モバイルデバイスのファイルシステム
処理:
- 空き領域を分析します
- 削除されたファイルを復元します
- 削除されたデータベースレコードを解析します
- 削除されたメッセージを再構築します
- 復元結果を記録します
出力:復元された削除データ
例:
from mobile_forensics import DeletedDataRecovery
# Initialize recovery
recovery = DeletedDataRecovery("/evidence/device_extraction/")
# Recover deleted SQLite records
messages = recovery.recover_deleted_messages()
for msg in messages:
print(f"RECOVERED: [{msg.date}] {msg.sender}")
print(f" Content: {msg.content}")
print(f" Recovery confidence: {msg.confidence}")
# Recover deleted photos
photos = recovery.recover_deleted_photos(
output_dir="/evidence/recovered_photos/"
)
for photo in photos:
print(f"Recovered: {photo.filename}")
print(f" Original path: {photo.original_path}")
print(f" Confidence: {photo.confidence}")
# Recover deleted contacts
contacts = recovery.recover_deleted_contacts()
# Recover deleted call logs
calls = recovery.recover_deleted_calls()
# Recover from WhatsApp
whatsapp = recovery.recover_deleted_whatsapp()
# Analyze SQLite WAL files
wal_data = recovery.analyze_wal_files()
for entry in wal_data:
print(f"WAL recovery: {entry.table}")
print(f" Records: {entry.record_count}")
# Generate recovery report
recovery.generate_report("/evidence/recovery_report.html")
タスク 10:モバイルマルウェア分析
入力:モバイルデバイスのデータ
処理:
- 既知のマルウェアをスキャンします
- 不審なアプリを特定します
- 権限の悪用を分析します
- ルートキットの兆候を確認します
- 脅威レポートを生成します
出力:モバイル脅威分析
例:
from mobile_forensics import MobileThreatAnalyzer
# Initialize analyzer
analyzer = MobileThreatAnalyzer("/evidence/device_extraction/")
# Scan for known malware
malware = analyzer.scan_for_malware()
for m in malware:
print(f"MALWARE: {m.app_name}")
print(f" Package: {m.package_name}")
print(f" Family: {m.malware_family}")
print(f" Confidence: {m.confidence}")
# Check for suspicious apps
suspicious = analyzer.find_suspicious_apps()
for app in suspicious:
print(f"SUSPICIOUS: {app.name}")
print(f" Reason: {app.reason}")
print(f" Permissions: {app.suspicious_permissions}")
# Check for root/jailbreak
root_status = analyzer.check_root_status()
print(f"Device rooted: {root_status.is_rooted}")
print(f"Indicators: {root_status.indicators}")
# Check for spyware indicators
spyware = analyzer.detect_spyware()
for s in spyware:
print(f"SPYWARE INDICATOR: {s.indicator}")
print(f" Details: {s.details}")
# Analyze app network behavior
network = analyzer.analyze_app_network()
for app in network:
print(f"App: {app.name}")
print(f" Domains contacted: {app.domains}")
print(f" Suspicious: {app.suspicious_connections}")
# Generate threat report
analyzer.generate_report("/evidence/threat_report.html")
設定
環境変数
| 変数 | 説明 | 必須 | デフォルト |
|---|---|---|---|
ADB_PATH | ADB バイナリへのパス | いいえ | システムの PATH |
BACKUP_PASSWORD | iOS バックアップのパスワード | いいえ | なし |
MAPS_API_KEY | 地図生成用の API キー | いいえ | なし |
MALWARE_HASHES | マルウェアハッシュデータベースへのパス | いいえ | なし |
オプション
| オプション | 型 | 説明 |
|---|---|---|
decrypt_backup | boolean | バックアップの復号を試みます |
recover_deleted | boolean | 削除データの復元を試みます |
extract_media | boolean | メディアファイルを抽出します |
geocode_locations | boolean | 座標を逆ジオコーディングします |
parallel | boolean | 並列処理を有効にします |
例
例 1:犯罪捜査
シナリオ:証拠を探すために容疑者のスマートフォンを分析します
from mobile_forensics import MobileAnalyzer
# Load device extraction
analyzer = MobileAnalyzer("/evidence/suspect_phone/")
# Get all communications
timeline = analyzer.get_communications_timeline()
# Filter for relevant time period
incident_comms = timeline.filter_by_date(
start="2024-01-14",
end="2024-01-16"
)
# Get location during incident
locations = analyzer.get_locations_at_time(
start="2024-01-15 22:00",
end="2024-01-16 02:00"
)
# Find communications with specific number
suspect_contact = timeline.filter_by_contact("+1234567890")
# Export evidence
analyzer.export_evidence("/evidence/case_evidence/")
例 2:企業調査
シナリオ:モバイルデバイスを介したデータ窃盗を調査します
from mobile_forensics import MobileAnalyzer, CloudAnalyzer
# Analyze company phone
analyzer = MobileAnalyzer("/evidence/employee_phone/")
# Check for unauthorized cloud services
cloud = CloudAnalyzer("/evidence/employee_phone/")
services = cloud.detect_cloud_services()
# Find file sharing activity
file_activity = analyzer.search_for_files(
extensions=[".pdf", ".xlsx", ".docx"]
)
# Check messaging for data sharing
messaging = analyzer.get_messaging_data()
attachments = messaging.find_attachments()
制限事項
- 暗号化されたデバイスにはパスコードまたは認証情報が必要です
- 一部のアプリデータは、アプリによって暗号化されている場合があります
- クラウドデータへのアクセスには適切な認可が必要です
- 削除データの復元成功率は状況によって異なります
- 一部の機能には物理的な抽出が必要です
- アプリ固有の解析は、サポートが限定される場合があります
- 位置情報データはユーザー設定によって異なります
トラブルシューティング
よくある問題 1:暗号化されたバックアップ
問題:暗号化された iOS バックアップを読み取れません 解決策:
- バックアップのパスワードを指定します
- バックアップパスワードの復元ツールを使用します
- デバイス所有者にパスワードを問い合わせます
よくある問題 2:ADB 接続の問題
問題:Android デバイスに接続できません 解決策:
- USB デバッグを有効にします
- RSA フィンガープリントを承認します
- 別の USB ケーブルまたはポートを試します
よくある問題 3:アプリデータが見つからない
問題:想定していたアプリデータが見つかりません 解決策:
- アプリがクラウドのみのストレージを使用している可能性があります
- データがアプリによって暗号化されている可能性があります
- アプリ固有のバックアップ保存先を確認します
関連スキル
- memory-forensics:デバイスメモリの分析
- disk-forensics:デバイスストレージの分析
- network-forensics:モバイル通信の分析
- cloud-forensics:クラウド同期データの分析
- timeline-forensics:タイムラインとの統合