Chuyển đến nội dung
Skillpedia
Bảo mật35k · #7909

exploiting-insecure-data-storage-in-mobile

Skill này làm gì

Công cụ này kiểm tra xem ứng dụng di động có lưu thông tin nhạy cảm không an toàn trên thiết bị của bạn hay không. Nó tìm mật khẩu, dữ liệu cá nhân hoặc khóa truy cập có thể bị lộ trong tệp hoặc cơ sở dữ liệu.

Khi nào nên dùng

  • ✓Khi bạn là người kiểm thử bảo mật và muốn xem một ứng dụng có lưu dữ liệu an toàn không.
  • ✓Khi kiểm tra xem mật khẩu hoặc token truy cập có thể bị đánh cắp từ ứng dụng không.
  • ✓Để kiểm tra xem thông tin cá nhân (như số an sinh xã hội hoặc số thẻ tín dụng) có được lưu mà không mã hóa hay không.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-insecure-data-storage-in-mobile/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-insecure-data-storage-in-mobile/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm tra xem ứng dụng X có lưu mật khẩu một cách không an toàn trên Android không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tìm các tệp cấu hình (như SharedPreferences trên Android) và cơ sở dữ liệu (như SQLite) nơi ứng dụng lưu thông tin. Nó kiểm tra xem dữ liệu có ở dạng văn bản thuần, không mã hóa hay không, vì điều này khiến ai có quyền truy cập thiết bị có thể đọc dễ dàng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Exploiting Insecure Data Storage in Mobile

When to Use

Use this skill when:

  • Assessing whether mobile applications store sensitive data securely on the device filesystem
  • Testing for credential leakage through SharedPreferences, SQLite databases, or plists
  • Evaluating keychain/keystore implementation for proper access control attributes
  • Performing data-at-rest security assessment during mobile penetration tests

Do not use this skill on production user devices without authorization -- data extraction techniques require physical access or root/jailbreak privileges.

Prerequisites

  • Rooted Android device or emulator with ADB access
  • Jailbroken iOS device with SSH access or Objection-patched IPA
  • ADB (Android Debug Bridge) for Android filesystem access
  • SQLite3 CLI for database inspection
  • Frida/Objection for runtime data extraction
  • Target application installed and exercised (logged in, data cached)

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: Map Application Data Storage Locations

Android storage paths:

# Internal storage (app-private, requires root)
/data/data/<package_name>/
├── shared_prefs/      # SharedPreferences XML files
├── databases/         # SQLite databases
├── files/             # General files
├── cache/             # Cached data
├── lib/               # Native libraries
└── app_webview/       # WebView data

# External storage (world-readable on older Android)
/sdcard/Android/data/<package_name>/

# Check for world-readable files
adb shell run-as <package_name> ls -la /data/data/<package_name>/

iOS storage paths:

# App sandbox (accessible via SSH on jailbroken device)
/var/mobile/Containers/Data/Application/<UUID>/
├── Documents/         # User data, backed up by default
├── Library/
│   ├── Preferences/   # NSUserDefaults plists
│   ├── Caches/        # Cache data
│   └── Application Support/
└── tmp/               # Temporary files

Step 2: Extract and Analyze SharedPreferences (Android)

# Pull SharedPreferences files
adb shell run-as <package_name> cat shared_prefs/*.xml

# Or on rooted device
adb pull /data/data/<package_name>/shared_prefs/ ./shared_prefs/

# Search for sensitive data
grep -ri "password\|token\|secret\|key\|session\|auth\|cookie" shared_prefs/

Common insecure storage patterns:

<!-- Plaintext credentials -->
<string name="user_password">mysecretpass123</string>
<string name="auth_token">eyJhbGciOiJIUzI1NiIs...</string>
<string name="api_key">sk-live-abc123def456</string>

<!-- Sensitive PII -->
<string name="user_ssn">123-45-6789</string>
<string name="credit_card">4111111111111111</string>

Step 3: Analyze SQLite Databases

# Pull databases
adb pull /data/data/<package_name>/databases/ ./databases/

# Open and inspect
sqlite3 databases/app.db
.tables
.schema users
SELECT * FROM users;
SELECT * FROM sessions;
SELECT * FROM tokens;

# Search all tables for sensitive columns
sqlite3 databases/app.db ".dump" | grep -i "password\|token\|secret\|credit"

Check for unencrypted SQLCipher databases:

# If database opens without password, it's unencrypted
sqlite3 databases/app.db "SELECT count(*) FROM sqlite_master;"
# Success = unencrypted (vulnerability)

Step 4: Inspect iOS Keychain Storage

# Using Objection
objection --gadget com.target.app explore
ios keychain dump

# Check protection class attributes
# kSecAttrAccessibleWhenUnlocked - OK for most data
# kSecAttrAccessibleAlways - VULNERABLE: accessible even when locked
# kSecAttrAccessibleAfterFirstUnlock - acceptable for background apps

Step 5: Assess External Storage and Backup Exposure

Android:

# Check if backup is enabled
aapt dump badging target.apk | grep -i "allowBackup"
# android:allowBackup="true" = vulnerability

# Extract backup data
adb backup -f backup.ab -apk <package_name>
java -jar abe.jar unpack backup.ab backup.tar
tar xvf backup.tar
# Inspect extracted data for sensitive information

# Check external storage
adb shell ls -la /sdcard/Android/data/<package_name>/

iOS:

# Check backup exclusion
# Files in Documents/ are backed up by default
# Check NSURLIsExcludedFromBackupKey attribute
objection --gadget com.target.app explore

…
Câu hỏi thường gặp

SharedPreferences trên Android là gì?

Đó là các tệp đơn giản để Android lưu một lượng dữ liệu nhỏ, như cài đặt hoặc token. Nếu dùng để lưu mật khẩu mà không mã hóa, chúng gây rủi ro bảo mật.

Keychain trên iOS là gì?

Đó là vị trí an toàn trên iPhone/iPad để lưu mật khẩu và khóa truy cập. Nếu ứng dụng không dùng đúng biện pháp bảo vệ, thông tin này có thể bị truy cập trái phép.

Tôi có cần quyền đặc biệt đối với điện thoại để dùng công cụ này không?

Có, bạn thường cần quyền “root” trên Android hoặc “jailbreak” trên iOS, hoặc truy cập vật lý vào thiết bị để kiểm tra các tệp chứa dữ liệu.

Chi tiết

Mô tả gốc của tác giả

Identifies and exploits insecure local data storage vulnerabilities in Android and iOS mobile applications including unencrypted databases, world-readable files, insecure SharedPreferences, plaintext credential storage, and improper keychain/keystore usage. Use when performing mobile penetration testing focused on OWASP M9 (Insecure Data Storage) or assessing compliance with MASVS-STORAGE requirem

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7909
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự