exploitsynth 0.3.1__tar.gz → 0.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exploitsynth
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: ExploitSynth scanner CLI — AI port-identification from your terminal
5
5
  Project-URL: Homepage, https://scan.exploitsynth.com
6
6
  Project-URL: Documentation, https://scan.exploitsynth.com/docs
@@ -1,3 +1,3 @@
1
1
  """ExploitSynth scanner CLI."""
2
2
 
3
- __version__ = "0.3.1"
3
+ __version__ = "0.3.2"
@@ -4,7 +4,8 @@ from __future__ import annotations
4
4
 
5
5
  import ipaddress
6
6
  import re
7
- from typing import List
7
+ import socket
8
+ from typing import List, Optional
8
9
 
9
10
  MAX_HOSTS_PER_SCAN = 16
10
11
 
@@ -13,6 +14,15 @@ class TargetError(ValueError):
13
14
  """Raised when a target string can't be parsed or expands too wide."""
14
15
 
15
16
 
17
+ def _resolve_host(host: str) -> Optional[str]:
18
+ """Resolve a hostname to its first IPv4 (A record), or None if it won't resolve."""
19
+ try:
20
+ infos = socket.getaddrinfo(host, None, socket.AF_INET, socket.SOCK_STREAM)
21
+ except socket.gaierror:
22
+ return None
23
+ return infos[0][4][0] if infos else None
24
+
25
+
16
26
  def expand_targets(text: str) -> List[str]:
17
27
  """
18
28
  Accept single IPs, CIDR ranges (10.0.0.0/24), and comma/space/newline lists.
@@ -47,7 +57,12 @@ def expand_targets(text: str) -> List[str]:
47
57
  try:
48
58
  ip = ipaddress.ip_address(token)
49
59
  except ValueError:
50
- raise TargetError(f"Invalid IP: {token}")
60
+ # Not a literal IP — treat as a hostname and resolve it (A record).
61
+ resolved = _resolve_host(token)
62
+ if resolved is None:
63
+ raise TargetError(f"Could not resolve host: {token}")
64
+ add(resolved)
65
+ continue
51
66
  if ip.version != 4:
52
67
  raise TargetError(f"Only IPv4 is supported: {token}")
53
68
  add(token)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "exploitsynth"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "ExploitSynth scanner CLI — AI port-identification from your terminal"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
File without changes
File without changes