середа, 1 травня 2019 р.

SCRIPTS FOR TELEGRAM CHAT EXTRACTION


Maksym Boiko, mboiko25@gmail.com, Kyiv, 2019


After some requests I decided to attach some test scripts. I didn't do them for widespread use. All of them were for my particular cases. These codes were written in 2018. But in general, an internal structure of cache4.db remains the same. 
As for telegram-parse-enc.py, sometimes it has problems with transliteration and encoding. It is good for analyzing with unknown, poorly studied structure or raw data (for instance, in cases of searching within RAM dumps). 
I have to say that in my opinion this way of analyzing intact cache4.db is not optimal. It is better to analyze it as simple SQLite database and its fields. 
For these purposes I use telegram-sqlite-secret.pytelegram-sqlite-v7.py or telegram-sqlite-v7-without-chats.py. Briefly, they perform SQLite queries and then analyze data depending on whether it is chat, secret chat, channel or not. If my memory doesn't fail me, they have similar codes. Important moment - I specify database filename in the beginning of these scripts (for instance, ff='cache4.db-wal' or conn=sqlite3.connect('cache4.db')).
I hope scripts will be useful for you.