Markdown Converter
Agent skill for markdown-converter
CLI forensic tool for Telegram Desktop artifact analysis. Extracts and analyzes data from `tdata` directory.
Sign in to like and favorite skills
CLI forensic tool for Telegram Desktop artifact analysis. Extracts and analyzes data from
tdata directory.
tgartifacts/ ├── cli.py # Entry point, click commands ├── core/ │ ├── tdata_parser.py # Parse tdata structure │ ├── decryptor.py # AES-256-IGE decryption │ ├── parser.py # Qt Data Stream parser │ └── bruteforce.py # Passcode bruteforce ├── utils/ │ ├── crypto.py # Key derivation, encryption helpers │ └── tdf.py # TDF file format parser └── templates/ # Jinja2 HTML templates (future)
Local Telegram Desktop storage containing:
✅ user_id, DC ID from MTP authorization ✅ Account directory enumeration ✅ Media cache files (TDEF format, images/videos/documents) ❌ Auth keys (DC authorization keys in dbiMtpAuthorization) ❌ Phone number (requires additional parsing from settings or maps) ❌ Message history (stored on Telegram servers, not local) ❌ Storage maps (file index in {account_dir}/maps) ❌ Application settings (settingss file in tdata root) ❌ Account configs ({account_dir}/configs)
+----------------+ | "TDF$" (4b) | Magic bytes +----------------+ | Version (4b) | Little-endian uint32 +----------------+ | Data (N bytes) | Encrypted payload +----------------+ | MD5 (16b) | MD5(data + len(data) + version + magic) +----------------+
Binary format used by Telegram Desktop for serialization:
salt (QByteArray, 32 bytes)key_encrypted (QByteArray)info_encrypted (QByteArray)SHA512(salt + passcode + salt)PBKDF2-HMAC-SHA512(pre_hash, salt, iterations, 256)tdata/ ├── key_datas # Encrypted localKey (always exists in new versions) ├── settingss # Application settings (TDF) ├── D877F783D5D3EF8C/ # Account directory (MD5 hash of "data") │ ├── maps # Storage map (TDF) │ ├── configs # Account configs │ └── ... # Cached data ├── D877F783D5D3EF8Cs # Account MTP data file (TDF) └── ...
Important: Account data is NOT in the maps file inside the directory.
tgartifacts info <path> # Quick structure info tgartifacts analyze <path> # Full analysis (no passcode needed if not set) tgartifacts analyze <path> --passcode "X" # With passcode tgartifacts bruteforce <path> -a ACCOUNT # Bruteforce passcode
✅ TDF file format parser (magic TDF$, version, encrypted data, MD5) ✅ TDEF file format parser (magic TDEF, AES-256-CTR decryption) ✅ Qt Data Stream parser (uint32, int32, uint64, QByteArray) ✅ Two-stage decryption (passcode_key → local_key) ✅ Account data file parsing ({account_dir}s) ✅ MTP authorization extraction (user_id, dc_id) ✅ Settings blocks parsing (dbiMtpAuthorization 0x4B) ✅ Media cache extraction (TDEF files from user_data/media_cache) ✅ CLI commands (info, analyze, extract_cache) ❌ Bruteforce module (not yet implemented) ❌ Maps file parsing (storage index) ❌ Auth keys extraction (DC auth keys) ❌ Settings file parsing (settingss in tdata root) ❌ JSON export/reports ❌ Timeline generation ❌ File type identification (python-magic integration)
Extract auth_keys from dbiMtpAuthorization block
Parse maps file ({account_dir}/maps)
Parse settingss file (tdata root)
Implement JSON export
Add python-magic integration
Timeline generation (future)
python-magic library (safe, no injection risks)