Extract data from v...
 
Notifications
Clear all

Extract data from viber database

Eugene_777
(@eugene_777)
New Member

Hello. I have Viber database on a PC. I need to extract messages, time and who created these messages.
How can I do it? Maybe somebody has Sql script for it?

Thanks in advance

Quote
Topic starter Posted : 20/02/2019 3:40 pm
dpathan
(@dpathan)
Junior Member

I would try SQLite Viewer and see what is the result

But I found this too.. https://play.datalude.com/blog/2017/06/viber-sqlite-database-extraction-forensics/

ReplyQuote
Posted : 20/02/2019 4:02 pm
Igor_Michailov
(@igor_michailov)
Senior Member

Hello. I have Viber database on a PC. I need to extract messages, time and who created these messages.
How can I do it? Maybe somebody has Sql script for it?

Thanks in advance

Do you sure what the database contains on messages?

ReplyQuote
Posted : 20/02/2019 5:29 pm
Eugene_777
(@eugene_777)
New Member

Yes. I tried to open database via SQL viewer. But I need to merge messages, creation time and users. All are stored in the different table. I want to add that it's Viber was created for Microsoft Windows. It even has other database location.
Problem is that I don't know the right links between these tables. I tried to find structure Viber database on the internet but I searched nothing yet.

ReplyQuote
Topic starter Posted : 21/02/2019 7:50 am
Omnius
(@omnius)
Junior Member

I've not tried the script, but this may be of help

https://www.forensicfocus.com/Forums/viewtopic/t=15342/

ReplyQuote
Posted : 21/02/2019 9:15 am
soft512byte
(@soft512byte)
New Member

I can help. Write in private or e-mail soft@512byte.ua

ReplyQuote
Posted : 21/02/2019 12:54 pm
Eugene_777
(@eugene_777)
New Member

Thanks everyone for help, but I've already decided this question.

ReplyQuote
Topic starter Posted : 21/02/2019 1:52 pm
pekde
(@pekde)
New Member

Eugene_777 could you please tell us which was your solution?

My partly solution was this
SELECT strftime('%Y-%m-%d %H%M%S',(Events.TimeStamp/1000),'unixepoch') AS Time,
Contact.Name AS Name,
Contact.ClientName AS AltName,
Contact.Number As Cellphone,
CASE Direction WHEN 0 THEN 'rcvd' ELSE 'sent' END AS Direction,
Messages.Body AS Message
FROM Events
INNER JOIN Contact ON Events.ContactID = Contact.ContactID
INNER JOIN Messages ON Events.EventID = Messages.EventID
ORDER BY Time;

But this is not perfect. What I would like have is a Viber.db file to have merged data to work with the user interface (maybe needs some installation specific code). Is there anyone who would be interested to play deeper with ViberPC? I have lost the activation flag, and now I don't know if I can get the old history to work with refreshment of the data.

ReplyQuote
Posted : 25/07/2019 10:04 pm
bodqhrohro
(@bodqhrohro)
New Member

Is anyone still interested in this and willing to spend a bit? 😉

I may develop a usable database viewer, akin to tools like Skyperious or muhv: having advanced searching/filtering capabilities and integrated with the ViberDownloads folder, so it will be no more needed to mess with version-specific SQL queries and manually grab the media.

If you're desirous for such a viewer, please contact me 🙂 Additional ideas are appreciated.

ReplyQuote
Posted : 06/03/2021 4:37 pm
shardator
(@shardator)
New Member

A bit refined. On "sent" lines I think it would look better if the recipient would be shown, not the sender (as it is always the same). (Group convos will be filtered out, fixes for that are welcome. Probably Alt Name could contain ChatInfo.Name or sg):

 

SELECT strftime('%Y-%m-%d %H:%M:%S',(Events.TimeStamp/1000),'unixepoch') AS Time,
ChatToContact.Name AS Name,
ChatToContact.Readable AS AltName,
ChatToContact.Number As Cellphone,
CASE Events.Direction WHEN 0 THEN 'rcvd' ELSE 'sent' END AS Direction,
Messages.Body AS Message
FROM Events, Contact, Messages,
(
SELECT Events.ChatID AS ChatID,
Contact.Number AS Number,
Contact.name AS Name,
ifnull(Contact.name, Contact.Number) AS Readable,
Count(DISTINCT Contact.ContactID) AS NContact
FROM Events, Contact
WHERE Events.ContactID = Contact.ContactID
AND Events.Direction = 0
GROUP BY Events.ChatID
HAVING NContact = 1
) AS ChatToContact
WHERE Events.ContactID = Contact.ContactID
AND Events.EventID = Messages.EventID
AND Events.ChatID = ChatToContact.ChatID
ORDER BY Time;

 

This post was modified 3 weeks ago 2 times by shardator
ReplyQuote
Posted : 25/03/2021 10:27 pm
Share: