scancrypt 1.0.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.
Files changed (53) hide show
  1. scancrypt-1.0.0/LICENSE +201 -0
  2. scancrypt-1.0.0/NOTICE +14 -0
  3. scancrypt-1.0.0/PKG-INFO +270 -0
  4. scancrypt-1.0.0/README.md +242 -0
  5. scancrypt-1.0.0/pyproject.toml +53 -0
  6. scancrypt-1.0.0/setup.cfg +4 -0
  7. scancrypt-1.0.0/src/rprt/__init__.py +1 -0
  8. scancrypt-1.0.0/src/rprt/__main__.py +8 -0
  9. scancrypt-1.0.0/src/rprt/batch.py +186 -0
  10. scancrypt-1.0.0/src/rprt/carve.py +186 -0
  11. scancrypt-1.0.0/src/rprt/cli.py +700 -0
  12. scancrypt-1.0.0/src/rprt/engine.py +832 -0
  13. scancrypt-1.0.0/src/rprt/fingerprint.py +256 -0
  14. scancrypt-1.0.0/src/rprt/forensics.py +158 -0
  15. scancrypt-1.0.0/src/rprt/formats.py +179 -0
  16. scancrypt-1.0.0/src/rprt/gui.py +2044 -0
  17. scancrypt-1.0.0/src/rprt/ntfs.py +1055 -0
  18. scancrypt-1.0.0/src/rprt/ransomnote.py +139 -0
  19. scancrypt-1.0.0/src/rprt/report.py +525 -0
  20. scancrypt-1.0.0/src/rprt/signatures.py +183 -0
  21. scancrypt-1.0.0/src/rprt/signatures.yaml +111 -0
  22. scancrypt-1.0.0/src/rprt/source.py +133 -0
  23. scancrypt-1.0.0/src/rprt/sqlpages.py +309 -0
  24. scancrypt-1.0.0/src/rprt/stats.py +106 -0
  25. scancrypt-1.0.0/src/rprt/supervise.py +485 -0
  26. scancrypt-1.0.0/src/rprt/worker.py +140 -0
  27. scancrypt-1.0.0/src/scancrypt.egg-info/PKG-INFO +270 -0
  28. scancrypt-1.0.0/src/scancrypt.egg-info/SOURCES.txt +51 -0
  29. scancrypt-1.0.0/src/scancrypt.egg-info/dependency_links.txt +1 -0
  30. scancrypt-1.0.0/src/scancrypt.egg-info/entry_points.txt +5 -0
  31. scancrypt-1.0.0/src/scancrypt.egg-info/requires.txt +14 -0
  32. scancrypt-1.0.0/src/scancrypt.egg-info/top_level.txt +1 -0
  33. scancrypt-1.0.0/tests/test_batch.py +121 -0
  34. scancrypt-1.0.0/tests/test_browser_tree.py +227 -0
  35. scancrypt-1.0.0/tests/test_carve.py +130 -0
  36. scancrypt-1.0.0/tests/test_compressed_vs_encrypted.py +93 -0
  37. scancrypt-1.0.0/tests/test_container_override.py +92 -0
  38. scancrypt-1.0.0/tests/test_engine.py +273 -0
  39. scancrypt-1.0.0/tests/test_fingerprint.py +77 -0
  40. scancrypt-1.0.0/tests/test_forensics.py +109 -0
  41. scancrypt-1.0.0/tests/test_formats.py +83 -0
  42. scancrypt-1.0.0/tests/test_frozen_startup.py +27 -0
  43. scancrypt-1.0.0/tests/test_ntfs.py +589 -0
  44. scancrypt-1.0.0/tests/test_ransomnote.py +99 -0
  45. scancrypt-1.0.0/tests/test_report.py +158 -0
  46. scancrypt-1.0.0/tests/test_signatures.py +133 -0
  47. scancrypt-1.0.0/tests/test_signatures_yaml.py +88 -0
  48. scancrypt-1.0.0/tests/test_source.py +78 -0
  49. scancrypt-1.0.0/tests/test_sqlpages.py +154 -0
  50. scancrypt-1.0.0/tests/test_stats.py +64 -0
  51. scancrypt-1.0.0/tests/test_supervise.py +206 -0
  52. scancrypt-1.0.0/tests/test_threshold.py +62 -0
  53. scancrypt-1.0.0/tests/test_worker.py +64 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 IronSights Pty Ltd
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
scancrypt-1.0.0/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ ScanCrypt, ransomware partial-recovery tool
2
+ Copyright 2026 IronSights Pty Ltd
3
+
4
+ This product includes software developed by IronSights Pty Ltd
5
+ (https://ironsights.com.au).
6
+
7
+ Licensed under the Apache License, Version 2.0. See the LICENSE file.
8
+
9
+ ScanCrypt recovers the portions of ransomware-encrypted files that were never
10
+ actually encrypted. It is NOT a decryptor and does not break, weaken, or bypass
11
+ any cryptography. It reads evidence strictly read-only and never modifies the
12
+ files or devices it scans. It is provided free of charge and AS IS, without
13
+ warranty of any kind and without liability, for lawful use on systems the
14
+ operator is authorized to examine.
@@ -0,0 +1,270 @@
1
+ Metadata-Version: 2.4
2
+ Name: scancrypt
3
+ Version: 1.0.0
4
+ Summary: ScanCrypt: finds and extracts the parts of a ransomware-encrypted file that were never actually encrypted.
5
+ Author-email: IronSights <team@scancrypt.org>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/ironsightscyber/scancrypt
8
+ Project-URL: Source, https://github.com/ironsightscyber/scancrypt
9
+ Project-URL: Issues, https://github.com/ironsightscyber/scancrypt/issues
10
+ Keywords: ransomware,incident-response,dfir,data-recovery,forensics,entropy
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ License-File: NOTICE
15
+ Requires-Dist: PySide6>=6.6
16
+ Requires-Dist: numpy>=1.26
17
+ Requires-Dist: PyYAML>=6.0
18
+ Provides-Extra: ntfs
19
+ Requires-Dist: dissect.ntfs>=3; extra == "ntfs"
20
+ Requires-Dist: dissect.hypervisor>=3; extra == "ntfs"
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=7.0; extra == "dev"
23
+ Requires-Dist: pyinstaller>=6.0; extra == "dev"
24
+ Requires-Dist: dissect.ntfs>=3; extra == "dev"
25
+ Requires-Dist: dissect.hypervisor>=3; extra == "dev"
26
+ Requires-Dist: pillow>=10; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # ScanCrypt — get back the data the ransomware never touched
30
+
31
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
32
+ [![CI](https://github.com/ironsightscyber/scancrypt/actions/workflows/ci.yml/badge.svg)](https://github.com/ironsightscyber/scancrypt/actions)
33
+
34
+ Most ransomware is in a race: encrypting terabytes takes hours, so to finish before
35
+ it's caught it only scrambles **part** of each large file — the first chunk, or stripes
36
+ through it — then renames it so everything *looks* equally dead. It usually isn't.
37
+
38
+ **ScanCrypt** scans an encrypted file or disk, measures exactly which bytes were never
39
+ actually encrypted, and pulls those bytes back out — **no decryption key, no ransom.**
40
+ It is not a decryptor; it's a ransomware-aware *partial-recovery* tool. Databases, VM
41
+ disks, and backup archives are typically **mostly intact** underneath.
42
+
43
+ Free and open source (Apache-2.0), **read-only**, by [IronSights](https://ironsights.com.au) ·
44
+ [scancrypt.org](https://scancrypt.org) · [Plain-English guide for victims](docs/recover.html)
45
+
46
+ > **Honest by design.** Recoverability is always reported as *most, not all*, with the
47
+ > measured percentage. A partial file list is flagged as partial, never passed off as
48
+ > complete. Family IDs are labelled *validated* vs *from public reporting*. Fully-encrypted
49
+ > and small files are out of scope. Provided AS IS, no warranty; use only on systems you
50
+ > are authorised to examine.
51
+
52
+ ---
53
+
54
+ ## Install
55
+
56
+ **Just want to run it?** Download the app from the
57
+ [releases page](https://github.com/ironsightscyber/scancrypt/releases/latest) —
58
+ `scancrypt-gui.exe` (Windows) is a single portable file, nothing to install, fully offline.
59
+ No terminal needed. New to this? Read the [plain-English guide](docs/recover.html).
60
+
61
+ **From source (any OS):**
62
+
63
+ ```bash
64
+ python3 -m venv .venv
65
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
66
+ pip install -e ".[ntfs]" # ".[ntfs]" adds VHDX/VHD/VMDK + NTFS support
67
+ scancrypt --help # or: python -m rprt --help
68
+ ```
69
+
70
+ `dissect.hypervisor` + `dissect.ntfs` (pulled in by `[ntfs]`) are what let ScanCrypt read
71
+ files out of a virtual disk. Everything else works without them.
72
+
73
+ ---
74
+
75
+ ## Quickstart
76
+
77
+ ### 1. How much of a file/disk is recoverable?
78
+
79
+ ```bash
80
+ scancrypt "SQL_DATA_D.vhdx"
81
+ ```
82
+
83
+ ```
84
+ size 108.5 GB
85
+ pattern front-only
86
+ recoverable 100.0%
87
+ encrypted 0.0002% 258 KB at the front
88
+ family Makop / Phobos (validated)
89
+ ```
90
+
91
+ Add `--report triage.html` for a shareable HTML report, `--json out.json` for machine output.
92
+ Scans stay fast **even on huge disks** — a 322 GB VM images in seconds, because finding the
93
+ encryption boundary doesn't require reading the whole file.
94
+
95
+ ### 2. Recover files from a virtual disk (the headline workflow)
96
+
97
+ Ransomware often encrypts a VM disk's header, so it won't mount. ScanCrypt rebuilds the disk
98
+ from the block map that survived and reads the files straight out — names and folders intact.
99
+
100
+ ```bash
101
+ scancrypt "SQL_DATA_D.vhdx" --list-volume # see what's inside
102
+ scancrypt "SQL_DATA_D.vhdx" --recover-files ./out # copy the files out
103
+ ```
104
+
105
+ Recover only specific files (near-instant, no full walk):
106
+
107
+ ```bash
108
+ printf '/Program Files/.../DATA/production.mdf\n' > paths.txt
109
+ scancrypt "SQL_DATA_D.vhdx" --recover-files ./out --only-paths paths.txt
110
+ ```
111
+
112
+ If part of the disk didn't survive, the file list says so (`… (partial)`) instead of
113
+ pretending it's complete.
114
+
115
+ ### 3. Check a recovered SQL Server database
116
+
117
+ ```bash
118
+ scancrypt recovered.mdf --validate-sql
119
+ ```
120
+
121
+ ```
122
+ 253,478 valid SQL Server page(s) (90.6%) verdict: sql-data-present
123
+ database name: production_db
124
+ ```
125
+
126
+ A page-level integrity check (a structural analogue to DBCC), so you know what you got back
127
+ before handing it to a DBA.
128
+
129
+ ### 4. Triage a whole share at once
130
+
131
+ ```bash
132
+ scancrypt /mnt/encrypted_share --report incident.html --csv incident.csv
133
+ ```
134
+
135
+ One incident-wide figure — *"across N files totalling X TB, this fraction is recoverable for
136
+ free"* — with a per-file breakdown for a client or insurer.
137
+
138
+ ### 5. Extract the intact bytes of a single large file
139
+
140
+ ```bash
141
+ scancrypt victim.bin --extract recovered.bin
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Common options
147
+
148
+ | Flag | What it does |
149
+ |------|--------------|
150
+ | `--report FILE` | standalone HTML triage report (add `--hash` to embed a SHA-256) |
151
+ | `--json FILE` | full machine-readable report |
152
+ | `--list-volume` | list every file in a virtual disk's NTFS volume |
153
+ | `--recover-files DIR` | recover files from a VHDX/VHD/VMDK (rebuilds an encrypted-header disk) |
154
+ | `--only-paths FILE` | with `--recover-files`, restrict to listed paths |
155
+ | `--validate-sql` | page-level check of a recovered SQL Server MDF/NDF |
156
+ | `--fingerprint` | emit a privacy-safe family signature stub + pre-filled issue link (no file contents) |
157
+ | `--extract FILE` | write the intact byte ranges of a single file |
158
+ | `--carve DIR` | carve loose files from the recoverable region (needs PhotoRec) |
159
+ | `--boundary-only` | accept the fast front-boundary result; never do a full-disk read |
160
+ | `--full` | force a full block-by-block scan (precise map, reads the whole file) |
161
+ | `--audit-log FILE` | hash-chained, tamper-evident audit trail (+ `--case-id`, `--examiner`, `--evidence-id`) |
162
+
163
+ Scan a raw disk in place (Windows, elevated prompt): `scancrypt \\.\PhysicalDrive1 --json triage.json`
164
+
165
+ Evidence-grade run and later verification:
166
+
167
+ ```bash
168
+ scancrypt disk.img --extract out.bin --audit-log audit.jsonl \
169
+ --case-id CASE-0001 --examiner "A. Analyst" --evidence-id DISK-01
170
+ python -c "from rprt import forensics; print(forensics.verify_log('audit.jsonl'))"
171
+ ```
172
+
173
+ ---
174
+
175
+ ## How it works (four read-only stages)
176
+
177
+ 1. **Map the encryption.** An entropy scan brackets where the encryption starts and stops,
178
+ then binary-searches down to the byte. It stays cheap on huge disks and only escalates to
179
+ a full read when the evidence points to a genuine second encrypted region — not to the
180
+ scattered high-entropy blocks (databases, compressed content) that are normal on any disk.
181
+ 2. **Tell ciphertext from compression.** Encrypted and compressed data both look random; a
182
+ chi-square test plus archive-header checks separate real ciphertext from an ordinary zip,
183
+ image, or database blob, so recoverable data isn't written off.
184
+ 3. **Report the number.** A recoverable percentage, an entropy map, the strain, and the
185
+ limits stated plainly — per file, or rolled up across a whole share.
186
+ 4. **Recover.** Extract intact byte ranges; pull files out of a virtual disk (even one whose
187
+ header was destroyed); validate a recovered SQL database; carve loose files. Hashes are
188
+ recorded throughout.
189
+
190
+ Recovery is **family-agnostic** — a wrong or unknown family guess never affects what comes
191
+ back; identification only names the strain and sets expectations. Validated families
192
+ (matched against real samples) vs public-reporting-only ones are labelled as such.
193
+
194
+ ---
195
+
196
+ ## Honest limits
197
+
198
+ - Not decryption — it recovers bytes that were never encrypted; the rest stays locked.
199
+ - Recovery is *most, not all*; the report gives a measured figure, not a promise every file opens.
200
+ - Small files are usually encrypted end-to-end. The value is in big files: databases, VM disks, backups, media.
201
+ - Periodic/intermittent patterns recover less cleanly than front-only.
202
+ - No warranty, no liability. Authorised systems only.
203
+
204
+ ---
205
+
206
+ ## For developers
207
+
208
+ ### Dev setup
209
+
210
+ ```bash
211
+ python3 -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
212
+ pip install -e ".[dev]"
213
+ pytest
214
+ ```
215
+
216
+ Run the GUI locally (works on macOS/Linux for development): `python -m rprt.gui`
217
+
218
+ ### Build the Windows app
219
+
220
+ Must run on Windows (PyInstaller doesn't cross-compile):
221
+
222
+ ```powershell
223
+ python -m venv .venv; .venv\Scripts\activate
224
+ pip install -e ".[dev]"
225
+ python build_scripts\build_windows.py # -> dist\rprt-gui.exe (single file, no installer)
226
+ ```
227
+
228
+ CI runs the suite on Ubuntu + Windows on every push and builds `rprt-gui.exe`; pushing a
229
+ `v*` tag attaches it to a GitHub release.
230
+
231
+ ### Module map
232
+
233
+ | Module | Responsibility |
234
+ |--------|----------------|
235
+ | `engine.py` | core scan / classify / boundary-search / extract |
236
+ | `stats.py` | chi-square randomness test (encrypted vs compressed) |
237
+ | `signatures.py` · `ransomnote.py` | ransomware fingerprinting from extension/footer and from ransom notes |
238
+ | `formats.py` | container/filesystem detection on the recoverable region (VHDX, ZIP/OOXML, NTFS/FAT, …) |
239
+ | `ntfs.py` | read files out of an NTFS volume inside a partially-encrypted / header-encrypted virtual disk |
240
+ | `sqlpages.py` | page-level SQL Server MDF/NDF recovery-quality check |
241
+ | `carve.py` | orchestrates PhotoRec over the recoverable region |
242
+ | `batch.py` | incident-wide directory triage + rollup |
243
+ | `report.py` | standalone HTML triage report (inline CSS + SVG entropy map) |
244
+ | `forensics.py` | before/after integrity proof + hash-chained audit log + case metadata |
245
+ | `source.py` | read-only input abstraction (files, images, raw Windows devices) |
246
+ | `gui.py` · `cli.py` | PySide6 desktop app · command-line entry point |
247
+
248
+ ### Help ScanCrypt recognise a strain it doesn't name yet
249
+
250
+ Point it at one encrypted file:
251
+
252
+ ```bash
253
+ scancrypt "somefile.newcrypt" --fingerprint
254
+ ```
255
+
256
+ It prints a **privacy-safe** stub — extension, the family's trailing magic-candidate bytes,
257
+ the encryption pattern, and any nearby ransom note — as a ready-to-paste `signatures.yaml`
258
+ block **and** a pre-filled [GitHub issue](https://github.com/ironsightscyber/scancrypt/issues/new?template=ransomware-sample.yml)
259
+ link. It reads **no file contents**, so a victim can submit safely. (In the app: *Help improve
260
+ ScanCrypt…* after a scan.)
261
+
262
+ Contributions welcome — especially **new verified family signatures** (see
263
+ [CONTRIBUTING.md](CONTRIBUTING.md)).
264
+
265
+ ---
266
+
267
+ *ScanCrypt does not break, weaken, or bypass cryptography, and it does not recover
268
+ fully-encrypted data. Need an incident handled end to end — full extraction, database
269
+ rebuilds, forensic reporting? [IronSights](https://ironsights.com.au) does that as a paid
270
+ engagement; the tool stays free.*