crypttrace 0.34.0__tar.gz → 0.35.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {crypttrace-0.34.0/src/crypttrace.egg-info → crypttrace-0.35.0}/PKG-INFO +15 -5
- {crypttrace-0.34.0 → crypttrace-0.35.0}/README.md +11 -4
- {crypttrace-0.34.0 → crypttrace-0.35.0}/pyproject.toml +2 -1
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/__init__.py +1 -1
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/cli.py +4 -2
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/evidence.py +111 -0
- crypttrace-0.35.0/src/crypttrace/pdf.py +86 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/web/index.html +6 -4
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/webapp.py +11 -1
- {crypttrace-0.34.0 → crypttrace-0.35.0/src/crypttrace.egg-info}/PKG-INFO +15 -5
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace.egg-info/SOURCES.txt +1 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace.egg-info/requires.txt +4 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/LICENSE +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/setup.cfg +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/addresses.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/analysis.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/assess.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/assets.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/bridges.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/case.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/chains.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/config.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/drain.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/export.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/__init__.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/bitcoin.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/etherscan.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/http.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/solana.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/ton.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/fetchers/tron.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/freeze.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/funder.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/gascluster.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/investigate.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/__init__.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/audit.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/bulk.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/known.json +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/labels.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/names.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/partial.json +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/tonapi.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/labels/tronscan.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/offramp.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/poisoning.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/prices.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/render.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/report.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/spam.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/store.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/trace.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/verify.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace/watch.py +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace.egg-info/dependency_links.txt +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace.egg-info/entry_points.txt +0 -0
- {crypttrace-0.34.0 → crypttrace-0.35.0}/src/crypttrace.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crypttrace
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.35.0
|
|
4
4
|
Summary: OSINT toolkit for crypto investigations: trace stolen funds across Ethereum, Bitcoin, Tron, Solana and TON
|
|
5
5
|
Author: bobslayerX
|
|
6
6
|
License-Expression: MIT
|
|
@@ -30,6 +30,9 @@ Requires-Dist: rich>=13.0
|
|
|
30
30
|
Requires-Dist: requests>=2.31
|
|
31
31
|
Provides-Extra: web
|
|
32
32
|
Requires-Dist: flask>=3.0; extra == "web"
|
|
33
|
+
Requires-Dist: fpdf2>=2.7; extra == "web"
|
|
34
|
+
Provides-Extra: pdf
|
|
35
|
+
Requires-Dist: fpdf2>=2.7; extra == "pdf"
|
|
33
36
|
Dynamic: license-file
|
|
34
37
|
|
|
35
38
|
# crypttrace
|
|
@@ -67,8 +70,8 @@ USDC blacklisted by Tether and Circle, and the first funding of the wallet —
|
|
|
67
70
|
pipx install "crypttrace[web]" # or: pip install "crypttrace[web]"
|
|
68
71
|
```
|
|
69
72
|
|
|
70
|
-
`[web]` also installs Flask for the web UI
|
|
71
|
-
alone. Python 3.10 or newer. To work on the code instead:
|
|
73
|
+
`[web]` also installs Flask for the web UI and fpdf2 for PDF evidence packs; leave
|
|
74
|
+
it off for the terminal tool alone (`[pdf]` adds only the PDF part). Python 3.10 or newer. To work on the code instead:
|
|
72
75
|
|
|
73
76
|
```bash
|
|
74
77
|
git clone https://github.com/bobslayerX/crypttrace
|
|
@@ -188,8 +191,14 @@ deposit and its memo with the hash of each hop, a precise request to the
|
|
|
188
191
|
exchange (freeze the account behind the memo, preserve KYC, login and
|
|
189
192
|
withdrawal records) and to the police (request them through the exchange's
|
|
190
193
|
law-enforcement channel), and how it was established — so anyone can check it.
|
|
191
|
-
Name, contact and signature are left blank to fill in. Saved as
|
|
192
|
-
PDF
|
|
194
|
+
Name, contact and signature are left blank to fill in. Saved as a printable
|
|
195
|
+
**PDF** (A4, every transaction a clickable link), plus HTML, Markdown and JSON;
|
|
196
|
+
the **Was I drained?** tab has PDF and HTML downloads in both languages.
|
|
197
|
+
|
|
198
|
+
The PDF needs the `pdf` extra (part of `web`): `pip install "crypttrace[pdf]"`.
|
|
199
|
+
It uses a system font with Cyrillic — Arial or Segoe UI on Windows and macOS,
|
|
200
|
+
DejaVu, Liberation or Noto Sans on Linux — or the `.ttf` named by
|
|
201
|
+
`CRYPTTRACE_PDF_FONT`. Without them the pack is still saved, as HTML to print.
|
|
193
202
|
|
|
194
203
|
## Web UI
|
|
195
204
|
|
|
@@ -769,6 +778,7 @@ src/crypttrace/
|
|
|
769
778
|
watch.py # watchlist + alerts
|
|
770
779
|
case.py # investigations as files: addresses, roles, notes, snapshots
|
|
771
780
|
report.py # Markdown + JSON reports
|
|
781
|
+
pdf.py # PDF page setup and font discovery (evidence packs)
|
|
772
782
|
export.py # traced graph as GraphML (Gephi) and edge-list CSV (Maltego)
|
|
773
783
|
prices.py # USD valuation
|
|
774
784
|
render.py # rich terminal rendering
|
|
@@ -33,8 +33,8 @@ USDC blacklisted by Tether and Circle, and the first funding of the wallet —
|
|
|
33
33
|
pipx install "crypttrace[web]" # or: pip install "crypttrace[web]"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
`[web]` also installs Flask for the web UI
|
|
37
|
-
alone. Python 3.10 or newer. To work on the code instead:
|
|
36
|
+
`[web]` also installs Flask for the web UI and fpdf2 for PDF evidence packs; leave
|
|
37
|
+
it off for the terminal tool alone (`[pdf]` adds only the PDF part). Python 3.10 or newer. To work on the code instead:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
git clone https://github.com/bobslayerX/crypttrace
|
|
@@ -154,8 +154,14 @@ deposit and its memo with the hash of each hop, a precise request to the
|
|
|
154
154
|
exchange (freeze the account behind the memo, preserve KYC, login and
|
|
155
155
|
withdrawal records) and to the police (request them through the exchange's
|
|
156
156
|
law-enforcement channel), and how it was established — so anyone can check it.
|
|
157
|
-
Name, contact and signature are left blank to fill in. Saved as
|
|
158
|
-
PDF
|
|
157
|
+
Name, contact and signature are left blank to fill in. Saved as a printable
|
|
158
|
+
**PDF** (A4, every transaction a clickable link), plus HTML, Markdown and JSON;
|
|
159
|
+
the **Was I drained?** tab has PDF and HTML downloads in both languages.
|
|
160
|
+
|
|
161
|
+
The PDF needs the `pdf` extra (part of `web`): `pip install "crypttrace[pdf]"`.
|
|
162
|
+
It uses a system font with Cyrillic — Arial or Segoe UI on Windows and macOS,
|
|
163
|
+
DejaVu, Liberation or Noto Sans on Linux — or the `.ttf` named by
|
|
164
|
+
`CRYPTTRACE_PDF_FONT`. Without them the pack is still saved, as HTML to print.
|
|
159
165
|
|
|
160
166
|
## Web UI
|
|
161
167
|
|
|
@@ -735,6 +741,7 @@ src/crypttrace/
|
|
|
735
741
|
watch.py # watchlist + alerts
|
|
736
742
|
case.py # investigations as files: addresses, roles, notes, snapshots
|
|
737
743
|
report.py # Markdown + JSON reports
|
|
744
|
+
pdf.py # PDF page setup and font discovery (evidence packs)
|
|
738
745
|
export.py # traced graph as GraphML (Gephi) and edge-list CSV (Maltego)
|
|
739
746
|
prices.py # USD valuation
|
|
740
747
|
render.py # rich terminal rendering
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""crypttrace — OSINT crypto investigation CLI."""
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.35.0"
|
|
@@ -208,8 +208,10 @@ def evidence(
|
|
|
208
208
|
console.print(f"[bold]Evidence pack saved[/bold] — exchange deposits: {memos}")
|
|
209
209
|
for p in paths:
|
|
210
210
|
console.print(f" {p}")
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
if doc.get("pdf_note"):
|
|
212
|
+
console.print(f"[yellow]No PDF:[/yellow] {doc['pdf_note']}. Open the .html in a browser and print it to PDF.")
|
|
213
|
+
console.print("[dim]Fill in your name and contact (on paper or in the PDF), then send it with your "
|
|
214
|
+
"report.[/dim]")
|
|
213
215
|
|
|
214
216
|
|
|
215
217
|
@app.command()
|
|
@@ -224,11 +224,122 @@ def render_html(doc: Dict, lang: str = "en") -> str:
|
|
|
224
224
|
return "".join(P)
|
|
225
225
|
|
|
226
226
|
|
|
227
|
+
def render_pdf(doc: Dict, lang: str = "en") -> bytes:
|
|
228
|
+
"""The pack as a printable A4 PDF: the same sections as the HTML, links kept."""
|
|
229
|
+
from crypttrace import pdf as pdf_mod
|
|
230
|
+
t, res, chain = T[lang], doc["check"], doc["chain"]
|
|
231
|
+
p = pdf_mod.document(t["title"]) # PdfError when fpdf2 or a font is missing
|
|
232
|
+
from fpdf.fonts import FontFace
|
|
233
|
+
W = p.epw
|
|
234
|
+
|
|
235
|
+
def body(size=10.5, bold=False):
|
|
236
|
+
p.set_font("body", "B" if bold else "", size)
|
|
237
|
+
|
|
238
|
+
def h2(s):
|
|
239
|
+
p.ln(3)
|
|
240
|
+
body(12.5, True)
|
|
241
|
+
p.multi_cell(W, 7, s, new_x="LMARGIN", new_y="NEXT")
|
|
242
|
+
p.set_draw_color(150)
|
|
243
|
+
p.line(p.l_margin, p.get_y(), p.l_margin + W, p.get_y())
|
|
244
|
+
p.ln(2)
|
|
245
|
+
body()
|
|
246
|
+
|
|
247
|
+
def para(s, bold=False, fill=False):
|
|
248
|
+
body(10.5, bold)
|
|
249
|
+
p.multi_cell(W, 5.4, s, fill=fill, new_x="LMARGIN", new_y="NEXT")
|
|
250
|
+
p.ln(1.5)
|
|
251
|
+
body()
|
|
252
|
+
|
|
253
|
+
def mono(s, link="", size=8):
|
|
254
|
+
p.set_font("Courier", "", size)
|
|
255
|
+
p.multi_cell(W, 4.2, s, link=link, new_x="LMARGIN", new_y="NEXT")
|
|
256
|
+
body()
|
|
257
|
+
|
|
258
|
+
body(16, True)
|
|
259
|
+
p.multi_cell(W, 8, t["title"], new_x="LMARGIN", new_y="NEXT")
|
|
260
|
+
body(8.5)
|
|
261
|
+
p.set_text_color(90)
|
|
262
|
+
p.multi_cell(W, 4.5, f"{doc['tool']} · {doc['generated']}", new_x="LMARGIN", new_y="NEXT")
|
|
263
|
+
p.set_text_color(0)
|
|
264
|
+
body()
|
|
265
|
+
if res["verdict"] == "no_drain":
|
|
266
|
+
p.ln(4)
|
|
267
|
+
para(t["nothing"])
|
|
268
|
+
return bytes(p.output())
|
|
269
|
+
f = _facts(doc, lang)
|
|
270
|
+
|
|
271
|
+
h2(t["victim"])
|
|
272
|
+
for k, v in ((t["name"], ""), (t["contact"], ""), (t["wallet"], f"{res['address']} ({chain.upper()})"),
|
|
273
|
+
(t["discovered"], "")):
|
|
274
|
+
body(10, True)
|
|
275
|
+
p.cell(W * 0.34, 8, k, border=1)
|
|
276
|
+
if v:
|
|
277
|
+
p.set_font("Courier", "", 8)
|
|
278
|
+
p.cell(W * 0.66, 8, v, border=1, new_x="LMARGIN", new_y="NEXT")
|
|
279
|
+
body()
|
|
280
|
+
|
|
281
|
+
h2(t["summary"])
|
|
282
|
+
for s in f["paras"]:
|
|
283
|
+
para(s)
|
|
284
|
+
|
|
285
|
+
h2(t["chronology"])
|
|
286
|
+
hashes = FontFace(family="Courier", size_pt=7)
|
|
287
|
+
body(9)
|
|
288
|
+
with p.table(col_widths=(36, 26, 76), text_align=("LEFT", "RIGHT", "LEFT"), line_height=5,
|
|
289
|
+
headings_style=FontFace(emphasis="BOLD", fill_color=(235, 235, 235))) as tbl:
|
|
290
|
+
head = tbl.row()
|
|
291
|
+
for c in t["cols"]:
|
|
292
|
+
head.cell(c)
|
|
293
|
+
for when, amount, h in f["rows"]:
|
|
294
|
+
row = tbl.row()
|
|
295
|
+
row.cell(when.replace(" UTC", "")) # the column heading says UTC
|
|
296
|
+
row.cell(amount)
|
|
297
|
+
row.cell(h, style=hashes, link=chains.tx_url(h, chain))
|
|
298
|
+
body()
|
|
299
|
+
|
|
300
|
+
h2(t["path"])
|
|
301
|
+
if f["deps"]:
|
|
302
|
+
p.set_fill_color(242, 242, 242)
|
|
303
|
+
for d in f["deps"]:
|
|
304
|
+
para(d["text"], bold=True, fill=True)
|
|
305
|
+
body(8.5)
|
|
306
|
+
p.multi_cell(W, 4.4, d["via"], new_x="LMARGIN", new_y="NEXT")
|
|
307
|
+
p.ln(1)
|
|
308
|
+
for h in d["links"]:
|
|
309
|
+
if h:
|
|
310
|
+
mono(h, link=chains.tx_url(h, chain))
|
|
311
|
+
p.ln(2)
|
|
312
|
+
h2(t["requests"])
|
|
313
|
+
n = 0
|
|
314
|
+
for d in f["deps"]:
|
|
315
|
+
for req in (d["req_exchange"], d["req_police"]):
|
|
316
|
+
n += 1
|
|
317
|
+
para(f"{n}. {req}")
|
|
318
|
+
else:
|
|
319
|
+
para(t["none"])
|
|
320
|
+
|
|
321
|
+
h2(t["method"])
|
|
322
|
+
para(f["method"])
|
|
323
|
+
p.ln(10)
|
|
324
|
+
body(10.5)
|
|
325
|
+
p.cell(0, 6, f"{t['sign']}: ________________________________", new_x="LMARGIN", new_y="NEXT")
|
|
326
|
+
return bytes(p.output())
|
|
327
|
+
|
|
328
|
+
|
|
227
329
|
def write(doc: Dict, out_dir: Path, lang: str = "en") -> List[Path]:
|
|
330
|
+
"""HTML, Markdown, JSON — and PDF when the pdf extra is installed and a font is found."""
|
|
228
331
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
229
332
|
stem = f"evidence_{doc['chain']}_{doc['check']['address'][:12]}_{lang}"
|
|
230
333
|
paths = [out_dir / f"{stem}.html", out_dir / f"{stem}.md", out_dir / f"{stem}.json"]
|
|
231
334
|
paths[0].write_text(render_html(doc, lang), encoding="utf-8")
|
|
232
335
|
paths[1].write_text(render_markdown(doc, lang), encoding="utf-8")
|
|
233
336
|
paths[2].write_text(json.dumps(doc, ensure_ascii=False, indent=1, default=str), encoding="utf-8")
|
|
337
|
+
from crypttrace import pdf as pdf_mod
|
|
338
|
+
try:
|
|
339
|
+
pdf_bytes = render_pdf(doc, lang)
|
|
340
|
+
except pdf_mod.PdfError as e:
|
|
341
|
+
doc["pdf_note"] = str(e)
|
|
342
|
+
else:
|
|
343
|
+
(out_dir / f"{stem}.pdf").write_bytes(pdf_bytes)
|
|
344
|
+
paths.insert(0, out_dir / f"{stem}.pdf")
|
|
234
345
|
return paths
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""PDF output: a Unicode font and a page set up for printing.
|
|
2
|
+
|
|
3
|
+
PDF is what an exchange's compliance team or a police officer asks for. It is
|
|
4
|
+
built with fpdf2 (pure Python, the `pdf` extra) using a TrueType font found on
|
|
5
|
+
the system, so Russian text and arrows print correctly:
|
|
6
|
+
|
|
7
|
+
Windows Arial / Segoe UI macOS Arial (Supplemental)
|
|
8
|
+
Linux DejaVu Sans, Liberation Sans or Noto Sans
|
|
9
|
+
|
|
10
|
+
CRYPTTRACE_PDF_FONT (and optionally CRYPTTRACE_PDF_FONT_BOLD) points to any
|
|
11
|
+
other .ttf. Addresses and transaction hashes use the built-in Courier: they are
|
|
12
|
+
plain ASCII, and a fixed-width face keeps them readable.
|
|
13
|
+
"""
|
|
14
|
+
import os
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from typing import Optional, Tuple
|
|
17
|
+
|
|
18
|
+
CANDIDATES = [
|
|
19
|
+
("C:/Windows/Fonts/arial.ttf", "C:/Windows/Fonts/arialbd.ttf"),
|
|
20
|
+
("C:/Windows/Fonts/segoeui.ttf", "C:/Windows/Fonts/segoeuib.ttf"),
|
|
21
|
+
("/System/Library/Fonts/Supplemental/Arial.ttf", "/System/Library/Fonts/Supplemental/Arial Bold.ttf"),
|
|
22
|
+
("/Library/Fonts/Arial.ttf", "/Library/Fonts/Arial Bold.ttf"),
|
|
23
|
+
("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"),
|
|
24
|
+
("/usr/share/fonts/dejavu/DejaVuSans.ttf", "/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf"),
|
|
25
|
+
("/usr/share/fonts/TTF/DejaVuSans.ttf", "/usr/share/fonts/TTF/DejaVuSans-Bold.ttf"),
|
|
26
|
+
("/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf",
|
|
27
|
+
"/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf"),
|
|
28
|
+
("/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf", "/usr/share/fonts/truetype/noto/NotoSans-Bold.ttf"),
|
|
29
|
+
]
|
|
30
|
+
INSTALL_HINT = 'PDF needs the pdf extra: pip install "crypttrace[pdf]" (or crypttrace[web])'
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class PdfError(RuntimeError):
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def available() -> bool:
|
|
38
|
+
try:
|
|
39
|
+
import fpdf # noqa: F401
|
|
40
|
+
except ImportError:
|
|
41
|
+
return False
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def fonts() -> Tuple[str, Optional[str]]:
|
|
46
|
+
"""(regular, bold or None) TrueType files with Cyrillic, or PdfError."""
|
|
47
|
+
env = os.environ.get("CRYPTTRACE_PDF_FONT")
|
|
48
|
+
if env:
|
|
49
|
+
if not Path(env).is_file():
|
|
50
|
+
raise PdfError(f"CRYPTTRACE_PDF_FONT points to {env}, which is not a file")
|
|
51
|
+
bold = os.environ.get("CRYPTTRACE_PDF_FONT_BOLD")
|
|
52
|
+
return env, bold if bold and Path(bold).is_file() else None
|
|
53
|
+
for regular, bold in CANDIDATES:
|
|
54
|
+
if Path(regular).is_file():
|
|
55
|
+
return regular, bold if Path(bold).is_file() else None
|
|
56
|
+
raise PdfError("no TrueType font with Cyrillic was found for the PDF; install DejaVu Sans "
|
|
57
|
+
"(fonts-dejavu-core) or set CRYPTTRACE_PDF_FONT to a .ttf file")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def document(title: str):
|
|
61
|
+
"""An A4 FPDF with the Unicode font registered as "body" (regular and bold)."""
|
|
62
|
+
if not available():
|
|
63
|
+
raise PdfError(INSTALL_HINT)
|
|
64
|
+
from fpdf import FPDF
|
|
65
|
+
|
|
66
|
+
regular, bold = fonts()
|
|
67
|
+
|
|
68
|
+
class _Doc(FPDF):
|
|
69
|
+
def footer(self):
|
|
70
|
+
self.set_y(-12)
|
|
71
|
+
self.set_font("body", size=8)
|
|
72
|
+
self.set_text_color(110)
|
|
73
|
+
self.cell(0, 6, f"{title} · {self.page_no()}/{{nb}}", align="C")
|
|
74
|
+
self.set_text_color(0)
|
|
75
|
+
|
|
76
|
+
pdf = _Doc(format="A4")
|
|
77
|
+
pdf.set_title(title)
|
|
78
|
+
pdf.set_creator("crypttrace")
|
|
79
|
+
pdf.add_font("body", "", regular)
|
|
80
|
+
pdf.add_font("body", "B", bold or regular)
|
|
81
|
+
pdf.set_margins(18, 16, 18)
|
|
82
|
+
pdf.set_auto_page_break(True, margin=18)
|
|
83
|
+
pdf.alias_nb_pages()
|
|
84
|
+
pdf.add_page()
|
|
85
|
+
pdf.set_font("body", size=10.5)
|
|
86
|
+
return pdf
|
|
@@ -662,11 +662,13 @@ async function loadCheck(a){
|
|
|
662
662
|
}
|
|
663
663
|
const left=(r.remaining_tokens||[]).map(x=>`${Number(x.amount).toLocaleString()} ${esc(x.symbol)}`)
|
|
664
664
|
.concat(r.remaining_nfts?[`${r.remaining_nfts} NFT`]:[]);
|
|
665
|
-
const ev=l=>`/api/evidence-pack?address=${q(a)}&chain=${chain()}&lang=${l}`;
|
|
665
|
+
const ev=(l,f)=>`/api/evidence-pack?address=${q(a)}&chain=${chain()}&lang=${l}${f?`&format=${f}`:''}`;
|
|
666
666
|
h+=`<div style="margin-top:14px">
|
|
667
|
-
<a class="btnlink" href="${ev('en')}">Evidence pack for the exchange (EN) ⬇</a>
|
|
668
|
-
<a class="btnlink" href="${ev('ru')}">Для полиции (RU) ⬇</a>
|
|
669
|
-
<
|
|
667
|
+
<a class="btnlink" href="${ev('en','pdf')}">Evidence pack for the exchange (EN, PDF) ⬇</a>
|
|
668
|
+
<a class="btnlink" href="${ev('ru','pdf')}">Для полиции (RU, PDF) ⬇</a>
|
|
669
|
+
<a class="btnlink" href="${ev('en')}">EN, HTML</a>
|
|
670
|
+
<a class="btnlink" href="${ev('ru')}">RU, HTML</a>
|
|
671
|
+
<div class="muted" style="margin-top:6px">Print it, fill in your name and contact, and send it with your report.</div></div>`;
|
|
670
672
|
h+=`<h3 style="margin-top:16px">What to do now</h3><ol>
|
|
671
673
|
<li>This seed phrase is burned. Make a new wallet with a new seed phrase; never type it into a site, bot or "support" chat again.</li>
|
|
672
674
|
${left.length?`<li>Move what is still here to the new wallet right away: ${left.join(', ')}.</li>`:''}
|
|
@@ -226,8 +226,18 @@ def create_app() -> Flask:
|
|
|
226
226
|
doc = ev.build(addr, chain)
|
|
227
227
|
except _KNOWN_ERRORS as e:
|
|
228
228
|
return jsonify({"error": str(e)}), 400
|
|
229
|
+
name = f"evidence_{chain}_{addr[:12]}_{lang}"
|
|
230
|
+
if request.args.get("format") == "pdf":
|
|
231
|
+
from crypttrace import pdf as pdf_mod
|
|
232
|
+
try:
|
|
233
|
+
body = ev.render_pdf(doc, lang)
|
|
234
|
+
except pdf_mod.PdfError as e:
|
|
235
|
+
return jsonify({"error": str(e)}), 400
|
|
236
|
+
resp = app.response_class(body, mimetype="application/pdf")
|
|
237
|
+
resp.headers["Content-Disposition"] = f"attachment; filename={name}.pdf"
|
|
238
|
+
return resp
|
|
229
239
|
resp = app.response_class(ev.render_html(doc, lang), mimetype="text/html")
|
|
230
|
-
resp.headers["Content-Disposition"] = f"attachment; filename=
|
|
240
|
+
resp.headers["Content-Disposition"] = f"attachment; filename={name}.html"
|
|
231
241
|
return resp
|
|
232
242
|
|
|
233
243
|
@app.route("/api/victims")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crypttrace
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.35.0
|
|
4
4
|
Summary: OSINT toolkit for crypto investigations: trace stolen funds across Ethereum, Bitcoin, Tron, Solana and TON
|
|
5
5
|
Author: bobslayerX
|
|
6
6
|
License-Expression: MIT
|
|
@@ -30,6 +30,9 @@ Requires-Dist: rich>=13.0
|
|
|
30
30
|
Requires-Dist: requests>=2.31
|
|
31
31
|
Provides-Extra: web
|
|
32
32
|
Requires-Dist: flask>=3.0; extra == "web"
|
|
33
|
+
Requires-Dist: fpdf2>=2.7; extra == "web"
|
|
34
|
+
Provides-Extra: pdf
|
|
35
|
+
Requires-Dist: fpdf2>=2.7; extra == "pdf"
|
|
33
36
|
Dynamic: license-file
|
|
34
37
|
|
|
35
38
|
# crypttrace
|
|
@@ -67,8 +70,8 @@ USDC blacklisted by Tether and Circle, and the first funding of the wallet —
|
|
|
67
70
|
pipx install "crypttrace[web]" # or: pip install "crypttrace[web]"
|
|
68
71
|
```
|
|
69
72
|
|
|
70
|
-
`[web]` also installs Flask for the web UI
|
|
71
|
-
alone. Python 3.10 or newer. To work on the code instead:
|
|
73
|
+
`[web]` also installs Flask for the web UI and fpdf2 for PDF evidence packs; leave
|
|
74
|
+
it off for the terminal tool alone (`[pdf]` adds only the PDF part). Python 3.10 or newer. To work on the code instead:
|
|
72
75
|
|
|
73
76
|
```bash
|
|
74
77
|
git clone https://github.com/bobslayerX/crypttrace
|
|
@@ -188,8 +191,14 @@ deposit and its memo with the hash of each hop, a precise request to the
|
|
|
188
191
|
exchange (freeze the account behind the memo, preserve KYC, login and
|
|
189
192
|
withdrawal records) and to the police (request them through the exchange's
|
|
190
193
|
law-enforcement channel), and how it was established — so anyone can check it.
|
|
191
|
-
Name, contact and signature are left blank to fill in. Saved as
|
|
192
|
-
PDF
|
|
194
|
+
Name, contact and signature are left blank to fill in. Saved as a printable
|
|
195
|
+
**PDF** (A4, every transaction a clickable link), plus HTML, Markdown and JSON;
|
|
196
|
+
the **Was I drained?** tab has PDF and HTML downloads in both languages.
|
|
197
|
+
|
|
198
|
+
The PDF needs the `pdf` extra (part of `web`): `pip install "crypttrace[pdf]"`.
|
|
199
|
+
It uses a system font with Cyrillic — Arial or Segoe UI on Windows and macOS,
|
|
200
|
+
DejaVu, Liberation or Noto Sans on Linux — or the `.ttf` named by
|
|
201
|
+
`CRYPTTRACE_PDF_FONT`. Without them the pack is still saved, as HTML to print.
|
|
193
202
|
|
|
194
203
|
## Web UI
|
|
195
204
|
|
|
@@ -769,6 +778,7 @@ src/crypttrace/
|
|
|
769
778
|
watch.py # watchlist + alerts
|
|
770
779
|
case.py # investigations as files: addresses, roles, notes, snapshots
|
|
771
780
|
report.py # Markdown + JSON reports
|
|
781
|
+
pdf.py # PDF page setup and font discovery (evidence packs)
|
|
772
782
|
export.py # traced graph as GraphML (Gephi) and edge-list CSV (Maltego)
|
|
773
783
|
prices.py # USD valuation
|
|
774
784
|
render.py # rich terminal rendering
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|