Giter VIP home page Giter VIP logo

sigbak's Introduction

sigbak

sigbak is a utility to read the backups created by the Signal Android app. It can be used to export messages, attachments and other data.

For example, the following two commands will export all messages and attachments from the backup signal-2022-01-23-12-34-56.backup. Messages will be exported to the messages directory and attachments to the attachments directory:

sigbak export-messages signal-2022-01-23-12-34-56.backup messages
sigbak export-attachments signal-2022-01-23-12-34-56.backup attachments

The complete documentation is available in the sigbak.1 manual page. You can also read it online.

Dependencies

sigbak depends on libcrypto (from either LibreSSL or OpenSSL), protobuf-c and SQLite. You will also need a C compiler, make and pkg-config.

Building

sigbak should build on most modern Unix-like systems. This section contains generic build instructions. See the sections below for build instructions for specific systems.

First install all required packages (see the "Dependencies" section above). For example, on Debian or Ubuntu, run:

sudo apt-get install build-essential git libprotobuf-c-dev libsqlite3-dev libssl-dev pkg-config protobuf-c-compiler

After you have installed the required packages, run:

git clone https://github.com/tbvdm/sigbak.git
cd sigbak
git checkout portable
make

Building on OpenBSD

To build sigbak on OpenBSD, run:

doas pkg_add git protobuf-c sqlite3
git clone https://github.com/tbvdm/sigbak.git
cd sigbak
make

Building on macOS

On macOS, first install Homebrew. Then install the sigbak formula from my Homebrew tap:

brew install --HEAD tbvdm/tap/sigbak

To update the sigbak formula, run:

brew upgrade --fetch-HEAD sigbak

If you prefer to build sigbak manually, run:

brew install libressl make pkg-config protobuf-c
git clone https://github.com/tbvdm/sigbak.git
cd sigbak
git checkout portable
PKG_CONFIG_PATH=$(brew --prefix libressl)/lib/pkgconfig PROTOC=protoc gmake

Building on Windows

On Windows, first install Cygwin. During the installation, you will be given the opportunity to install additional packages. Ensure the curl, gcc-core, gcc-g++, git, libprotobuf-devel, libsqlite3-devel, libssl-devel, make and pkg-config packages are installed.

The Cygwin User's Guide might be useful if you need help with the installation.

After the installation has completed, start the Cygwin terminal.

Unfortunately, Cygwin does not provide a package for protobuf-c, so you will have to build it from source. In the Cygwin terminal, run:

curl -LO https://github.com/protobuf-c/protobuf-c/releases/download/v1.4.1/protobuf-c-1.4.1.tar.gz
tar fxz protobuf-c-1.4.1.tar.gz
cd protobuf-c-1.4.1
./configure
make install
cd ..
rm -r protobuf-c-1.4.1

Now you can build sigbak. In the Cygwin terminal, run:

git clone https://github.com/tbvdm/sigbak.git
cd sigbak
git checkout portable
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig make install

If you prefer, you can use this PowerShell script to install Cygwin and sigbak automatically. Press Windows+R to open the Run window, paste the following command and press Enter:

powershell -nop -c "iex (iwr https://github.com/tbvdm/cygwin-install-scripts/raw/master/install-cygwin-sigbak.ps1)"

In the Cygwin terminal, you can access your Windows drives through the /cygdrive directory. For example:

cd /cygdrive/c/Users/Alice/Documents
sigbak export-messages signal.backup messages

Reporting problems

Please report bugs and other problems with sigbak. If sigbak shows errors or warnings unexpectedly, please report them as well. You can open an issue on GitHub or send an email.

sigbak's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sigbak's Issues

Error messages with Signal v6.5.2 backup

I've been attempting to use sigbak to export data out from my latest Signal backup, made with Signal v6.5.2 for Android, but I keep getting errors, which vary based on the sigbak command I try. The errors make me think perhaps Signal have changed DB schema.

Examples:

# sigbak messages -f csv signal-2022-12-12-02-00-01.backup sig.csv
Enter 30-digit passphrase (whitespace is ignored):
sigbak: Cannot get messages: Cannot prepare SQL statement: no such column: address
# sigbak attachments ./signal-2022-12-12-02-00-01.backup
Enter 30-digit passphrase (whitespace is ignored):
sigbak: Cannot prepare SQL statement: no such column: m.date
# sigbak threads signal-2022-12-12-02-00-01.backup
Enter 30-digit passphrase (whitespace is ignored):
sigbak: Cannot prepare SQL statement: no such column: thread_recipient_id

I verified my Signal backup password is correct - I get MAC mismatch error if I try a known bad password. I also used a different project (signalbackup-tools) to successfully extract the database from my backup, using the same password.

Problem building 'makefile:14: *** missing separator. Stop'

hello,

i have trouble building the program due to the following error:

$ make
Makefile:14: *** Fehlender Trenner.  Schluss.
$ make install
Makefile:14: *** Fehlender Trenner.  Schluss.

I think the error roughly translates to the following:

makefile:14: *** missing separator. Stop
(https://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop)

I try to build it in my virtual machine with the following os:

Distributor ID:	Linuxmint
Description:	Linux Mint 20
Release:	20
Codename:	ulyana

Could you please help me as i am new to Makefiles.

Btw. i have the same problem with sigtop.

can't compile on Linux Mint due to openssl/kdf.h: No such file or directory

i went down a rabbit hole trying to figure out why i don't have kdf.h (even though i have openssl) and I couldn't figure it out...this may be a result of my lack of knowledge on this stuff but i tried my best to resolve it.

sigbak/ $ make
cc -c -o compat/hkdf.o compat/hkdf.c
compat/hkdf.c:22:25: fatal error: openssl/kdf.h: No such file or directory
compilation terminated.
Makefile:42: recipe for target 'compat/hkdf.o' failed
make: *** [compat/hkdf.o] Error 1

Problems with newlines for quotes in text format

If there are newlines in the quoted message there is only one greater-than sign before the first line. I think it would be more consistent if every line of the quoted text had a leading greater-than sign.

Current output

From: xxxx
Sent: Wed, 26 Jan 2022 22:13:16 +0100
Received: Wed, 26 Jan 2022 22:13:18 +0100
Message id: xxx
Thread: xxx 

> From: xxx
> Sent: Wed, 26 Jan 2022 21:24:43 +0100
>
> Some example text.
This is still part of the quote.

This is the message

Improved

From: xxxx
Sent: Wed, 26 Jan 2022 22:13:16 +0100
Received: Wed, 26 Jan 2022 22:13:18 +0100
Message id: xxx
Thread: xxx 

> From: xxx
> Sent: Wed, 26 Jan 2022 21:24:43 +0100
>
> Some example text.
> This is still part of the quote. (now with leading greater-than sign)

This is the message

Attachment ids

Hello! I'm trying to find a way to match up the attachment ids in the result of the export-messages command to the attachments that are a result of the export-attachments command. Is there a good way to do this?

Output quote references

sigbak doesn't mark messages as quotes at the moment, does it?
Could this be implemented?

In text output format for a quoting message:
Quote: "the quoted message id"

SQLite outputs a database with an unexpected token

After using sigbak to extract a signal backup to an SQLite database, I opened the database in sqlitebrowser, which discovered two unexpected tokens. Is this normal, or did I run into an edge case? The database passes integrity checks and contains what I would expect otherwise.

pshem@PiDell-K:~/z/source/sigbak$ ./sigbak sqlite ./signal-2020-02-20-11-56-23.backup ./signal_sqlite.db
pshem@PiDell-K:~/z/source/sigbak$ ./sigbak check
pshem@PiDell-K:~/z/research_android$ sqlitebrowser --read-only signal_sqlite.db 
Sqlite parse error: line 1:47: unexpected token: thread_id(CREATE VIRTUAL TABLE sms_fts USING fts5(body, thread_id UNINDEXED, content=sms, content_rowid=_id))
Sqlite parse error: line 1:47: unexpected token: thread_id(CREATE VIRTUAL TABLE mms_fts USING fts5(body, thread_id UNINDEXED, content=mms, content_rowid=_id))

I've built sigbak on Kubuntu 19.10 with the default toolchain of gcc 9.2.1.

sigbak preferred over sigtop?

Hi Tim,

It would be helpful to distinguish sigbak and sigtop more clearly. ;-) It took me some back and forth to realize which is about what.

The file signal.backup, is this just the sql file copied over from your android phone? Can you provide instructions how to recuperate this file depending on android versions? The path and names have changed over time. A rooted android OS is required to access this file, as well.

Thank you for those tools! :)

Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.