exploitsynth 0.3.0__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.0
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
@@ -24,9 +24,7 @@ and credits are shared.
24
24
  ## Install
25
25
 
26
26
  ```bash
27
- pipx install exploitsynth # recommended — isolated, on your PATH
28
- # or
29
- pip install exploitsynth
27
+ pipx install exploitsynth # isolated, on your PATH
30
28
  ```
31
29
 
32
30
  Optional tab-completion for your shell:
@@ -8,9 +8,7 @@ and credits are shared.
8
8
  ## Install
9
9
 
10
10
  ```bash
11
- pipx install exploitsynth # recommended — isolated, on your PATH
12
- # or
13
- pip install exploitsynth
11
+ pipx install exploitsynth # isolated, on your PATH
14
12
  ```
15
13
 
16
14
  Optional tab-completion for your shell:
@@ -1,3 +1,3 @@
1
1
  """ExploitSynth scanner CLI."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.3.2"
@@ -26,7 +26,7 @@ from .targets import TargetError, expand_targets, MAX_HOSTS_PER_SCAN
26
26
  EPILOG = "Docs: https://scan.exploitsynth.com/docs · Issues: https://github.com/exploitsynth/cli/issues"
27
27
 
28
28
  app = typer.Typer(
29
- help="ExploitSynth — AI port identification for ports your scanner couldn't fingerprint.",
29
+ help="ExploitSynth scanner CLI.",
30
30
  epilog=EPILOG,
31
31
  no_args_is_help=True,
32
32
  rich_markup_mode="rich",
@@ -36,6 +36,26 @@ app = typer.Typer(
36
36
  JSON_OPT = typer.Option(False, "--json", help="Emit machine-readable JSON on stdout.")
37
37
 
38
38
 
39
+ def _version_callback(value: bool) -> None:
40
+ if value:
41
+ out.print(f"exploitsynth {__version__}")
42
+ raise typer.Exit()
43
+
44
+
45
+ @app.callback()
46
+ def _main(
47
+ version: bool = typer.Option(
48
+ False,
49
+ "--version",
50
+ "-V",
51
+ help="Show the version and exit.",
52
+ callback=_version_callback,
53
+ is_eager=True,
54
+ ),
55
+ ) -> None:
56
+ """ExploitSynth scanner CLI."""
57
+
58
+
39
59
  def _client() -> Client:
40
60
  try:
41
61
  return Client()
@@ -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.0"
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