rekos 1.3.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 (40) hide show
  1. rekos-1.3.0/LICENSE +21 -0
  2. rekos-1.3.0/PKG-INFO +223 -0
  3. rekos-1.3.0/README.md +192 -0
  4. rekos-1.3.0/pyproject.toml +56 -0
  5. rekos-1.3.0/rekos/__init__.py +5 -0
  6. rekos-1.3.0/rekos/adapters/__init__.py +18 -0
  7. rekos-1.3.0/rekos/adapters/base.py +104 -0
  8. rekos-1.3.0/rekos/adapters/http_snapshot.py +104 -0
  9. rekos-1.3.0/rekos/adapters/maigret.py +99 -0
  10. rekos-1.3.0/rekos/adapters/registry.py +72 -0
  11. rekos-1.3.0/rekos/adapters/sherlock.py +70 -0
  12. rekos-1.3.0/rekos/adapters/web_osint.py +894 -0
  13. rekos-1.3.0/rekos/adapters/wmn.py +162 -0
  14. rekos-1.3.0/rekos/adapters/wmn_sources.json +38 -0
  15. rekos-1.3.0/rekos/banner.py +161 -0
  16. rekos-1.3.0/rekos/case_export.py +135 -0
  17. rekos-1.3.0/rekos/cli.py +742 -0
  18. rekos-1.3.0/rekos/errors.py +29 -0
  19. rekos-1.3.0/rekos/exporting.py +65 -0
  20. rekos-1.3.0/rekos/hashfile.py +19 -0
  21. rekos-1.3.0/rekos/investigation.py +351 -0
  22. rekos-1.3.0/rekos/ioc.py +116 -0
  23. rekos-1.3.0/rekos/models.py +218 -0
  24. rekos-1.3.0/rekos/osint.py +126 -0
  25. rekos-1.3.0/rekos/paths.py +42 -0
  26. rekos-1.3.0/rekos/public_targets.py +56 -0
  27. rekos-1.3.0/rekos/py.typed +1 -0
  28. rekos-1.3.0/rekos/reporting.py +233 -0
  29. rekos-1.3.0/rekos/snapshots.py +167 -0
  30. rekos-1.3.0/rekos/storage.py +2547 -0
  31. rekos-1.3.0/rekos/usernames.py +38 -0
  32. rekos-1.3.0/rekos/validation.py +115 -0
  33. rekos-1.3.0/rekos.egg-info/PKG-INFO +223 -0
  34. rekos-1.3.0/rekos.egg-info/SOURCES.txt +38 -0
  35. rekos-1.3.0/rekos.egg-info/dependency_links.txt +1 -0
  36. rekos-1.3.0/rekos.egg-info/entry_points.txt +2 -0
  37. rekos-1.3.0/rekos.egg-info/requires.txt +4 -0
  38. rekos-1.3.0/rekos.egg-info/top_level.txt +1 -0
  39. rekos-1.3.0/setup.cfg +4 -0
  40. rekos-1.3.0/tests/test_cli.py +3158 -0
rekos-1.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 REKOS contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
rekos-1.3.0/PKG-INFO ADDED
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.4
2
+ Name: rekos
3
+ Version: 1.3.0
4
+ Summary: Terminal-native passive OSINT CLI for local-first public-source investigation workspaces
5
+ Author: VladTepes84
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/VladTepes84/Rekos
8
+ Project-URL: Repository, https://github.com/VladTepes84/Rekos
9
+ Project-URL: Issues, https://github.com/VladTepes84/Rekos/issues
10
+ Keywords: osint,passive-osint,cli,sqlite,investigation,public-source
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Information Technology
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Internet
21
+ Classifier: Topic :: Security
22
+ Classifier: Topic :: Utilities
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: rich>=13.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # REKOS
33
+ ![REKOS quickstart](assets/rekos-quickstart.png)
34
+
35
+ REKOS is a terminal-native passive OSINT CLI for local-first public-source investigation workspaces. It helps organize targets, evidence, source outputs, entities, relationships, normalized findings, and correlation-quality scores in a SQLite-backed case folder.
36
+
37
+ REKOS is designed for passive public-source workflows:
38
+
39
+ - Public-source investigation workspace
40
+ - Target and evidence organizer
41
+ - Username, profile, domain, URL, and indicator correlation tool
42
+ - Local-first OSINT case workspace
43
+ - No login automation, bypass, credential collection, or active exploitation
44
+
45
+ A case is a local workspace for one public-source research thread. Cases are stored under `~/rekos_cases/<case_name>` by default. Each case keeps its own SQLite database, source outputs, evidence artifacts, graph records, findings, and exports.
46
+
47
+ ## Installation
48
+
49
+ Install with pipx:
50
+
51
+ ```bash
52
+ pipx install rekos
53
+ ```
54
+
55
+ Users run REKOS commands such as `rekos investigate username <case> <username>` and `rekos investigate domain <case> <domain>`. REKOS calls available passive sources through its source adapters and continues cleanly when optional external tools are absent.
56
+
57
+ Install from a local checkout:
58
+
59
+ ```bash
60
+ git clone <repo-url>
61
+ cd rekos
62
+ pipx install .
63
+ rekos --help
64
+ ```
65
+
66
+ For development, use an editable install:
67
+
68
+ ```bash
69
+ git clone <repo-url>
70
+ cd rekos
71
+ python -m venv .venv
72
+ . .venv/bin/activate
73
+ python -m pip install -e ".[dev]"
74
+ pytest
75
+ rekos --help
76
+ ```
77
+
78
+ ## Optional Integrations
79
+
80
+ - `sherlock` enables the `sherlock_username` source when the `sherlock` command is installed
81
+ - `maigret` enables the `maigret_username` source when available in the REKOS runtime
82
+ - `exiftool` or `mediainfo` for file metadata collection
83
+ - Playwright is optional for URL screenshots; HTTP snapshots still work without it
84
+
85
+ Users always run `rekos`, not Sherlock or Maigret directly. `rekos investigate username <case> <username>` automatically uses the username sources available in the current environment.
86
+
87
+ ## Quick Start
88
+
89
+ ```bash
90
+ rekos new-case social_test
91
+ rekos investigate username social_test username
92
+ rekos findings social_test
93
+ rekos score social_test
94
+ rekos graph-summary social_test
95
+ rekos export-case social_test --output social_test.zip
96
+ ```
97
+
98
+ Normal workflow:
99
+
100
+ 1. Create a case with `rekos new-case`.
101
+ 2. Add or investigate a target with `rekos investigate username`, `rekos investigate domain`, or `rekos snapshot-url`.
102
+ 3. Review normalized results with `rekos findings`.
103
+ 4. Score correlation quality with `rekos score`.
104
+ 5. Inspect relationships with `rekos graph-summary` or `rekos list-entities`.
105
+ 6. Export the workspace with `rekos export-case`.
106
+
107
+ Most users only need these commands:
108
+
109
+ ```bash
110
+ rekos quickstart
111
+ rekos new-case acme-osint
112
+ rekos investigate username acme-osint alice.example
113
+ rekos investigate domain acme-osint example.com
114
+ rekos snapshot-url acme-osint https://example.com/profile/alice
115
+ rekos findings acme-osint
116
+ rekos score acme-osint
117
+ rekos search acme-osint example.com
118
+ rekos graph-summary acme-osint
119
+ rekos export-case acme-osint --output ./acme-osint.zip
120
+ ```
121
+
122
+ Users run only `rekos`. Sherlock and Maigret are optional integrations that REKOS orchestrates internally when available.
123
+
124
+ During `rekos investigate username <case> <username>`, REKOS generates safe username variants, runs available passive username sources, stores raw source output, normalizes discovered profile URLs into findings, updates the entity graph, records timeline events, and computes correlation-quality scores. Results are correlation indicators, not proof of identity ownership.
125
+
126
+ During `rekos investigate domain <case> <domain>`, REKOS runs passive DNS, RDAP with registry/WHOIS fallback, HTTP/HTTPS endpoint checks, TLS certificate metadata collection, and crt.sh certificate transparency lookup when available. It records registration evidence, DNS records, web endpoint metadata, redirects, TLS certificate summaries, SPF/mail-security summaries, provider hints from TXT records, and certificate transparency findings.
127
+
128
+ Domain, URL, and snapshot workflows reject localhost, private/internal IP ranges, link-local addresses, metadata-service IPs, reserved, multicast, and unspecified IP targets. REKOS is for public-source targets only.
129
+
130
+ ## How REKOS Works
131
+
132
+ - Target input: user-provided usernames, domains, URLs, files, notes, and indicators are stored in a local case.
133
+ - Source orchestration: REKOS runs passive adapters such as username sources, DNS, RDAP/WHOIS fallback, web/TLS checks, crt.sh, Wayback, metadata tools, and HTTP snapshots when available.
134
+ - Findings normalization: raw source output is converted into normalized findings such as discovered profiles, URLs, domains, metadata records, archive records, and registration records.
135
+ - Graph correlation: entities and relationships connect usernames, profiles, domains, URLs, files, and notes.
136
+ - Quality scoring: REKOS scores correlation quality from source confidence, exact or normalized matches, duplicate source confirmation, evidence presence, and graph relationships.
137
+ - Evidence export: raw outputs, artifacts, reports, SQLite data, and manifests can be exported with `rekos export-case`.
138
+
139
+ ## Supported Sources
140
+
141
+ | Source | Target types | Dependencies | Notes |
142
+ |---------------------|-----------------|----------------------------------|---------------------------------------------------------------------------------|
143
+ | `sherlock_username` | `username` | `sherlock` binary | Runs Sherlock with safe subprocess arguments and parses public profile URLs. |
144
+ | `maigret_username` | `username` | optional `maigret` package/tool | Runs Maigret when installed; REKOS continues without it. |
145
+ | `wmn_username` | `username` | none | Checks local public profile URL templates with conservative passive HTTP validation. |
146
+ | `http_snapshot` | `url` | none | Captures public HTTP response artifacts and optional Playwright screenshot. |
147
+ | `rdap_domain` | `domain` | none | Uses public HTTPS RDAP lookup with registry and WHOIS fallback where available. |
148
+ | `dns_domain` | `domain` | none | Fetches public DNS A/AAAA/MX/NS/TXT records and extracts SPF/provider hints. |
149
+ | `web_domain` | `domain` | none | Performs passive HTTP/HTTPS endpoint and TLS certificate metadata checks. |
150
+ | `crtsh_domain` | `domain` | none | Queries the public crt.sh certificate transparency endpoint. |
151
+ | `wayback_url` | `url`, `domain` | none | Queries public Wayback CDX data and records archive URLs. |
152
+
153
+ Source utilities:
154
+
155
+ ```bash
156
+ rekos sources list
157
+ rekos sources check
158
+ rekos sources run acme-osint rdap_domain example.com
159
+ ```
160
+
161
+ ## Core Commands
162
+
163
+ ```bash
164
+ rekos add-entity acme-osint --type domain --value example.com
165
+ rekos relate-entities acme-osint --from <entity_uuid> --to <entity_uuid> --type related_to --confidence medium
166
+ rekos list-targets acme-osint
167
+ rekos list-sources acme-osint
168
+ rekos show-investigation acme-osint
169
+ rekos report acme-osint --format md
170
+ ```
171
+
172
+ ## Safety And Ethics
173
+
174
+ REKOS is passive-only OSINT tooling. Use it only for lawful, authorized, and ethical public-source research.
175
+
176
+ REKOS must not be used for:
177
+
178
+ - Logging into accounts or automating authenticated sessions
179
+ - Bypassing access controls, paywalls, CAPTCHAs, bot protection, or rate limits
180
+ - Credential collection, phishing, account abuse, or social engineering
181
+ - Exploitation, destructive operations, or aggressive crawling
182
+ - Claiming identity ownership from correlation results
183
+
184
+ Scores are correlation-quality indicators only. A high score means stronger local correlation support, not proof of identity, ownership, compromise, or intent.
185
+
186
+ ## Local Data Model
187
+
188
+ REKOS stores:
189
+
190
+ - Case metadata in SQLite
191
+ - Targets, entities, relationships, notes, timeline events
192
+ - Raw source outputs under `exports/`
193
+ - Evidence and snapshot artifacts
194
+ - Normalized findings with correlation-quality scores
195
+ - Case ZIP exports with manifest data
196
+
197
+ ## Development
198
+
199
+ ```bash
200
+ python -m pip install -e ".[dev]"
201
+ pytest
202
+ rekos --help
203
+ ```
204
+
205
+ Before submitting a change:
206
+
207
+ ```bash
208
+ pytest
209
+ python -m compileall rekos
210
+ git diff --check
211
+ ```
212
+
213
+ ## Roadmap
214
+
215
+ - More passive source adapters with explicit safety boundaries
216
+ - Stronger report templates and case export validation
217
+ - Improved graph summaries and finding explainability
218
+ - Better import/export interoperability
219
+ - Optional UI views while keeping the CLI and local-first storage as the core
220
+
221
+ ## License
222
+
223
+ MIT License. See [LICENSE](LICENSE).
rekos-1.3.0/README.md ADDED
@@ -0,0 +1,192 @@
1
+ # REKOS
2
+ ![REKOS quickstart](assets/rekos-quickstart.png)
3
+
4
+ REKOS is a terminal-native passive OSINT CLI for local-first public-source investigation workspaces. It helps organize targets, evidence, source outputs, entities, relationships, normalized findings, and correlation-quality scores in a SQLite-backed case folder.
5
+
6
+ REKOS is designed for passive public-source workflows:
7
+
8
+ - Public-source investigation workspace
9
+ - Target and evidence organizer
10
+ - Username, profile, domain, URL, and indicator correlation tool
11
+ - Local-first OSINT case workspace
12
+ - No login automation, bypass, credential collection, or active exploitation
13
+
14
+ A case is a local workspace for one public-source research thread. Cases are stored under `~/rekos_cases/<case_name>` by default. Each case keeps its own SQLite database, source outputs, evidence artifacts, graph records, findings, and exports.
15
+
16
+ ## Installation
17
+
18
+ Install with pipx:
19
+
20
+ ```bash
21
+ pipx install rekos
22
+ ```
23
+
24
+ Users run REKOS commands such as `rekos investigate username <case> <username>` and `rekos investigate domain <case> <domain>`. REKOS calls available passive sources through its source adapters and continues cleanly when optional external tools are absent.
25
+
26
+ Install from a local checkout:
27
+
28
+ ```bash
29
+ git clone <repo-url>
30
+ cd rekos
31
+ pipx install .
32
+ rekos --help
33
+ ```
34
+
35
+ For development, use an editable install:
36
+
37
+ ```bash
38
+ git clone <repo-url>
39
+ cd rekos
40
+ python -m venv .venv
41
+ . .venv/bin/activate
42
+ python -m pip install -e ".[dev]"
43
+ pytest
44
+ rekos --help
45
+ ```
46
+
47
+ ## Optional Integrations
48
+
49
+ - `sherlock` enables the `sherlock_username` source when the `sherlock` command is installed
50
+ - `maigret` enables the `maigret_username` source when available in the REKOS runtime
51
+ - `exiftool` or `mediainfo` for file metadata collection
52
+ - Playwright is optional for URL screenshots; HTTP snapshots still work without it
53
+
54
+ Users always run `rekos`, not Sherlock or Maigret directly. `rekos investigate username <case> <username>` automatically uses the username sources available in the current environment.
55
+
56
+ ## Quick Start
57
+
58
+ ```bash
59
+ rekos new-case social_test
60
+ rekos investigate username social_test username
61
+ rekos findings social_test
62
+ rekos score social_test
63
+ rekos graph-summary social_test
64
+ rekos export-case social_test --output social_test.zip
65
+ ```
66
+
67
+ Normal workflow:
68
+
69
+ 1. Create a case with `rekos new-case`.
70
+ 2. Add or investigate a target with `rekos investigate username`, `rekos investigate domain`, or `rekos snapshot-url`.
71
+ 3. Review normalized results with `rekos findings`.
72
+ 4. Score correlation quality with `rekos score`.
73
+ 5. Inspect relationships with `rekos graph-summary` or `rekos list-entities`.
74
+ 6. Export the workspace with `rekos export-case`.
75
+
76
+ Most users only need these commands:
77
+
78
+ ```bash
79
+ rekos quickstart
80
+ rekos new-case acme-osint
81
+ rekos investigate username acme-osint alice.example
82
+ rekos investigate domain acme-osint example.com
83
+ rekos snapshot-url acme-osint https://example.com/profile/alice
84
+ rekos findings acme-osint
85
+ rekos score acme-osint
86
+ rekos search acme-osint example.com
87
+ rekos graph-summary acme-osint
88
+ rekos export-case acme-osint --output ./acme-osint.zip
89
+ ```
90
+
91
+ Users run only `rekos`. Sherlock and Maigret are optional integrations that REKOS orchestrates internally when available.
92
+
93
+ During `rekos investigate username <case> <username>`, REKOS generates safe username variants, runs available passive username sources, stores raw source output, normalizes discovered profile URLs into findings, updates the entity graph, records timeline events, and computes correlation-quality scores. Results are correlation indicators, not proof of identity ownership.
94
+
95
+ During `rekos investigate domain <case> <domain>`, REKOS runs passive DNS, RDAP with registry/WHOIS fallback, HTTP/HTTPS endpoint checks, TLS certificate metadata collection, and crt.sh certificate transparency lookup when available. It records registration evidence, DNS records, web endpoint metadata, redirects, TLS certificate summaries, SPF/mail-security summaries, provider hints from TXT records, and certificate transparency findings.
96
+
97
+ Domain, URL, and snapshot workflows reject localhost, private/internal IP ranges, link-local addresses, metadata-service IPs, reserved, multicast, and unspecified IP targets. REKOS is for public-source targets only.
98
+
99
+ ## How REKOS Works
100
+
101
+ - Target input: user-provided usernames, domains, URLs, files, notes, and indicators are stored in a local case.
102
+ - Source orchestration: REKOS runs passive adapters such as username sources, DNS, RDAP/WHOIS fallback, web/TLS checks, crt.sh, Wayback, metadata tools, and HTTP snapshots when available.
103
+ - Findings normalization: raw source output is converted into normalized findings such as discovered profiles, URLs, domains, metadata records, archive records, and registration records.
104
+ - Graph correlation: entities and relationships connect usernames, profiles, domains, URLs, files, and notes.
105
+ - Quality scoring: REKOS scores correlation quality from source confidence, exact or normalized matches, duplicate source confirmation, evidence presence, and graph relationships.
106
+ - Evidence export: raw outputs, artifacts, reports, SQLite data, and manifests can be exported with `rekos export-case`.
107
+
108
+ ## Supported Sources
109
+
110
+ | Source | Target types | Dependencies | Notes |
111
+ |---------------------|-----------------|----------------------------------|---------------------------------------------------------------------------------|
112
+ | `sherlock_username` | `username` | `sherlock` binary | Runs Sherlock with safe subprocess arguments and parses public profile URLs. |
113
+ | `maigret_username` | `username` | optional `maigret` package/tool | Runs Maigret when installed; REKOS continues without it. |
114
+ | `wmn_username` | `username` | none | Checks local public profile URL templates with conservative passive HTTP validation. |
115
+ | `http_snapshot` | `url` | none | Captures public HTTP response artifacts and optional Playwright screenshot. |
116
+ | `rdap_domain` | `domain` | none | Uses public HTTPS RDAP lookup with registry and WHOIS fallback where available. |
117
+ | `dns_domain` | `domain` | none | Fetches public DNS A/AAAA/MX/NS/TXT records and extracts SPF/provider hints. |
118
+ | `web_domain` | `domain` | none | Performs passive HTTP/HTTPS endpoint and TLS certificate metadata checks. |
119
+ | `crtsh_domain` | `domain` | none | Queries the public crt.sh certificate transparency endpoint. |
120
+ | `wayback_url` | `url`, `domain` | none | Queries public Wayback CDX data and records archive URLs. |
121
+
122
+ Source utilities:
123
+
124
+ ```bash
125
+ rekos sources list
126
+ rekos sources check
127
+ rekos sources run acme-osint rdap_domain example.com
128
+ ```
129
+
130
+ ## Core Commands
131
+
132
+ ```bash
133
+ rekos add-entity acme-osint --type domain --value example.com
134
+ rekos relate-entities acme-osint --from <entity_uuid> --to <entity_uuid> --type related_to --confidence medium
135
+ rekos list-targets acme-osint
136
+ rekos list-sources acme-osint
137
+ rekos show-investigation acme-osint
138
+ rekos report acme-osint --format md
139
+ ```
140
+
141
+ ## Safety And Ethics
142
+
143
+ REKOS is passive-only OSINT tooling. Use it only for lawful, authorized, and ethical public-source research.
144
+
145
+ REKOS must not be used for:
146
+
147
+ - Logging into accounts or automating authenticated sessions
148
+ - Bypassing access controls, paywalls, CAPTCHAs, bot protection, or rate limits
149
+ - Credential collection, phishing, account abuse, or social engineering
150
+ - Exploitation, destructive operations, or aggressive crawling
151
+ - Claiming identity ownership from correlation results
152
+
153
+ Scores are correlation-quality indicators only. A high score means stronger local correlation support, not proof of identity, ownership, compromise, or intent.
154
+
155
+ ## Local Data Model
156
+
157
+ REKOS stores:
158
+
159
+ - Case metadata in SQLite
160
+ - Targets, entities, relationships, notes, timeline events
161
+ - Raw source outputs under `exports/`
162
+ - Evidence and snapshot artifacts
163
+ - Normalized findings with correlation-quality scores
164
+ - Case ZIP exports with manifest data
165
+
166
+ ## Development
167
+
168
+ ```bash
169
+ python -m pip install -e ".[dev]"
170
+ pytest
171
+ rekos --help
172
+ ```
173
+
174
+ Before submitting a change:
175
+
176
+ ```bash
177
+ pytest
178
+ python -m compileall rekos
179
+ git diff --check
180
+ ```
181
+
182
+ ## Roadmap
183
+
184
+ - More passive source adapters with explicit safety boundaries
185
+ - Stronger report templates and case export validation
186
+ - Improved graph summaries and finding explainability
187
+ - Better import/export interoperability
188
+ - Optional UI views while keeping the CLI and local-first storage as the core
189
+
190
+ ## License
191
+
192
+ MIT License. See [LICENSE](LICENSE).
@@ -0,0 +1,56 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rekos"
7
+ dynamic = ["version"]
8
+ description = "Terminal-native passive OSINT CLI for local-first public-source investigation workspaces"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ {name = "VladTepes84"},
15
+ ]
16
+ keywords = ["osint", "passive-osint", "cli", "sqlite", "investigation", "public-source"]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Environment :: Console",
20
+ "Intended Audience :: Information Technology",
21
+ "Operating System :: OS Independent",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: Internet",
28
+ "Topic :: Security",
29
+ "Topic :: Utilities",
30
+ "Typing :: Typed",
31
+ ]
32
+ dependencies = [
33
+ "rich>=13.0",
34
+ ]
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/VladTepes84/Rekos"
38
+ Repository = "https://github.com/VladTepes84/Rekos"
39
+ Issues = "https://github.com/VladTepes84/Rekos/issues"
40
+
41
+ [project.optional-dependencies]
42
+ dev = [
43
+ "pytest>=8.0",
44
+ ]
45
+
46
+ [project.scripts]
47
+ rekos = "rekos.cli:console_main"
48
+
49
+ [tool.setuptools.packages.find]
50
+ include = ["rekos*"]
51
+
52
+ [tool.setuptools.package-data]
53
+ rekos = ["py.typed", "adapters/*.json"]
54
+
55
+ [tool.setuptools.dynamic]
56
+ version = {attr = "rekos.__version__"}
@@ -0,0 +1,5 @@
1
+ """REKOS core package."""
2
+
3
+ __all__ = ["__version__"]
4
+
5
+ __version__ = "1.3.0"
@@ -0,0 +1,18 @@
1
+ """Passive OSINT source adapters."""
2
+
3
+ from .base import AdapterResult, BaseSourceAdapter, SourceRunResult
4
+ from .maigret import MaigretAdapter
5
+ from .sherlock import SherlockAdapter, SherlockUsernameAdapter
6
+ from .web_osint import DnsDomainAdapter
7
+ from .wmn import WmnUsernameAdapter
8
+
9
+ __all__ = [
10
+ "AdapterResult",
11
+ "BaseSourceAdapter",
12
+ "DnsDomainAdapter",
13
+ "MaigretAdapter",
14
+ "SherlockAdapter",
15
+ "SherlockUsernameAdapter",
16
+ "SourceRunResult",
17
+ "WmnUsernameAdapter",
18
+ ]
@@ -0,0 +1,104 @@
1
+ """Base interface for passive OSINT source adapters."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import shutil
6
+ import re
7
+ import time
8
+ from dataclasses import dataclass
9
+ from pathlib import Path
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from rekos.storage import CaseStore
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class AdapterResult:
18
+ source: str
19
+ target: str
20
+ url: str
21
+ platform: str
22
+ confidence: str
23
+ raw_reference: str
24
+
25
+
26
+ @dataclass(frozen=True)
27
+ class SourceRunResult:
28
+ source: str
29
+ target: str
30
+ raw_output: str
31
+ results: list[AdapterResult]
32
+ artifacts: list[Path]
33
+ skipped: bool = False
34
+
35
+
36
+ class BaseSourceAdapter:
37
+ name: str = ""
38
+ description: str = ""
39
+ supported_target_types: tuple[str, ...] = ()
40
+ passive_only: bool = True
41
+ external_dependencies: tuple[str, ...] = ()
42
+
43
+ def dependency_status(self) -> dict[str, bool]:
44
+ return {
45
+ dependency: shutil.which(dependency) is not None
46
+ for dependency in self.external_dependencies
47
+ }
48
+
49
+ def missing_dependencies(self) -> list[str]:
50
+ return [
51
+ dependency
52
+ for dependency, available in self.dependency_status().items()
53
+ if not available
54
+ ]
55
+
56
+ def execute(self, case: str, target: str, store: CaseStore) -> SourceRunResult:
57
+ missing = self.missing_dependencies()
58
+ if missing:
59
+ from rekos.errors import ExternalToolMissingError
60
+
61
+ raise ExternalToolMissingError(
62
+ f"Missing dependencies for {self.name}: {', '.join(missing)}."
63
+ )
64
+ raw_output = self.run(case, target)
65
+ artifact_path = self._write_source_output(case, target, store, raw_output)
66
+ results = self.parse_results(target, raw_output)
67
+ store.add_adapter_results(case, results)
68
+ store.add_timeline_event(case, "source.run", f"Ran source {self.name} for {target}")
69
+ return SourceRunResult(
70
+ source=self.name,
71
+ target=target,
72
+ raw_output=raw_output,
73
+ results=results,
74
+ artifacts=[artifact_path],
75
+ )
76
+
77
+ def run(self, case: str, target: str) -> str:
78
+ raise NotImplementedError
79
+
80
+ def parse_results(self, target: str, raw_output: str) -> list[AdapterResult]:
81
+ raise NotImplementedError
82
+
83
+ def _write_source_output(
84
+ self,
85
+ case: str,
86
+ target: str,
87
+ store: CaseStore,
88
+ raw_output: str,
89
+ ) -> Path:
90
+ sources_folder = store.exports_folder(case) / "sources"
91
+ sources_folder.mkdir(exist_ok=True)
92
+ stem = f"{int(time.time())}-{self.name}-{_safe_export_name(target)}"
93
+ path = sources_folder / f"{stem}.txt"
94
+ counter = 2
95
+ while path.exists():
96
+ path = sources_folder / f"{stem}-{counter}.txt"
97
+ counter += 1
98
+ path.write_text(raw_output, encoding="utf-8")
99
+ return path
100
+
101
+
102
+ def _safe_export_name(value: str) -> str:
103
+ cleaned = re.sub(r"[^A-Za-z0-9_.-]+", "-", value.strip()).strip(".-")
104
+ return (cleaned or "target")[:80]