ether-core 0.1.0__py3-none-any.whl

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 (104) hide show
  1. ether/__init__.py +32 -0
  2. ether/assets/wordlists/common_dirs.txt.gz +0 -0
  3. ether/assets/wordlists/common_params.txt.gz +0 -0
  4. ether/assets/wordlists/common_passwords.txt.gz +0 -0
  5. ether/assets/wordlists/common_usernames.txt.gz +0 -0
  6. ether/assets/wordlists/subdomains_500.txt.gz +0 -0
  7. ether/cli/__init__.py +5 -0
  8. ether/cli/__main__.py +8 -0
  9. ether/cli/commands/__init__.py +1 -0
  10. ether/cli/commands/doctor.py +21 -0
  11. ether/cli/commands/graph.py +311 -0
  12. ether/cli/commands/logs.py +45 -0
  13. ether/cli/commands/mcp.py +49 -0
  14. ether/cli/commands/run.py +146 -0
  15. ether/cli/commands/session.py +61 -0
  16. ether/cli/commands/telemetry.py +51 -0
  17. ether/cli/commands/tool.py +131 -0
  18. ether/cli/context.py +71 -0
  19. ether/cli/formatters.py +39 -0
  20. ether/cli/router.py +368 -0
  21. ether/common/__init__.py +201 -0
  22. ether/common/algorithms.py +407 -0
  23. ether/common/canonicalize.py +93 -0
  24. ether/common/context.py +25 -0
  25. ether/common/crypto.py +183 -0
  26. ether/common/embeddings.py +93 -0
  27. ether/common/exceptions.py +13 -0
  28. ether/common/logging.py +386 -0
  29. ether/common/secure_memory.py +159 -0
  30. ether/common/ssrf.py +93 -0
  31. ether/core/__init__.py +25 -0
  32. ether/core/diagnostics.py +368 -0
  33. ether/core/executor.py +296 -0
  34. ether/core/sandbox.py +118 -0
  35. ether/core/session.py +956 -0
  36. ether/gateway/__init__.py +21 -0
  37. ether/gateway/gate.py +392 -0
  38. ether/gateway/network.py +98 -0
  39. ether/gateway/preflight.py +802 -0
  40. ether/graph/__init__.py +13 -0
  41. ether/graph/analytics.py +334 -0
  42. ether/graph/store.py +1615 -0
  43. ether/graph/telemetry.py +334 -0
  44. ether/graph/timeline.py +185 -0
  45. ether/mcp/__init__.py +5 -0
  46. ether/mcp/server.py +382 -0
  47. ether/paths.py +176 -0
  48. ether/py.typed +0 -0
  49. ether/registry/__init__.py +7 -0
  50. ether/registry/adapter.py +194 -0
  51. ether/registry/manifest.py +53 -0
  52. ether/registry/registry.py +150 -0
  53. ether/registry/wordlists.py +156 -0
  54. ether/schemas/__init__.py +50 -0
  55. ether/schemas/base.py +122 -0
  56. ether/schemas/credential.py +50 -0
  57. ether/schemas/dns.py +116 -0
  58. ether/schemas/host_internal.py +58 -0
  59. ether/schemas/network.py +142 -0
  60. ether/schemas/power.py +68 -0
  61. ether/schemas/vulnerability.py +221 -0
  62. ether/schemas/web.py +172 -0
  63. ether_core-0.1.0.dist-info/METADATA +440 -0
  64. ether_core-0.1.0.dist-info/RECORD +104 -0
  65. ether_core-0.1.0.dist-info/WHEEL +4 -0
  66. ether_core-0.1.0.dist-info/entry_points.txt +2 -0
  67. ether_core-0.1.0.dist-info/licenses/LICENSE +21 -0
  68. tools/__init__.py +0 -0
  69. tools/dnspython/__init__.py +1 -0
  70. tools/dnspython/adapter.py +302 -0
  71. tools/dnspython/cli.py +202 -0
  72. tools/dnspython/manifest.toml +138 -0
  73. tools/ffuf/__init__.py +1 -0
  74. tools/ffuf/adapter.py +183 -0
  75. tools/ffuf/manifest.toml +121 -0
  76. tools/gobuster/__init__.py +0 -0
  77. tools/gobuster/adapter.py +90 -0
  78. tools/gobuster/manifest.toml +104 -0
  79. tools/http_probe/adapter.py +256 -0
  80. tools/http_probe/manifest.toml +40 -0
  81. tools/netexec/__init__.py +1 -0
  82. tools/netexec/adapter.py +163 -0
  83. tools/netexec/manifest.toml +83 -0
  84. tools/nikto/__init__.py +0 -0
  85. tools/nikto/adapter.py +145 -0
  86. tools/nikto/manifest.toml +108 -0
  87. tools/nmap/__init__.py +0 -0
  88. tools/nmap/adapter.py +97 -0
  89. tools/nmap/manifest.toml +159 -0
  90. tools/nuclei/__init__.py +1 -0
  91. tools/nuclei/adapter.py +171 -0
  92. tools/nuclei/manifest.toml +117 -0
  93. tools/searchsploit/__init__.py +1 -0
  94. tools/searchsploit/adapter.py +139 -0
  95. tools/searchsploit/manifest.toml +103 -0
  96. tools/sqlmap/__init__.py +1 -0
  97. tools/sqlmap/adapter.py +214 -0
  98. tools/sqlmap/manifest.toml +89 -0
  99. tools/subfinder/__init__.py +0 -0
  100. tools/subfinder/adapter.py +71 -0
  101. tools/subfinder/manifest.toml +104 -0
  102. tools/whois/__init__.py +0 -0
  103. tools/whois/adapter.py +80 -0
  104. tools/whois/manifest.toml +95 -0
@@ -0,0 +1,221 @@
1
+ """General vulnerability finding schemas."""
2
+
3
+ from typing import ClassVar, Optional
4
+
5
+ from ether.schemas.base import BaseFinding, Relation
6
+
7
+
8
+ class VulnerabilityFound(BaseFinding):
9
+ """A generic vulnerability linked to a host or service. Child of network.service or network.host. Produced by nmap-vulners, nessus."""
10
+
11
+ schema_type: str = "vulnerability.found"
12
+ pik_fields: ClassVar[list[str]] = ["host_ip", "vuln_id"]
13
+
14
+ @classmethod
15
+ def create(cls, host_ip: str, vuln_id: str, port: Optional[int] = None, **kwargs):
16
+ parent = None
17
+ if port:
18
+ parent = Relation(
19
+ target_type="network.service",
20
+ target_pik={
21
+ "host_ip": host_ip,
22
+ "port": port,
23
+ "protocol": "tcp",
24
+ },
25
+ via="service_has_vuln",
26
+ )
27
+ else:
28
+ parent = Relation(
29
+ target_type="network.host", target_pik={"ip": host_ip}, via="host_has_vuln"
30
+ )
31
+
32
+ return cls(
33
+ pik={"host_ip": host_ip, "vuln_id": vuln_id},
34
+ parent=parent,
35
+ data={"host_ip": host_ip, "vuln_id": vuln_id, "port": port, **kwargs},
36
+ )
37
+
38
+ def to_semantic_text(self) -> str:
39
+ vuln_id = self.pik.get("vuln_id") or self.data.get("vuln_id", "")
40
+ host_ip = self.pik.get("host_ip") or self.data.get("host_ip", "")
41
+ port = self.data.get("port")
42
+ severity = self.data.get("severity")
43
+ title = self.data.get("title") or self.data.get("name")
44
+ description = self.data.get("description")
45
+ parts = [f"Vulnerability {vuln_id} on host {host_ip}"]
46
+ if port:
47
+ parts.append(f"Port {port}")
48
+ if severity:
49
+ parts.append(f"Severity: {severity}")
50
+ if title:
51
+ parts.append(f"Title: {title}")
52
+ if description:
53
+ parts.append(f"Description: {description}")
54
+ return ". ".join(parts) + "."
55
+
56
+
57
+ class ExploitReference(BaseFinding):
58
+ """A known exploit or proof-of-concept reference from Exploit-DB or CVE archives. Child of network.service or vulnerability.found. Produced by searchsploit."""
59
+
60
+ schema_type: str = "exploit.reference"
61
+ pik_fields: ClassVar[list[str]] = ["exploit_id"]
62
+
63
+ @classmethod
64
+ def create(
65
+ cls,
66
+ exploit_id: str,
67
+ title: str,
68
+ cve_id: Optional[str] = None,
69
+ platform: Optional[str] = None,
70
+ exploit_type: Optional[str] = None,
71
+ verified: bool = False,
72
+ file_path: Optional[str] = None,
73
+ host_ip: Optional[str] = None,
74
+ port: Optional[int] = None,
75
+ vuln_id: Optional[str] = None,
76
+ **kwargs,
77
+ ):
78
+ parent = None
79
+ if vuln_id and host_ip:
80
+ parent = Relation(
81
+ target_type="vulnerability.found",
82
+ target_pik={"host_ip": host_ip, "vuln_id": vuln_id},
83
+ via="vuln_has_exploit",
84
+ )
85
+ elif host_ip and port:
86
+ parent = Relation(
87
+ target_type="network.service",
88
+ target_pik={"host_ip": host_ip, "port": port, "protocol": "tcp"},
89
+ via="service_has_exploit",
90
+ )
91
+ elif host_ip:
92
+ parent = Relation(
93
+ target_type="network.host",
94
+ target_pik={"ip": host_ip},
95
+ via="host_has_exploit",
96
+ )
97
+
98
+ associations = []
99
+ if cve_id and host_ip:
100
+ associations.append(
101
+ Relation(
102
+ target_type="vulnerability.found",
103
+ target_pik={"host_ip": host_ip, "vuln_id": cve_id},
104
+ via="exploits_cve",
105
+ )
106
+ )
107
+
108
+ data = {
109
+ "exploit_id": exploit_id,
110
+ "title": title,
111
+ "cve_id": cve_id,
112
+ "platform": platform,
113
+ "exploit_type": exploit_type,
114
+ "verified": verified,
115
+ "file_path": file_path,
116
+ **kwargs,
117
+ }
118
+ if host_ip:
119
+ data["host_ip"] = host_ip
120
+ if port:
121
+ data["port"] = port
122
+ if vuln_id:
123
+ data["vuln_id"] = vuln_id
124
+
125
+ cls_kwargs = {}
126
+ if "schema_version" in kwargs:
127
+ cls_kwargs["schema_version"] = kwargs.pop("schema_version")
128
+ if "status" in kwargs:
129
+ cls_kwargs["status"] = kwargs.pop("status")
130
+
131
+ return cls(
132
+ pik={"exploit_id": exploit_id},
133
+ parent=parent,
134
+ associations=associations,
135
+ data=data,
136
+ **cls_kwargs,
137
+ )
138
+
139
+ def to_semantic_text(self) -> str:
140
+ exploit_id = self.pik.get("exploit_id") or self.data.get("exploit_id", "")
141
+ title = self.data.get("title", "")
142
+ cve_id = self.data.get("cve_id")
143
+ platform = self.data.get("platform")
144
+ exploit_type = self.data.get("exploit_type")
145
+ parts = [f"Exploit Reference {exploit_id}: {title}"]
146
+ if cve_id:
147
+ parts.append(f"Target CVE: {cve_id}")
148
+ if platform:
149
+ parts.append(f"Platform: {platform}")
150
+ if exploit_type:
151
+ parts.append(f"Type: {exploit_type}")
152
+ return ". ".join(parts) + "."
153
+
154
+
155
+ class AuditMisconfig(BaseFinding):
156
+ """A detected security misconfiguration, policy violation, or information exposure. Child of web.endpoint, network.service, or network.host. Produced by nuclei, nikto, testssl."""
157
+
158
+ schema_type: str = "audit.misconfig"
159
+ pik_fields: ClassVar[list[str]] = ["target", "check_id"]
160
+
161
+ @classmethod
162
+ def create(
163
+ cls,
164
+ target: str,
165
+ check_id: str,
166
+ title: str,
167
+ severity: str = "medium",
168
+ description: str = "",
169
+ remediation: Optional[str] = None,
170
+ cve_id: Optional[str] = None,
171
+ host_ip: Optional[str] = None,
172
+ port: Optional[int] = None,
173
+ **kwargs,
174
+ ):
175
+ parent = None
176
+ if target.startswith("http://") or target.startswith("https://"):
177
+ parent = Relation(
178
+ target_type="web.endpoint",
179
+ target_pik={"url": target},
180
+ via="endpoint_has_misconfig",
181
+ )
182
+ elif host_ip and port:
183
+ parent = Relation(
184
+ target_type="network.service",
185
+ target_pik={"host_ip": host_ip, "port": port, "protocol": "tcp"},
186
+ via="service_has_misconfig",
187
+ )
188
+ elif host_ip:
189
+ parent = Relation(
190
+ target_type="network.host",
191
+ target_pik={"ip": host_ip},
192
+ via="host_has_misconfig",
193
+ )
194
+
195
+ cls_kwargs = {}
196
+ if "schema_version" in kwargs:
197
+ cls_kwargs["schema_version"] = kwargs.pop("schema_version")
198
+ if "status" in kwargs:
199
+ cls_kwargs["status"] = kwargs.pop("status")
200
+
201
+ data = {
202
+ "target": target,
203
+ "check_id": check_id,
204
+ "title": title,
205
+ "severity": severity,
206
+ "description": description,
207
+ "remediation": remediation,
208
+ "cve_id": cve_id,
209
+ **kwargs,
210
+ }
211
+ if host_ip:
212
+ data["host_ip"] = host_ip
213
+ if port:
214
+ data["port"] = port
215
+
216
+ return cls(
217
+ pik={"target": target, "check_id": check_id},
218
+ parent=parent,
219
+ data=data,
220
+ **cls_kwargs,
221
+ )
ether/schemas/web.py ADDED
@@ -0,0 +1,172 @@
1
+ """Web-related finding schemas."""
2
+
3
+ from typing import ClassVar, Optional
4
+
5
+ from ether.schemas.base import BaseFinding, Relation
6
+
7
+
8
+ class WebEndpoint(BaseFinding):
9
+ """A reachable HTTP/S URL with response metadata. Child of network.service. Produced by gobuster, curl."""
10
+
11
+ schema_type: str = "web.endpoint"
12
+ pik_fields: ClassVar[list[str]] = ["url"]
13
+
14
+ @classmethod
15
+ def create(
16
+ cls,
17
+ url: str,
18
+ host_ip: Optional[str] = None,
19
+ port: Optional[int] = None,
20
+ favicon_hash: Optional[str] = None,
21
+ anchor_hash: Optional[str] = None,
22
+ **kwargs,
23
+ ):
24
+ parent = None
25
+ if host_ip and port:
26
+ parent = Relation(
27
+ target_type="network.service",
28
+ target_pik={
29
+ "host_ip": host_ip,
30
+ "port": port,
31
+ "protocol": "tcp", # Default for web
32
+ },
33
+ via="hosts_endpoint",
34
+ )
35
+ data = {"url": url, **kwargs}
36
+ if favicon_hash:
37
+ data["favicon_hash"] = favicon_hash
38
+ if not anchor_hash:
39
+ anchor_hash = (
40
+ f"favicon:{favicon_hash}"
41
+ if not favicon_hash.startswith("favicon:")
42
+ else favicon_hash
43
+ )
44
+
45
+ return cls(pik={"url": url}, parent=parent, data=data, anchor_hash=anchor_hash)
46
+
47
+ def to_semantic_text(self) -> str:
48
+ url = self.pik.get("url") or self.data.get("url", "")
49
+ status = self.data.get("status_code")
50
+ title = self.data.get("title")
51
+ server = self.data.get("server")
52
+ parts = [f"Web Endpoint at {url}"]
53
+ if status:
54
+ parts.append(f"Status HTTP {status}")
55
+ if title:
56
+ parts.append(f"Page Title: '{title}'")
57
+ if server:
58
+ parts.append(f"Server header: {server}")
59
+ return ". ".join(parts) + "."
60
+
61
+
62
+ class WebResource(BaseFinding):
63
+ """A specific asset (JS, CSS, Image) found on a web endpoint. Child of web.endpoint. Produced by burp, crawler."""
64
+
65
+ schema_type: str = "web.resource"
66
+ pik_fields: ClassVar[list[str]] = ["url", "resource_path"]
67
+
68
+ @classmethod
69
+ def create(cls, url: str, resource_path: str, **kwargs):
70
+ return cls.from_data(
71
+ {"url": url, "resource_path": resource_path, **kwargs},
72
+ parent=Relation(
73
+ target_type="web.endpoint", target_pik={"url": url}, via="hosts_resource"
74
+ ),
75
+ )
76
+
77
+
78
+ class WebVulnerability(BaseFinding):
79
+ """A web-specific flaw (XSS, SQLi) found on an endpoint. Child of web.endpoint. Produced by nikto, zap."""
80
+
81
+ schema_type: str = "web.vulnerability"
82
+ pik_fields: ClassVar[list[str]] = ["url", "vuln_type", "parameter"]
83
+
84
+ @classmethod
85
+ def create(cls, url: str, vuln_type: str, parameter: Optional[str] = None, **kwargs):
86
+ return cls(
87
+ pik={"url": url, "vuln_type": vuln_type, "parameter": parameter or ""},
88
+ parent=Relation(
89
+ target_type="web.endpoint", target_pik={"url": url}, via="has_web_vuln"
90
+ ),
91
+ data={"url": url, "vuln_type": vuln_type, "parameter": parameter, **kwargs},
92
+ )
93
+
94
+
95
+ class WebTechnology(BaseFinding):
96
+ """A detected web technology, framework, server, or CMS. Child of web.endpoint or network.service. Produced by whatweb, wappalyzer, httpx, nikto."""
97
+
98
+ schema_type: str = "web.technology"
99
+ pik_fields: ClassVar[list[str]] = ["url", "technology_name"]
100
+
101
+ @classmethod
102
+ def create(
103
+ cls,
104
+ url: str,
105
+ technology_name: str,
106
+ version: Optional[str] = None,
107
+ categories: Optional[list[str]] = None,
108
+ cpe: Optional[str] = None,
109
+ confidence: float = 1.0,
110
+ host_ip: Optional[str] = None,
111
+ port: Optional[int] = None,
112
+ **kwargs,
113
+ ):
114
+ parent = None
115
+ if host_ip and port:
116
+ parent = Relation(
117
+ target_type="network.service",
118
+ target_pik={
119
+ "host_ip": host_ip,
120
+ "port": port,
121
+ "protocol": "tcp",
122
+ },
123
+ via="service_uses_technology",
124
+ )
125
+ else:
126
+ parent = Relation(
127
+ target_type="web.endpoint",
128
+ target_pik={"url": url},
129
+ via="endpoint_uses_technology",
130
+ )
131
+
132
+ cls_kwargs = {}
133
+ if "schema_version" in kwargs:
134
+ cls_kwargs["schema_version"] = kwargs.pop("schema_version")
135
+ if "status" in kwargs:
136
+ cls_kwargs["status"] = kwargs.pop("status")
137
+
138
+ data = {
139
+ "url": url,
140
+ "technology_name": technology_name,
141
+ "version": version,
142
+ "categories": categories or [],
143
+ "cpe": cpe,
144
+ "confidence": max(0.0, min(1.0, float(confidence))),
145
+ **kwargs,
146
+ }
147
+ if host_ip:
148
+ data["host_ip"] = host_ip
149
+ if port:
150
+ data["port"] = port
151
+
152
+ return cls(
153
+ pik={"url": url, "technology_name": technology_name},
154
+ parent=parent,
155
+ data=data,
156
+ **cls_kwargs,
157
+ )
158
+
159
+ def to_semantic_text(self) -> str:
160
+ url = self.pik.get("url") or self.data.get("url", "")
161
+ tech = self.pik.get("technology_name") or self.data.get("technology_name", "")
162
+ version = self.data.get("version")
163
+ categories = self.data.get("categories", [])
164
+ cpe = self.data.get("cpe")
165
+ parts = [f"Web Technology '{tech}' identified on {url}"]
166
+ if version:
167
+ parts.append(f"Version: {version}")
168
+ if categories:
169
+ parts.append(f"Categories: {', '.join(categories)}")
170
+ if cpe:
171
+ parts.append(f"CPE: {cpe}")
172
+ return ". ".join(parts) + "."