Extract data from v...
 
Notifications
Clear all

Extract data from viber database

10 Posts
8 Users
0 Likes
12.6 K Views
(@eugene_777)
Posts: 22
Eminent Member
Topic starter
 

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

 
Posted : 20/02/2019 3:40 pm
(@dpathan)
Posts: 28
Eminent 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/

 
Posted : 20/02/2019 4:02 pm
Igor_Michailov
(@igor_michailov)
Posts: 529
Honorable 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?

 
Posted : 20/02/2019 5:29 pm
(@eugene_777)
Posts: 22
Eminent Member
Topic starter
 

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.

 
Posted : 21/02/2019 7:50 am
Omnius
(@omnius)
Posts: 39
Eminent Member
 

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

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

 
Posted : 21/02/2019 9:15 am
(@soft512byte)
Posts: 16
Active Member
 

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

 
Posted : 21/02/2019 12:54 pm
(@eugene_777)
Posts: 22
Eminent Member
Topic starter
 

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

 
Posted : 21/02/2019 1:52 pm
(@pekde)
Posts: 1
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.

 
Posted : 25/07/2019 9:04 pm
bodqhrohro
(@bodqhrohro)
Posts: 1
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.

 
Posted : 06/03/2021 4:37 pm
(@shardator)
Posts: 1
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 years ago 2 times by shardator
 
Posted : 25/03/2021 10:27 pm
Share: