Skip to content

Commit 8667f9f

Browse files
author
utkusen
committed
Initial Release
1 parent 333ea63 commit 8667f9f

File tree

6 files changed

+1143
-0
lines changed

6 files changed

+1143
-0
lines changed

CONFIG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SENDGRID_API_KEY=""
2+
AWS_REGION="us-east-2"
3+
SMTP_SERVER=""
4+
SMTP_PORT=""
5+
SMTP_USERNAME=""
6+
SMTP_PASSWORD=""
7+
EMAIL_TEMPLATE_PATH="template.txt"
8+
EMAIL_CONTENT_TYPE="html"
9+
EMAIL_SUBJECT="A file is shared with you"
10+
FROM_NAME=""
11+
FROM_EMAIL=""

README.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Introduction
2+
3+
```
4+
,_
5+
,' '\,_ Utku Sen's
6+
|_,-'_) wholeaked
7+
/##c '\ (
8+
' |' -{. ) "When you have eliminated the impossible,
9+
/\__-' \[] whatever remains, however improbable,
10+
/'-_'\ must be the truth" - Sherlock Holmes
11+
' \
12+
```
13+
14+
wholeaked is a file-sharing tool that allows you to find the responsible person in case of a leakage. It's written in Go.
15+
16+
## How?
17+
18+
wholeaked gets the file that will be shared and a list of recipients. It creates a unique signature for each recipient and adds it to the file secretly. After then, you can automatically send files to the corresponding recipients by using Sendgrid, AWS SES or SMTP integrations. Instead of sending them by e-mail, you can also share them manually.
19+
20+
wholeaked works with every file type. However, it has additional features for common file types such as PDF, DOCX, MOV etc.
21+
22+
### Sharing Process
23+
24+
```
25+
+-----------+
26+
|Top Secret |
27+
|.pdf |
28+
| |
29+
-| |
30+
/ | |
31+
/ |Hidden |
32+
a@gov / |signature1 |
33+
/ +-----------+
34+
/ +-----------+
35+
+-----------++-----------+ / |Top Secret |
36+
|Top Secret ||Recipient | / |.pdf |
37+
|.pdf ||List | +---------+ / | |
38+
| || | |utkusen/ | / b@gov | |
39+
| ||a@gov |----->|wholeaked| /----------+ |
40+
| ||b@gov | | | \ |Hidden |
41+
| ||c@gov | +---------+ \ |signature2 |
42+
| || | \ +-----------+
43+
+-----------++-----------+ \ +-----------+
44+
\ |Top Secret |
45+
\ |.pdf |
46+
c@gov \ | |
47+
\ | |
48+
\ | |
49+
\ |Hidden |
50+
-|signature3 |
51+
+-----------+
52+
```
53+
54+
### Validation Part
55+
56+
To find who leaked the document, you just need to provide the leaked file to wholeaked and it will reveal the responsible person by comparing the signatures in the database.
57+
58+
```
59+
+-----------+ +---------+
60+
|Top Secret | |Signature|
61+
|.pdf | +---------+|Database |
62+
| | |utkusen/ || | Document leaked by
63+
| |->|wholeaked|| |--------+
64+
| | | || | b@gov
65+
|Hidden | +---------+| |
66+
|Signature2 | | |
67+
+-----------+ +---------+
68+
69+
```
70+
71+
## Demonstration Video
72+
73+
[![Demo Video](https://img.youtube.com/vi/EEDtXp9ngHw/0.jpg)](https://www.youtube.com/watch?v=EEDtXp9ngHw)
74+
75+
## File Types and Detection Modes
76+
77+
wholeaked can add the unique signature to different sections of a file. Available detection modes are given below:
78+
79+
**File Hash:** SHA256 hash of the file. All file types are supported.
80+
81+
**Binary:** The signature is added to the binary of a file. *Almost* all filetypes are supported.
82+
83+
**Metadata:** The signature is added to a metadata section of a file. Supported file types: PDF, DOCX, XLSX, PPTX, MOV, JPG, PNG, GIF, EPS, AI, PSD
84+
85+
**Watermark:** An invisible signature is inserted to the text. Only PDF files are supported.
86+
87+
# Installation
88+
89+
## From Binary
90+
91+
You can download the pre-built binaries from the [releases](https://github.com/utkusen/wholeaked/releases/latest) page and run. For example:
92+
93+
`tar xzvf wholeaked_0.1.0_Linux_amd64.tar.gz`
94+
95+
`./wholeaked --help`
96+
97+
## From Source
98+
99+
1) Install Go on your system
100+
101+
2) Run: `go get -u github.com/utkusen/wholeaked`
102+
103+
## Installing Dependencies
104+
105+
wholeaked requires `exiftool` for adding signatures to metadata section of files. If you don't want to use this feature, you don't need to install it.
106+
107+
1) Debian-based Linux: Run `apt install exiftool`
108+
2) macOS: Run `brew install exiftool`
109+
3) Windows: Download exiftool from here https://exiftool.org/ and put the `exiftool.exe` in the same directory with wholeaked.
110+
111+
wholeaked requires `pdftotext` for verifying watermarks inside PDF files. If you don't want to use this feature, you don't need to install it.
112+
113+
1) Download "Xpdf command line tools" for Linux, macOS or Windows from here: https://www.xpdfreader.com/download.html
114+
2) Extract the archive and navigate to `bin64` folder.
115+
3) Copy the `pdftotext` (or `pdftotext.exe`) executable to the same folder with wholeaked
116+
4) For Debian Based Linux: Run `apt install libfontconfig` command.
117+
118+
# Usage
119+
120+
## Basic Usage
121+
122+
wholeaked requires a project name `-n`, path of the base file which the signatures will added `-f` and a list of target recipients `-t`
123+
124+
Example command: `./wholeaked -n test_project -f secret.pdf -t targets.txt`
125+
126+
The `targets.txt` file should contain name and the e-mail address in the following format:
127+
128+
```
129+
Utku Sen,utku@utkusen.com
130+
Bill Gates,bill@microsoft.com
131+
```
132+
133+
After execution is completed, the following unique files will be generated:
134+
135+
```
136+
test_project/files/Utku_Sen/secret.pdf
137+
test_project/files/Bill_Gates/secret.pdf
138+
```
139+
140+
By default, wholeaked adds signatures to all available places that are defined in the "File Types and Detection Modes" section. If you don't want to use a method, you can define it with a `false` flag. For example:
141+
142+
`./wholeaked -n test_project -f secret.pdf -t targets.txt -binary=false -metadata=false -watermark=false`
143+
144+
## Sending E-mails
145+
146+
In order to send e-mails, you need to fill some sections in the `CONFIG` file.
147+
148+
- If you want to send e-mails via Sendgrid, type your API key to the `SENDGRID_API_KEY` section.
149+
150+
- If you want to send e-mails via AWS SES integration, you need to install `awscli` on your machine and add the required AWS key to it. wholeaked will read the key by itself. But you need to fill the `AWS_REGION` section in the config file.
151+
152+
- If you want to send e-mails via a SMTP server, fill the `SMTP_SERVER`, `SMTP_PORT`, `SMTP_USERNAME`, `SMTP_PASSWORD` sections.
153+
154+
The other necessary fields to fill:
155+
156+
- `EMAIL_TEMPLATE_PATH` Path of the e-mail's body. You can specify use HTML or text format.
157+
- `EMAIL_CONTENT_TYPE` Can be `html` or `text`
158+
- `EMAIL_SUBJECT` Subject of the e-mail
159+
- `FROM_NAME` From name of the e-mail
160+
- `FROM_EMAIL` From e-mail of the e-mail
161+
162+
To specify the sending method, you can use `-sendgrid`, `-ses` or `-smtp` flags. For example:
163+
164+
`./wholeaked -n test_project -f secret.pdf -t targets.txt -sendgrid`
165+
166+
## Validating a Leaked File
167+
168+
You can use the `-validate` flag to reveal the owner of a leaked file. wholeaked will compare the signatures detected in the file and the database located in the project folder. Example:
169+
170+
`./wholeaked -n test_project -f secret.pdf -validate`
171+
172+
**Important:** You shouldn't delete the `project_folder/db.csv` file if you want to use the file validation feature. If that file is deleted, wholeaked won't be able to compare the signatures.
173+
174+
# Donation
175+
176+
Loved the project? You can buy me a coffee
177+
178+
<a href="https://www.buymeacoffee.com/utkusen" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

go.mod

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module github.com/utkusen/wholeaked
2+
3+
go 1.17
4+
5+
require (
6+
github.com/aws/aws-sdk-go v1.42.38
7+
github.com/barasher/go-exiftool v1.7.0
8+
github.com/fatih/color v1.13.0
9+
github.com/google/uuid v1.3.0
10+
github.com/pdfcpu/pdfcpu v0.3.13
11+
github.com/sendgrid/sendgrid-go v3.10.5+incompatible
12+
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
13+
)
14+
15+
require (
16+
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 // indirect
17+
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 // indirect
18+
github.com/jmespath/go-jmespath v0.4.0 // indirect
19+
github.com/mattn/go-colorable v0.1.9 // indirect
20+
github.com/mattn/go-isatty v0.0.14 // indirect
21+
github.com/pkg/errors v0.9.1 // indirect
22+
github.com/sendgrid/rest v2.6.7+incompatible // indirect
23+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
24+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
25+
golang.org/x/text v0.3.6 // indirect
26+
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
27+
gopkg.in/yaml.v2 v2.4.0 // indirect
28+
)

go.sum

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
github.com/aws/aws-sdk-go v1.42.38 h1:/fNQTB4ZUQOa8+cfX7C7F0zyXRdiN1jGKKXt3+5nmzM=
2+
github.com/aws/aws-sdk-go v1.42.38/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc=
3+
github.com/barasher/go-exiftool v1.7.0 h1:EOGb5D6TpWXmqsnEjJ0ai6+tIW2gZFwIoS9O/33Nixs=
4+
github.com/barasher/go-exiftool v1.7.0/go.mod h1:F9s/a3uHSM8YniVfwF+sbQUtP8Gmh9nyzigNF+8vsWo=
5+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
6+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
8+
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
9+
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
10+
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
11+
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
12+
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 h1:1yY/RQWNSBjJe2GDCIYoLmpWVidrooriUr4QS/zaATQ=
13+
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
14+
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 h1:o1wMw7uTNyA58IlEdDpxIrtFHTgnvYzA8sCQz8luv94=
15+
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7/go.mod h1:WkUxfS2JUu3qPo6tRld7ISb8HiC0gVSU91kooBMDVok=
16+
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
17+
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
18+
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
19+
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
20+
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
21+
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
22+
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
23+
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
24+
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
25+
github.com/pdfcpu/pdfcpu v0.3.13 h1:VFon2Yo1PJt+sA57vPAeXWGLSZ7Ux3Jl4h02M0+s3dg=
26+
github.com/pdfcpu/pdfcpu v0.3.13/go.mod h1:UJc5xsXg0fpmjp1zOPdyYcAQArc/Zf3V0nv5URe+9fg=
27+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
28+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
29+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
30+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
31+
github.com/sendgrid/rest v2.6.7+incompatible h1:VitKiUoCWxqUSezj7gHtG3tAjQPXElDcj6Gxflog6pA=
32+
github.com/sendgrid/rest v2.6.7+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE=
33+
github.com/sendgrid/sendgrid-go v3.10.5+incompatible h1:2f/d7odubrZMkwqSupQDU5ad1GkS8syopBapDazh5bM=
34+
github.com/sendgrid/sendgrid-go v3.10.5+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
35+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
36+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
37+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
38+
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
39+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk=
40+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
41+
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM=
42+
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
43+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
44+
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
45+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
46+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
47+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
48+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
49+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
50+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
51+
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
52+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
53+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
54+
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
55+
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
56+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
57+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
58+
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
59+
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
60+
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
61+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
62+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=

0 commit comments

Comments
 (0)