@slicedearth/whoisleuth-cli 1.32.0
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.
- package/LICENSE +661 -0
- package/LICENSES/Retire.js-Apache-2.0.txt +199 -0
- package/NOTICE +76 -0
- package/README.md +84 -0
- package/TRADEMARKS.md +41 -0
- package/bin/whoisleuth.mjs +35 -0
- package/cli/archive-inspect.mjs +198 -0
- package/cli/arguments.mjs +1022 -0
- package/cli/artifact-verify.mjs +210 -0
- package/cli/bulk-checkpoint.mjs +218 -0
- package/cli/bulk-command-runner.mjs +109 -0
- package/cli/bulk-output.mjs +112 -0
- package/cli/bulk.mjs +133 -0
- package/cli/compare.mjs +238 -0
- package/cli/completion.mjs +175 -0
- package/cli/csv.mjs +1 -0
- package/cli/discover.mjs +50 -0
- package/cli/discovery-command-runner.mjs +36 -0
- package/cli/discovery-observation-snapshot.mjs +315 -0
- package/cli/discovery-scan-command-runner.mjs +141 -0
- package/cli/discovery-scan.mjs +325 -0
- package/cli/discovery-snapshot.mjs +133 -0
- package/cli/discovery-workflow.mjs +73 -0
- package/cli/doctor.mjs +137 -0
- package/cli/errors.mjs +21 -0
- package/cli/evidence-command-arguments.mjs +145 -0
- package/cli/evidence-command-runner.mjs +106 -0
- package/cli/evidence-signing.mjs +215 -0
- package/cli/exit-codes.mjs +9 -0
- package/cli/export-evidence.mjs +28 -0
- package/cli/formatters/evidence-report.mjs +3 -0
- package/cli/formatters/html.mjs +69 -0
- package/cli/formatters/json.mjs +135 -0
- package/cli/formatters/markdown.mjs +3 -0
- package/cli/formatters/terminal.mjs +658 -0
- package/cli/http.mjs +27 -0
- package/cli/lookup-command-runner.mjs +87 -0
- package/cli/lookup-diff.mjs +171 -0
- package/cli/mail-review.mjs +204 -0
- package/cli/manual.mjs +34 -0
- package/cli/network-command-runner.mjs +88 -0
- package/cli/output-file.mjs +97 -0
- package/cli/page-compare.mjs +123 -0
- package/cli/posture.mjs +20 -0
- package/cli/progress-events.mjs +53 -0
- package/cli/progress.mjs +56 -0
- package/cli/registry-access.mjs +3 -0
- package/cli/registry-support.mjs +120 -0
- package/cli/risk-calibration.mjs +294 -0
- package/cli/runner-types.mjs +1 -0
- package/cli/runner.mjs +726 -0
- package/cli/saved-lookup.mjs +87 -0
- package/cli/source-reliability.mjs +727 -0
- package/cli/strict-exit.mjs +55 -0
- package/cli/terminal-presentation.mjs +147 -0
- package/docs/cli.md +827 -0
- package/frontend/src/lib/analysis/acquisition-decision-packet.js +93 -0
- package/frontend/src/lib/analysis/acquisition-due-diligence.js +391 -0
- package/frontend/src/lib/analysis/artifact-integrity.js +21 -0
- package/frontend/src/lib/analysis/brand-profile-model.js +421 -0
- package/frontend/src/lib/analysis/bulk-domain-comparison.js +246 -0
- package/frontend/src/lib/analysis/bulk-mail-exposure.js +192 -0
- package/frontend/src/lib/analysis/bulk-retry-plan.js +86 -0
- package/frontend/src/lib/analysis/bulk-review-export.js +62 -0
- package/frontend/src/lib/analysis/bulk-review-model.js +266 -0
- package/frontend/src/lib/analysis/bulk-session-model.js +515 -0
- package/frontend/src/lib/analysis/bulk-sort.js +49 -0
- package/frontend/src/lib/analysis/campaign-model.js +265 -0
- package/frontend/src/lib/analysis/case-evidence-model.js +642 -0
- package/frontend/src/lib/analysis/case-migration-model.js +248 -0
- package/frontend/src/lib/analysis/case-model.js +5 -0
- package/frontend/src/lib/analysis/case-record-contracts.js +44 -0
- package/frontend/src/lib/analysis/case-record-core.js +232 -0
- package/frontend/src/lib/analysis/case-record-model.js +7 -0
- package/frontend/src/lib/analysis/case-record-operations.js +224 -0
- package/frontend/src/lib/analysis/case-response-model.js +640 -0
- package/frontend/src/lib/analysis/case-response-packet.js +573 -0
- package/frontend/src/lib/analysis/case-storage-model.js +93 -0
- package/frontend/src/lib/analysis/detection-rule-model.js +306 -0
- package/frontend/src/lib/analysis/dns-record-normalization.js +11 -0
- package/frontend/src/lib/analysis/http-summary.js +165 -0
- package/frontend/src/lib/analysis/investigation-guide.js +500 -0
- package/frontend/src/lib/analysis/investigation-template-model.js +144 -0
- package/frontend/src/lib/analysis/page-baseline.js +272 -0
- package/frontend/src/lib/analysis/page-similarity.js +179 -0
- package/frontend/src/lib/analysis/relationship-evidence.js +265 -0
- package/frontend/src/lib/analysis/relationship-observation-model.js +423 -0
- package/frontend/src/lib/analysis/scoring.js +135 -0
- package/frontend/src/lib/analysis/shortlist-model.js +209 -0
- package/frontend/src/lib/analysis/utils.js +265 -0
- package/frontend/src/lib/analysis/watchlist-history.js +643 -0
- package/frontend/src/lib/analysis/watchlist-store.js +127 -0
- package/frontend/src/lib/analysis/website-snapshot-model.js +302 -0
- package/frontend/src/lib/analysis/workspace-archive-crypto.js +282 -0
- package/frontend/src/lib/analysis/workspace-archive.js +472 -0
- package/lib/abort.mjs +26 -0
- package/lib/abusech-auth.mjs +19 -0
- package/lib/availability.mjs +716 -0
- package/lib/bounded-contract-normalizers.mjs +61 -0
- package/lib/browser-library-profile.mjs +310 -0
- package/lib/bulk-comparison-evidence.mjs +83 -0
- package/lib/classify.mjs +93 -0
- package/lib/client-behavior-profile.mjs +83 -0
- package/lib/credential-surface-profile.mjs +66 -0
- package/lib/csv.mjs +23 -0
- package/lib/ct-query.mjs +27 -0
- package/lib/ct-search.mjs +393 -0
- package/lib/distributed-operation-budget.mjs +461 -0
- package/lib/dns-delegation-health.mjs +344 -0
- package/lib/dns-intelligence.mjs +739 -0
- package/lib/dns-mx.mjs +24 -0
- package/lib/dns-resolver-selection.mjs +33 -0
- package/lib/domain-posture-analysis.mjs +254 -0
- package/lib/domain-posture-parsers.mjs +358 -0
- package/lib/domain-posture.mjs +745 -0
- package/lib/error-detail.mjs +10 -0
- package/lib/evidence-export.mjs +431 -0
- package/lib/evidence-report-markdown.mjs +71 -0
- package/lib/evidence-report.mjs +391 -0
- package/lib/external-intelligence-risk.mjs +108 -0
- package/lib/favicon.mjs +146 -0
- package/lib/feature-policy.mjs +70 -0
- package/lib/generated/retire-browser-catalog.mjs +8724 -0
- package/lib/generated/unicode-confusables-17.mjs +93 -0
- package/lib/hostname.mjs +38 -0
- package/lib/html-signals.mjs +680 -0
- package/lib/http-intelligence.mjs +232 -0
- package/lib/idn-confusable-policy.mjs +86 -0
- package/lib/idn-confusables.mjs +465 -0
- package/lib/lookup-cache.mjs +130 -0
- package/lib/lookup-progress.mjs +291 -0
- package/lib/lookup-source-progress.mjs +109 -0
- package/lib/lookup-threat-provider-inventory.mjs +13 -0
- package/lib/lookup.mjs +592 -0
- package/lib/observation.mjs +114 -0
- package/lib/observed-network-context.mjs +355 -0
- package/lib/operation-budget.mjs +489 -0
- package/lib/page-fingerprints.mjs +481 -0
- package/lib/page-role-profile.mjs +117 -0
- package/lib/perceptual-hash.mjs +451 -0
- package/lib/rdap-attempts.mjs +34 -0
- package/lib/rdap-bootstrap.mjs +173 -0
- package/lib/rdap-capabilities.mjs +292 -0
- package/lib/rdap-client.mjs +125 -0
- package/lib/rdap-normalization.mjs +691 -0
- package/lib/rdap-registrar.mjs +196 -0
- package/lib/rdap-transport.mjs +39 -0
- package/lib/rdap-types.mjs +1 -0
- package/lib/rdap-validation.mjs +94 -0
- package/lib/rdap.mjs +16 -0
- package/lib/registry-access.mjs +32 -0
- package/lib/registry-capabilities.mjs +117 -0
- package/lib/registry-capability-catalogue.mjs +1206 -0
- package/lib/registry-comparison.mjs +318 -0
- package/lib/registry-dates.mjs +190 -0
- package/lib/registry-insights.mjs +325 -0
- package/lib/response-policy.mjs +256 -0
- package/lib/risk-scoring.mjs +164 -0
- package/lib/safe-fetch.mjs +446 -0
- package/lib/security-txt.mjs +359 -0
- package/lib/service-binding-dns.mjs +608 -0
- package/lib/sslbl-certificates.generated.mjs +143 -0
- package/lib/sslbl-intelligence.mjs +241 -0
- package/lib/static-html-analysis.mjs +340 -0
- package/lib/structured-data-identity.mjs +323 -0
- package/lib/threat-intelligence-contract.mjs +5 -0
- package/lib/threat-intelligence-definition-registry.mjs +34 -0
- package/lib/threat-intelligence-fixtures.mjs +82 -0
- package/lib/threat-intelligence-manifests.mjs +512 -0
- package/lib/threat-intelligence-runtime.mjs +662 -0
- package/lib/threat-intelligence-targets.mjs +168 -0
- package/lib/threat-intelligence-types.mjs +3 -0
- package/lib/threatfox-intelligence.mjs +307 -0
- package/lib/tls-intelligence.mjs +814 -0
- package/lib/typosquat-generator.mjs +884 -0
- package/lib/urlhaus-intelligence.mjs +361 -0
- package/lib/urlscan-intelligence.mjs +349 -0
- package/lib/website-security-posture.mjs +325 -0
- package/lib/website-technology.mjs +437 -0
- package/lib/whois-authority.mjs +98 -0
- package/lib/whois-chain.mjs +261 -0
- package/lib/whois-contacts.mjs +163 -0
- package/lib/whois-contracts.mjs +3 -0
- package/lib/whois-normalization.mjs +27 -0
- package/lib/whois-transport.mjs +100 -0
- package/lib/whois-values.mjs +92 -0
- package/lib/whois.mjs +1187 -0
- package/package.json +55 -0
- package/third-party-notices.txt +5571 -0
|
@@ -0,0 +1,199 @@
|
|
|
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
|
|
95
|
+
Derivative 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 by You
|
|
132
|
+
to the Licensor shall be under the terms and conditions of this License,
|
|
133
|
+
without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify the
|
|
135
|
+
terms of any separate license agreement you may have executed with
|
|
136
|
+
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 implied,
|
|
147
|
+
including, without limitation, any warranties or conditions of TITLE,
|
|
148
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
149
|
+
You are solely responsible for determining the appropriateness of using
|
|
150
|
+
or redistributing the Work and assume any risks associated with Your
|
|
151
|
+
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 liable
|
|
157
|
+
to You for damages, including any direct, indirect, special, incidental,
|
|
158
|
+
or consequential damages of any character arising as a result of this
|
|
159
|
+
License or out of the use or inability to use the Work (including but not
|
|
160
|
+
limited to damages for loss of goodwill, work stoppage, computer failure
|
|
161
|
+
or malfunction, or any and all other commercial damages or losses), even
|
|
162
|
+
if such Contributor has been advised of the possibility of such damages.
|
|
163
|
+
|
|
164
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
165
|
+
the Work or Derivative Works thereof, You may choose to offer, and charge
|
|
166
|
+
a fee for, acceptance of support, warranty, indemnity, or other liability
|
|
167
|
+
obligations and/or rights consistent with this License. However, in
|
|
168
|
+
accepting such obligations, You may act only on Your own behalf and on
|
|
169
|
+
Your sole responsibility, not on behalf of any other Contributor, and
|
|
170
|
+
only if You agree to indemnify, defend, and hold each Contributor
|
|
171
|
+
harmless for any liability incurred by, or claims asserted against, such
|
|
172
|
+
Contributor by reason of your accepting any such warranty or additional
|
|
173
|
+
liability.
|
|
174
|
+
|
|
175
|
+
END OF TERMS AND CONDITIONS
|
|
176
|
+
|
|
177
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
178
|
+
|
|
179
|
+
To apply the Apache License to your work, attach the following
|
|
180
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
181
|
+
replaced with your own identifying information. (Don't include
|
|
182
|
+
the brackets!) The text should be enclosed in the appropriate comment
|
|
183
|
+
syntax for the file format. We also recommend that a file or class name
|
|
184
|
+
and description of purpose be included on the same "printed page" as the
|
|
185
|
+
copyright notice for easier identification within third-party archives.
|
|
186
|
+
|
|
187
|
+
Copyright [yyyy] [name of copyright owner]
|
|
188
|
+
|
|
189
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
190
|
+
you may not use this file except in compliance with the License.
|
|
191
|
+
You may obtain a copy of the License at
|
|
192
|
+
|
|
193
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
194
|
+
|
|
195
|
+
Unless required by applicable law or agreed to in writing, software
|
|
196
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
197
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
198
|
+
See the License for the specific language governing permissions and
|
|
199
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
WHOISleuth
|
|
2
|
+
Copyright 2026 slicedearth
|
|
3
|
+
|
|
4
|
+
This product is licensed under the GNU Affero General Public License,
|
|
5
|
+
version 3 only (AGPL-3.0-only).
|
|
6
|
+
See the LICENSE file for the full license text.
|
|
7
|
+
|
|
8
|
+
The WHOISleuth name and logo identify the WHOISleuth project and are not
|
|
9
|
+
licensed under the AGPL. See TRADEMARKS.md for permitted uses.
|
|
10
|
+
|
|
11
|
+
Development-only accessibility tests use @axe-core/playwright and axe-core,
|
|
12
|
+
which are licensed under the Mozilla Public License 2.0. These packages are not
|
|
13
|
+
part of the production runtime.
|
|
14
|
+
|
|
15
|
+
The generated browser-library catalogue projection is derived from the
|
|
16
|
+
Retire.js browser repository, version 5.4.3, and has been modified by selecting
|
|
17
|
+
and bounding the fields used by WHOISleuth. Retire.js is licensed under the
|
|
18
|
+
Apache License 2.0. See LICENSES/Retire.js-Apache-2.0.txt for the full licence
|
|
19
|
+
text.
|
|
20
|
+
|
|
21
|
+
The checked-in SSLBL certificate-fingerprint snapshot is derived from the
|
|
22
|
+
SSLBL certificate blacklist published by abuse.ch under CC0. WHOISleuth stores
|
|
23
|
+
only exact SHA-1 fingerprints plus source timestamps and integrity digests. It
|
|
24
|
+
omits listing reasons and performs matching locally. Source:
|
|
25
|
+
https://sslbl.abuse.ch/blacklist/
|
|
26
|
+
|
|
27
|
+
The checked-in Common-infrastructure snapshot is a bounded projection of
|
|
28
|
+
selected MISP warning-lists. It retains exact CIDR entries, source dates,
|
|
29
|
+
source digests, the pinned upstream commit, and attribution needed to qualify
|
|
30
|
+
shared cloud, delivery, and reviewed public-resolver ranges. MISP
|
|
31
|
+
warning-lists are available under CC0 1.0 Universal or the BSD 2-Clause
|
|
32
|
+
"Simplified" License. Source:
|
|
33
|
+
https://github.com/MISP/misp-warninglists
|
|
34
|
+
|
|
35
|
+
The exact locked production-dependency inventory and the licence documents
|
|
36
|
+
distributed by those packages are retained in
|
|
37
|
+
frontend/static/third-party-notices.txt. The same file is served by the static
|
|
38
|
+
website at /third-party-notices.txt and is checked for lockfile drift in CI.
|
|
39
|
+
|
|
40
|
+
The generated Unicode confusable projection is derived from Unicode UTS #39
|
|
41
|
+
data file confusables.txt, Unicode version 17.0.0.
|
|
42
|
+
|
|
43
|
+
UNICODE LICENSE V3 COPYRIGHT AND PERMISSION NOTICE
|
|
44
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
45
|
+
|
|
46
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING,
|
|
47
|
+
INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR SOFTWARE, YOU
|
|
48
|
+
UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS
|
|
49
|
+
OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY,
|
|
50
|
+
DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
51
|
+
|
|
52
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
53
|
+
data files and any associated documentation (the "Data Files") or software and
|
|
54
|
+
any associated documentation (the "Software") to deal in the Data Files or
|
|
55
|
+
Software without restriction, including without limitation the rights to use,
|
|
56
|
+
copy, modify, merge, publish, distribute, and/or sell copies of the Data Files
|
|
57
|
+
or Software, and to permit persons to whom the Data Files or Software are
|
|
58
|
+
furnished to do so, provided that either (a) this copyright and permission
|
|
59
|
+
notice appear with all copies of the Data Files or Software, or (b) this
|
|
60
|
+
copyright and permission notice appear in associated Documentation.
|
|
61
|
+
|
|
62
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
63
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
64
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
|
|
65
|
+
PARTY RIGHTS.
|
|
66
|
+
|
|
67
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
|
|
68
|
+
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
|
|
69
|
+
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
70
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
71
|
+
CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
|
72
|
+
|
|
73
|
+
Except as contained in this notice, the name of a copyright holder shall not be
|
|
74
|
+
used in advertising or otherwise to promote the sale, use or other dealings in
|
|
75
|
+
these Data Files or Software without prior written authorization of the
|
|
76
|
+
copyright holder.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# WHOISleuth CLI
|
|
2
|
+
|
|
3
|
+
WHOISleuth's command-line interface runs the same bounded WHOIS, RDAP, DNS,
|
|
4
|
+
HTTP, TLS, certificate-transparency, domain-posture, and lookalike analysis
|
|
5
|
+
used by the self-hosted application. Network commands run directly from the
|
|
6
|
+
operator's machine. Offline evidence commands do not contact the hosted site.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
WHOISleuth requires Node.js 24 or later. Run the reviewed public package without
|
|
11
|
+
a global installation:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm exec --yes --package=@slicedearth/whoisleuth-cli -- whoisleuth --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or install the `whoisleuth` command globally:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install --global @slicedearth/whoisleuth-cli
|
|
21
|
+
whoisleuth doctor
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The package version follows the application version. Each release is assembled
|
|
25
|
+
from the executable's bounded dependency closure and retains the project
|
|
26
|
+
licence, notices, trademark terms, source location, and provenance metadata.
|
|
27
|
+
|
|
28
|
+
## Repository checkout
|
|
29
|
+
|
|
30
|
+
Contributors can run the same source command without installing the package:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
node bin/whoisleuth.mts --help
|
|
34
|
+
node bin/whoisleuth.mts lookup example.test
|
|
35
|
+
node bin/whoisleuth.mts lookup example.test --deep --summary
|
|
36
|
+
node bin/whoisleuth.mts lookup example.test --deep --markdown --output lookup.md
|
|
37
|
+
node bin/whoisleuth.mts bulk domains.txt --deep --checkpoint bulk-checkpoint.json
|
|
38
|
+
node bin/whoisleuth.mts bulk domains.txt --csv --registered-only
|
|
39
|
+
node bin/whoisleuth.mts discover example.test --dictionary private-terms.txt --snapshot discovery-state.json --json
|
|
40
|
+
node bin/whoisleuth.mts discover-scan example.test --scan-limit 50 --checkpoint candidate-scan.json --json
|
|
41
|
+
node bin/whoisleuth.mts page-compare official.json candidate.json --json
|
|
42
|
+
node bin/whoisleuth.mts mail-review bulk.json --json
|
|
43
|
+
node bin/whoisleuth.mts diff first-lookup.json second-lookup.json --json
|
|
44
|
+
node bin/whoisleuth.mts registry-support example.test --json
|
|
45
|
+
node bin/whoisleuth.mts doctor
|
|
46
|
+
node bin/whoisleuth.mts completion zsh
|
|
47
|
+
node bin/whoisleuth.mts manual | man -l -
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Fast lookup is the default. Deep collection must be requested explicitly and
|
|
51
|
+
can disclose the target to additional authoritative or first-party network
|
|
52
|
+
sources. Missing, partial, rate-limited, and unsupported sources remain
|
|
53
|
+
explicit and are never interpreted as evidence of safety or absence.
|
|
54
|
+
|
|
55
|
+
Interactive output uses restrained semantic colour, width-aware wrapping, and
|
|
56
|
+
stderr-only progress for slower collection. Redirected and machine-readable
|
|
57
|
+
output stays free of ANSI and progress text. Lookup also provides `--summary`
|
|
58
|
+
and `--verbose` terminal views without changing what is collected. `doctor` is
|
|
59
|
+
offline unless `--network` is explicitly supplied, and completion scripts are
|
|
60
|
+
printed without modifying shell configuration. Commands can use atomic private
|
|
61
|
+
`--output` files, Lookup can emit strict automation exits and target-free
|
|
62
|
+
versioned progress events, and Bulk can resume an exact validated compact
|
|
63
|
+
checkpoint. A checkpoint write failure preserves completed output and returns
|
|
64
|
+
the partial-result exit code. Ctrl-C suppresses partial final output and
|
|
65
|
+
returns exit code 130; a second interrupt performs best-effort temporary-file
|
|
66
|
+
cleanup before exiting immediately.
|
|
67
|
+
|
|
68
|
+
Bulk also supports fixed-column CSV, domain-only output, registered and
|
|
69
|
+
inconclusive output filters, and bounded A, AAAA, NS, and MX summaries. Discover
|
|
70
|
+
supports local custom dictionaries and private snapshot comparison suitable
|
|
71
|
+
for an operator-managed scheduler. The separate networked `discover-scan`
|
|
72
|
+
command can collect a deterministic bounded subset in chunks, retain mutation
|
|
73
|
+
provenance, apply a non-destructive analyst allowlist, group exact shared DNS
|
|
74
|
+
observations, and compare a private component-aware material-change snapshot.
|
|
75
|
+
The full allowlist is not emitted, but matching scanned candidates are labelled
|
|
76
|
+
as suppressed so the review decision remains explainable. Saved Deep
|
|
77
|
+
lookups can be compared across static page, parse5-tokenized DOM structure,
|
|
78
|
+
favicon, technology, and TLS evidence, while saved Bulk output can be reviewed
|
|
79
|
+
for passive MX, null MX, SPF, DMARC, and shared-provider context.
|
|
80
|
+
|
|
81
|
+
See `docs/cli.md` in the package for the complete command, privacy, output, and
|
|
82
|
+
evidence-contract reference.
|
|
83
|
+
|
|
84
|
+
Copyright 2026 slicedearth. Licensed under AGPL-3.0-only.
|
package/TRADEMARKS.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# WHOISleuth trademark policy
|
|
2
|
+
|
|
3
|
+
The WHOISleuth name and logo identify the WHOISleuth project maintained by
|
|
4
|
+
slicedearth. They are not registered trademarks, and this policy does not
|
|
5
|
+
claim registration.
|
|
6
|
+
|
|
7
|
+
The GNU Affero General Public License governs the project source code. It does
|
|
8
|
+
not grant permission to use the WHOISleuth name or logo except for reasonable
|
|
9
|
+
and customary uses that describe the origin of the software.
|
|
10
|
+
|
|
11
|
+
## Uses that do not require permission
|
|
12
|
+
|
|
13
|
+
You may:
|
|
14
|
+
|
|
15
|
+
- refer truthfully to WHOISleuth or link to the official project;
|
|
16
|
+
- state that another project is based on, compatible with, or derived from
|
|
17
|
+
WHOISleuth, provided the statement does not imply endorsement;
|
|
18
|
+
- retain the name and logo in an unmodified copy of WHOISleuth, including the
|
|
19
|
+
project's existing copyright, source, and licence notices; and
|
|
20
|
+
- use the name in reviews, commentary, education, research, and other uses
|
|
21
|
+
permitted by applicable law.
|
|
22
|
+
|
|
23
|
+
## Modified versions and services
|
|
24
|
+
|
|
25
|
+
A materially modified distribution or hosted service should use a different
|
|
26
|
+
product name and logo. It may describe itself as "based on WHOISleuth" and
|
|
27
|
+
must not imply that it is the official project, is maintained by slicedearth,
|
|
28
|
+
or has been approved or endorsed by the project.
|
|
29
|
+
|
|
30
|
+
Without prior permission, do not use the WHOISleuth name or logo for a company,
|
|
31
|
+
product, service, domain name, social-media account, or visual identity in a
|
|
32
|
+
way that is likely to cause confusion about origin, sponsorship, or approval.
|
|
33
|
+
|
|
34
|
+
## Permission and legal rights
|
|
35
|
+
|
|
36
|
+
Requests for uses not covered above can be made through the project maintainer's
|
|
37
|
+
GitHub profile at <https://github.com/slicedearth>.
|
|
38
|
+
|
|
39
|
+
This policy does not restrict rights granted by the AGPL or rights available
|
|
40
|
+
under applicable trademark law, including nominative or other legally
|
|
41
|
+
permitted fair use.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { boundedCliErrorMessage } from "../cli/errors.mjs";
|
|
3
|
+
import { cleanupPendingOutputFilesSync } from "../cli/output-file.mjs";
|
|
4
|
+
import { runCli } from "../cli/runner.mjs";
|
|
5
|
+
for (const stream of [process.stdout, process.stderr]) {
|
|
6
|
+
stream.on('error', (error) => {
|
|
7
|
+
if (error.code === 'EPIPE')
|
|
8
|
+
process.exit(0);
|
|
9
|
+
throw error;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const cancellation = new AbortController();
|
|
13
|
+
let interruptionCount = 0;
|
|
14
|
+
const interrupt = () => {
|
|
15
|
+
interruptionCount += 1;
|
|
16
|
+
if (interruptionCount === 1)
|
|
17
|
+
cancellation.abort(new DOMException('Aborted', 'AbortError'));
|
|
18
|
+
else {
|
|
19
|
+
cleanupPendingOutputFilesSync();
|
|
20
|
+
process.exit(130);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
process.on('SIGINT', interrupt);
|
|
24
|
+
runCli(process.argv.slice(2), { signal: cancellation.signal }).then((code) => {
|
|
25
|
+
if (code === 130) {
|
|
26
|
+
process.removeListener('SIGINT', interrupt);
|
|
27
|
+
process.exit(130);
|
|
28
|
+
}
|
|
29
|
+
process.exitCode = code;
|
|
30
|
+
}).catch((error) => {
|
|
31
|
+
process.stderr.write(`Internal CLI error: ${boundedCliErrorMessage(error)}\n`);
|
|
32
|
+
process.exitCode = 70;
|
|
33
|
+
}).finally(() => {
|
|
34
|
+
process.removeListener('SIGINT', interrupt);
|
|
35
|
+
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { domainToASCII } from 'node:url';
|
|
4
|
+
import { decryptWorkspaceArchive, isEncryptedWorkspaceArchive, } from "../frontend/src/lib/analysis/workspace-archive-crypto.js";
|
|
5
|
+
import { WORKSPACE_ARCHIVE_SCHEMA, readWorkspaceArchive, } from "../frontend/src/lib/analysis/workspace-archive.js";
|
|
6
|
+
import { MAX_OFFLINE_ARTIFACT_BYTES, verifyOfflineArtifact, } from "./artifact-verify.mjs";
|
|
7
|
+
export const ARCHIVE_INSPECTION_SCHEMA = 'whoisleuth.workspace-archive-inspection';
|
|
8
|
+
export const ARCHIVE_INSPECTION_VERSION = 1;
|
|
9
|
+
export const MAX_ARCHIVE_SEARCH_LENGTH = 253;
|
|
10
|
+
export const MAX_ARCHIVE_SEARCH_MATCHES = 100;
|
|
11
|
+
export const MAX_ARCHIVE_SEARCH_NODES = 100_000;
|
|
12
|
+
const SEARCHABLE_FIELDS = new Set([
|
|
13
|
+
'domain',
|
|
14
|
+
'hostname',
|
|
15
|
+
'inputHostname',
|
|
16
|
+
'query',
|
|
17
|
+
'registrableDomain',
|
|
18
|
+
'seed',
|
|
19
|
+
'target',
|
|
20
|
+
]);
|
|
21
|
+
const CONTROL_RE = /[\u0000-\u001f\u007f]/u;
|
|
22
|
+
function record(value) {
|
|
23
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
24
|
+
? value
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
27
|
+
function parseJson(raw) {
|
|
28
|
+
if (typeof raw !== 'string')
|
|
29
|
+
throw new TypeError('Archive input must be UTF-8 JSON text.');
|
|
30
|
+
const bytes = Buffer.byteLength(raw, 'utf8');
|
|
31
|
+
if (bytes === 0 || bytes > MAX_OFFLINE_ARTIFACT_BYTES) {
|
|
32
|
+
throw new TypeError(`Archive input must be between 1 byte and ${MAX_OFFLINE_ARTIFACT_BYTES} bytes.`);
|
|
33
|
+
}
|
|
34
|
+
let parsed;
|
|
35
|
+
try {
|
|
36
|
+
parsed = JSON.parse(raw);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
throw new TypeError('Archive input must be valid JSON.');
|
|
40
|
+
}
|
|
41
|
+
const value = record(parsed);
|
|
42
|
+
if (!value)
|
|
43
|
+
throw new TypeError('Archive input must contain one JSON object.');
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
function normalizeSearch(value) {
|
|
47
|
+
if (value === null || value === undefined || value === '')
|
|
48
|
+
return null;
|
|
49
|
+
if (typeof value !== 'string'
|
|
50
|
+
|| value.length > MAX_ARCHIVE_SEARCH_LENGTH
|
|
51
|
+
|| CONTROL_RE.test(value)) {
|
|
52
|
+
throw new TypeError(`Archive search must be at most ${MAX_ARCHIVE_SEARCH_LENGTH} control-free characters.`);
|
|
53
|
+
}
|
|
54
|
+
const normalized = canonicalSearchValue(value);
|
|
55
|
+
if (!normalized)
|
|
56
|
+
throw new TypeError('Archive search must not be empty.');
|
|
57
|
+
return normalized;
|
|
58
|
+
}
|
|
59
|
+
function canonicalSearchValue(value) {
|
|
60
|
+
const normalized = value.trim().toLowerCase().replace(/\.+$/u, '');
|
|
61
|
+
if (!normalized)
|
|
62
|
+
return '';
|
|
63
|
+
const ascii = domainToASCII(normalized);
|
|
64
|
+
return ascii || normalized;
|
|
65
|
+
}
|
|
66
|
+
function valueDigest(value) {
|
|
67
|
+
return createHash('sha256').update(value, 'utf8').digest('hex');
|
|
68
|
+
}
|
|
69
|
+
function searchSection(section, value, search, reveal, results, state) {
|
|
70
|
+
const stack = [{ value, depth: 0 }];
|
|
71
|
+
while (stack.length && results.length < MAX_ARCHIVE_SEARCH_MATCHES) {
|
|
72
|
+
const current = stack.pop();
|
|
73
|
+
if (!current || current.depth > 16)
|
|
74
|
+
continue;
|
|
75
|
+
if (state.visited >= MAX_ARCHIVE_SEARCH_NODES) {
|
|
76
|
+
state.truncated = true;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
state.visited += 1;
|
|
80
|
+
const object = record(current.value);
|
|
81
|
+
if (object) {
|
|
82
|
+
for (const [field, child] of Object.entries(object).slice(0, 300)) {
|
|
83
|
+
if (SEARCHABLE_FIELDS.has(field) && typeof child === 'string') {
|
|
84
|
+
const normalized = canonicalSearchValue(child);
|
|
85
|
+
if (normalized === search) {
|
|
86
|
+
results.push(Object.freeze({
|
|
87
|
+
section,
|
|
88
|
+
field,
|
|
89
|
+
valueDigestSha256: valueDigest(normalized),
|
|
90
|
+
...(reveal ? { value: child.slice(0, MAX_ARCHIVE_SEARCH_LENGTH) } : {}),
|
|
91
|
+
}));
|
|
92
|
+
if (results.length >= MAX_ARCHIVE_SEARCH_MATCHES) {
|
|
93
|
+
state.truncated = stack.length > 0;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (child && typeof child === 'object')
|
|
99
|
+
stack.push({ value: child, depth: current.depth + 1 });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else if (Array.isArray(current.value)) {
|
|
103
|
+
for (const child of current.value.slice(0, 5_000)) {
|
|
104
|
+
if (child && typeof child === 'object')
|
|
105
|
+
stack.push({ value: child, depth: current.depth + 1 });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export async function inspectWorkspaceArchive(raw, options = {}) {
|
|
111
|
+
const parsed = parseJson(raw);
|
|
112
|
+
const encrypted = isEncryptedWorkspaceArchive(parsed);
|
|
113
|
+
if (encrypted && !options.passphrase) {
|
|
114
|
+
throw new TypeError('Encrypted archive inspection requires a separate passphrase file.');
|
|
115
|
+
}
|
|
116
|
+
await verifyOfflineArtifact(raw, options.passphrase === undefined
|
|
117
|
+
? {}
|
|
118
|
+
: { passphrase: options.passphrase });
|
|
119
|
+
const archiveValue = encrypted
|
|
120
|
+
? await decryptWorkspaceArchive(parsed, options.passphrase)
|
|
121
|
+
: parsed;
|
|
122
|
+
const archive = await readWorkspaceArchive(archiveValue);
|
|
123
|
+
const search = normalizeSearch(options.search);
|
|
124
|
+
const reveal = options.reveal === true;
|
|
125
|
+
if (reveal && !search)
|
|
126
|
+
throw new TypeError('--reveal requires --search.');
|
|
127
|
+
const results = [];
|
|
128
|
+
const searchState = { visited: 0, truncated: false };
|
|
129
|
+
if (search) {
|
|
130
|
+
for (const section of archive.sections) {
|
|
131
|
+
searchSection(section.id, section.data, search, reveal, results, searchState);
|
|
132
|
+
if (results.length >= MAX_ARCHIVE_SEARCH_MATCHES || searchState.truncated)
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (options.requireMatch === true && search && results.length === 0) {
|
|
137
|
+
throw new TypeError('Archive search found no exact canonical match.');
|
|
138
|
+
}
|
|
139
|
+
return Object.freeze({
|
|
140
|
+
schema: ARCHIVE_INSPECTION_SCHEMA,
|
|
141
|
+
version: ARCHIVE_INSPECTION_VERSION,
|
|
142
|
+
mode: 'offline_local',
|
|
143
|
+
archive: Object.freeze({
|
|
144
|
+
encrypted,
|
|
145
|
+
schema: WORKSPACE_ARCHIVE_SCHEMA,
|
|
146
|
+
version: archive.version,
|
|
147
|
+
}),
|
|
148
|
+
summary: Object.freeze({
|
|
149
|
+
inputBytes: Buffer.byteLength(raw, 'utf8'),
|
|
150
|
+
sectionCount: archive.sections.length,
|
|
151
|
+
recordCount: archive.sections.reduce((sum, section) => sum + section.recordCount, 0),
|
|
152
|
+
}),
|
|
153
|
+
sections: Object.freeze(archive.sections.map((section) => Object.freeze({
|
|
154
|
+
id: section.id,
|
|
155
|
+
label: section.label,
|
|
156
|
+
schema: section.schema,
|
|
157
|
+
version: section.version,
|
|
158
|
+
status: section.status,
|
|
159
|
+
recordCount: section.recordCount,
|
|
160
|
+
bytes: section.bytes,
|
|
161
|
+
checksum: section.checksum,
|
|
162
|
+
}))),
|
|
163
|
+
search: Object.freeze({
|
|
164
|
+
requested: search !== null,
|
|
165
|
+
revealValues: reveal,
|
|
166
|
+
matchCount: results.length,
|
|
167
|
+
truncated: searchState.truncated || results.length >= MAX_ARCHIVE_SEARCH_MATCHES,
|
|
168
|
+
results: Object.freeze(results),
|
|
169
|
+
}),
|
|
170
|
+
limitations: Object.freeze([
|
|
171
|
+
'Inspection validates the archive and reports bounded section metadata without printing retained evidence by default.',
|
|
172
|
+
'Search checks exact values in a small allowlist of target fields and never searches analyst notes, contacts, or raw evidence.',
|
|
173
|
+
...(reveal
|
|
174
|
+
? ['Search values were revealed only because the operator supplied --reveal; handle the output as sensitive evidence.']
|
|
175
|
+
: ['Search results contain field names and digests only. A digest does not authenticate or establish the accuracy of a retained value.']),
|
|
176
|
+
]),
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
export function formatArchiveInspection(report) {
|
|
180
|
+
const lines = [
|
|
181
|
+
'WHOISleuth workspace archive inspection',
|
|
182
|
+
`Archive: ${report.archive.encrypted ? 'encrypted' : 'plain'} · v${report.archive.version}`,
|
|
183
|
+
`Sections: ${report.summary.sectionCount}`,
|
|
184
|
+
`Records: ${report.summary.recordCount}`,
|
|
185
|
+
];
|
|
186
|
+
for (const section of report.sections) {
|
|
187
|
+
lines.push(`${section.label}: ${section.recordCount} records · ${section.status} · ${section.bytes} bytes`);
|
|
188
|
+
}
|
|
189
|
+
if (report.search.requested) {
|
|
190
|
+
lines.push(`Search matches: ${report.search.matchCount}${report.search.truncated ? ' (truncated)' : ''}`);
|
|
191
|
+
for (const match of report.search.results) {
|
|
192
|
+
lines.push(`${match.section}.${match.field}: ${match.value ?? `sha256:${match.valueDigestSha256}`}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
for (const limitation of report.limitations)
|
|
196
|
+
lines.push(`Limitation: ${limitation}`);
|
|
197
|
+
return `${lines.join('\n')}\n`;
|
|
198
|
+
}
|