This repository has been archived by the owner on Mar 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsigbak.1
179 lines (179 loc) · 4.57 KB
/
sigbak.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.\" Copyright (c) 2019 Tim van der Molen <tim@kariliq.nl>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd February 3, 2020
.Dt SIGBAK 1
.Os
.Sh NAME
.Nm sigbak
.Nd read encrypted Signal backups
.Sh SYNOPSIS
.Nm sigbak
.Ar command
.Op Ar argument ...
.Sh DESCRIPTION
.Nm
is a utility to read the encrypted backups created by the Signal messaging app.
It can be used to extract messages and other data.
.Pp
A Signal backup consists primarily of an SQLite database.
This database contains the backed-up messages, amongst other things.
Attachments, avatars and stickers, however, are stored as separate files in the
backup.
.Pp
Every Signal backup is encrypted with a 30-digit passphrase.
By default,
.Nm
prompts for the passphrase.
Alternatively, the
.Fl p
option may be used to specify a file that contains the passphrase.
Spaces in the passphrase are ignored.
.Pp
The commands are as follows.
.Bl -tag -width Ds
.It Ic attachments Oo Fl p Ar passfile Oc Ar backup Op Ar directory
Export all attachments in the file
.Ar backup
to
.Ar directory ,
or to the current directory if
.Ar directory
is not specified.
.It Ic avatars Oo Fl p Ar passfile Oc Ar backup Op Ar directory
Export all avatars in the file
.Ar backup
to
.Ar directory ,
or to the current directory if
.Ar directory
is not specified.
.It Ic check Oo Fl p Ar passfile Oc Ar backup
Check that the file
.Ar backup
can be decrypted and parsed correctly.
The check is aborted after the first encountered error.
.It Ic dump Oo Fl p Ar passfile Oc Ar backup
Print the raw contents of the file
.Ar backup
in a readable format on standard output.
.It Xo
.Ic messages
.Oo Fl f Ar format Oc
.Oo Fl p Ar passfile Oc
.Oo Fl t Ar thread Oc
.Ar backup Ar dest
.Xc
Export all messages in the file
.Ar backup
to
.Ar dest .
.Pp
The
.Fl f
option may be used to specify the output format.
Supported values are
.Cm maildir
and
.Cm text
(the default).
.Pp
With the
.Cm maildir
format, messages are written as emails in maildir format to the directory
.Ar dest .
Message attachments are not included (yet).
As a precaution,
.Nm
will refuse to write to an already existing maildir.
.Pp
With the
.Cm text
format, messages are written as plain text to the file
.Ar dest .
If
.Ar dest
is omitted, messages are written to standard output instead.
.Pp
By default, all messages are exported.
The
.Fl t
option may be used to export only the messages from a single conversation
thread.
The
.Ar thread
argument should be a number.
The
.Ic threads
command can be used to view a list of conversation threads.
.It Ic sqlite Oo Fl p Ar passfile Oc Ar backup Ar database
Export the SQLite database in the file
.Ar backup
to the file
.Ar database .
.It Ic stickers Oo Fl p Ar passfile Oc Ar backup Op Ar directory
Export all stickers in the file
.Ar backup
to
.Ar directory ,
or to the current directory if
.Ar directory
is not specified.
.It Ic threads Oo Fl p Ar passfile Oc Ar backup
Print a list of all conversation threads.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Dump the raw contents of
.Pa signal.backup
to
.Pa signal.dump :
.Pp
.Dl $ sigbak dump signal.backup > signal.dump
.Pp
First create a passphrase file, then export all messages as plain text, fold
long lines for readability and view the result:
.Bd -literal -offset indent
$ echo 01234 56789 01234 56789 01234 56789 > passfile
$ sigbak messages -p passfile signal.backup | fold -s | less
.Ed
.Pp
Export only the messages from the conversation with Charlie:
.Bd -literal -offset indent
$ sigbak threads signal.backup
[...]
1: Alice
2: Bob
3: Charlie
$ sigbak messages -t 3 signal.backup charlie.txt
.Ed
.Pp
Export the SQLite database and use
.Xr sqlite3 1
to view the contents of the
.Sq sms
table:
.Bd -literal -offset indent
$ sigbak sqlite signal.backup signal.db
$ sqlite3 signal.db 'select * from sms' | less
.Ed
.Sh SEE ALSO
.Lk https://www.kariliq.nl/sigbak/ ,
.Lk https://www.signal.org/
.Sh AUTHORS
The
.Nm
utility was written by
.An Tim van der Molen Aq Mt tim@kariliq.nl .