detecti-cli 2.0.6__tar.gz → 2.0.7__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.
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/PKG-INFO +1 -1
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/cli.py +12 -0
- detecti_cli-2.0.7/detecti/utils/updater.py +53 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/pyproject.toml +1 -1
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/.env.example +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/.github/workflows/publish.yml +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/.gitignore +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/README.md +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/__main__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/banner +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/config.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/database/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/database/config_db.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/database/schema.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/database/storage.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/engine.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/core/models.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/data/config.sqlite +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/data/dbs/.gitkeep +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/data/dbs/example.com.sqlite +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/base.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/censys.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/crtsh.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/exploitdb.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/masscan.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/nuclei.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/nvd.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/reverse_whois.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/modules/shodan.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/reporters/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/reporters/csv_reporter.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/reporters/html_reporter.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/reporters/json_reporter.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/reporters/markdown_reporter.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/utils/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/utils/http.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/utils/logger.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/utils/setup.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/api/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/api/auth.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/api/graph_builder.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/api/routes.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/process_manager.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/server.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/android-chrome-192x192.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/android-chrome-512x512.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/apple-touch-icon.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/css/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/css/dashboard.css +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/favicon-16x16.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/favicon-32x32.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/favicon.ico +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/img/DetecTI_Security_Logo.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/img/detecti-ico.png +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/index.html +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/api.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/cytoscape-cose-bilkent.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/cytoscape-dagre.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/cytoscape.min.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/dagre.min.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/graph.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/js/lucide.min.js +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/login.html +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/detecti/web/static/site.webmanifest +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/requirements.txt +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/__init__.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/conftest.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_engine_cli.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_http.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_masscan.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_models.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_modules.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_nuclei.py +0 -0
- {detecti_cli-2.0.6 → detecti_cli-2.0.7}/tests/test_reporters.py +0 -0
|
@@ -88,6 +88,18 @@ hound_app = typer.Typer(
|
|
|
88
88
|
)
|
|
89
89
|
app.add_typer(hound_app, name="hound")
|
|
90
90
|
|
|
91
|
+
@app.callback(invoke_without_command=True)
|
|
92
|
+
def global_callback(ctx: typer.Context):
|
|
93
|
+
"""Global callback to execute logic before subcommands."""
|
|
94
|
+
# Check for updates only if a command is actually going to run
|
|
95
|
+
if ctx.invoked_subcommand is not None:
|
|
96
|
+
try:
|
|
97
|
+
from detecti.utils.updater import check_for_updates
|
|
98
|
+
check_for_updates(__version__)
|
|
99
|
+
except Exception:
|
|
100
|
+
pass
|
|
101
|
+
|
|
102
|
+
|
|
91
103
|
|
|
92
104
|
def target_to_db_name(target: str) -> str:
|
|
93
105
|
"""Convert target string to a clean SQLite database filename (e.g. example.com.sqlite)."""
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import time
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from detecti.config import DETECTI_HOME
|
|
5
|
+
|
|
6
|
+
def check_for_updates(current_version: str) -> None:
|
|
7
|
+
"""Check PyPI for a newer version of detecti-cli, caching the result to avoid spamming."""
|
|
8
|
+
cache_file = DETECTI_HOME / "last_update_check.json"
|
|
9
|
+
|
|
10
|
+
# Check if we should skip network request (e.g., checked within last 12 hours)
|
|
11
|
+
if cache_file.exists():
|
|
12
|
+
try:
|
|
13
|
+
data = json.loads(cache_file.read_text())
|
|
14
|
+
if time.time() - data.get("last_check", 0) < 43200: # 12 hours
|
|
15
|
+
if data.get("newer_version"):
|
|
16
|
+
_print_update_warning(current_version, data["newer_version"])
|
|
17
|
+
return
|
|
18
|
+
except Exception:
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
# Perform request
|
|
22
|
+
try:
|
|
23
|
+
import requests
|
|
24
|
+
resp = requests.get("https://pypi.org/pypi/detecti-cli/json", timeout=2.0)
|
|
25
|
+
if resp.status_code == 200:
|
|
26
|
+
latest_version = resp.json()["info"]["version"]
|
|
27
|
+
|
|
28
|
+
from packaging.version import parse
|
|
29
|
+
is_newer = parse(latest_version) > parse(current_version)
|
|
30
|
+
|
|
31
|
+
# Save to cache
|
|
32
|
+
cache_file.parent.mkdir(parents=True, exist_ok=True)
|
|
33
|
+
cache_file.write_text(json.dumps({
|
|
34
|
+
"last_check": time.time(),
|
|
35
|
+
"latest_version": latest_version,
|
|
36
|
+
"newer_version": latest_version if is_newer else None
|
|
37
|
+
}))
|
|
38
|
+
|
|
39
|
+
if is_newer:
|
|
40
|
+
_print_update_warning(current_version, latest_version)
|
|
41
|
+
except Exception:
|
|
42
|
+
# Silently fail on network/timeout errors to not disrupt CLI workflow
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
def _print_update_warning(current: str, latest: str) -> None:
|
|
46
|
+
from detecti.utils.logger import console
|
|
47
|
+
from rich.panel import Panel
|
|
48
|
+
console.print(Panel(
|
|
49
|
+
f"[bold yellow]Aviso:[/bold yellow] Uma nova versão do [bold cyan]DetecTI-CLI[/bold cyan] está disponível ([dim]{current}[/dim] -> [bold green]{latest}[/bold green])\n"
|
|
50
|
+
f"Execute [bold white]pip install --upgrade detecti-cli[/bold white] para atualizar.",
|
|
51
|
+
border_style="yellow",
|
|
52
|
+
padding=(0, 2)
|
|
53
|
+
))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|