detecti-cli 2.0.2__tar.gz → 2.0.4__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.2 → detecti_cli-2.0.4}/PKG-INFO +3 -2
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/cli.py +4 -3
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/database/config_db.py +28 -35
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/api/auth.py +2 -1
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/pyproject.toml +3 -2
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/.env.example +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/.github/workflows/publish.yml +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/.gitignore +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/README.md +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/__main__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/banner +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/config.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/database/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/database/schema.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/database/storage.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/engine.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/core/models.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/data/config.sqlite +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/data/dbs/.gitkeep +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/data/dbs/example.com.sqlite +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/base.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/censys.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/crtsh.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/exploitdb.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/masscan.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/nuclei.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/nvd.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/reverse_whois.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/modules/shodan.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/reporters/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/reporters/csv_reporter.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/reporters/html_reporter.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/reporters/json_reporter.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/reporters/markdown_reporter.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/utils/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/utils/http.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/utils/logger.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/utils/setup.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/api/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/api/graph_builder.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/api/routes.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/process_manager.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/server.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/android-chrome-192x192.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/android-chrome-512x512.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/apple-touch-icon.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/css/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/css/dashboard.css +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/favicon-16x16.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/favicon-32x32.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/favicon.ico +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/img/DetecTI_Security_Logo.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/img/detecti-ico.png +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/index.html +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/api.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/cytoscape-cose-bilkent.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/cytoscape-dagre.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/cytoscape.min.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/dagre.min.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/graph.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/js/lucide.min.js +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/login.html +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/detecti/web/static/site.webmanifest +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/requirements.txt +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/__init__.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/conftest.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_engine_cli.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_http.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_masscan.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_models.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_modules.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_nuclei.py +0 -0
- {detecti_cli-2.0.2 → detecti_cli-2.0.4}/tests/test_reporters.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: detecti-cli
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Modern Attack Surface Management & Threat Intelligence Engine
|
|
5
5
|
Author-email: "Lucas S. (Ls4ss)" <lucas@lucassouza.io>
|
|
6
6
|
License: MIT
|
|
@@ -17,13 +17,14 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
18
|
Classifier: Topic :: Security
|
|
19
19
|
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: bcrypt>=4.0.0
|
|
20
21
|
Requires-Dist: cve-searchsploit>=0.3.0
|
|
21
22
|
Requires-Dist: fastapi>=0.104.0
|
|
22
23
|
Requires-Dist: httpx>=0.27.0
|
|
23
|
-
Requires-Dist: passlib[bcrypt]>=1.7.4
|
|
24
24
|
Requires-Dist: psutil>=5.9.0
|
|
25
25
|
Requires-Dist: pydantic-settings>=2.2.0
|
|
26
26
|
Requires-Dist: pydantic>=2.7.0
|
|
27
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
27
28
|
Requires-Dist: python-jose[cryptography]>=3.3.0
|
|
28
29
|
Requires-Dist: python-multipart>=0.0.6
|
|
29
30
|
Requires-Dist: requests>=2.31.0
|
|
@@ -31,10 +31,11 @@ def _compat_make_metavar(self, ctx=None):
|
|
|
31
31
|
|
|
32
32
|
click.Option.make_metavar = _compat_make_metavar
|
|
33
33
|
|
|
34
|
+
import importlib.metadata
|
|
34
35
|
try:
|
|
35
|
-
|
|
36
|
-
except
|
|
37
|
-
__version__ = "
|
|
36
|
+
__version__ = importlib.metadata.version("detecti-cli")
|
|
37
|
+
except importlib.metadata.PackageNotFoundError:
|
|
38
|
+
__version__ = "dev"
|
|
38
39
|
|
|
39
40
|
from detecti.config import settings, DETECTI_HOME
|
|
40
41
|
from detecti.core.engine import ThreatTrackEngine, DetectIEngine
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import sqlite3
|
|
3
3
|
import hashlib
|
|
4
|
+
import bcrypt
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
|
|
6
|
-
# Suppress passlib bcrypt warning
|
|
7
|
-
try:
|
|
8
|
-
import bcrypt
|
|
9
|
-
if not hasattr(bcrypt, "__about__"):
|
|
10
|
-
class AboutMock:
|
|
11
|
-
__version__ = bcrypt.__version__
|
|
12
|
-
bcrypt.__about__ = AboutMock()
|
|
13
|
-
except ImportError:
|
|
14
|
-
pass
|
|
15
|
-
|
|
16
|
-
from passlib.context import CryptContext
|
|
17
|
-
from pydantic_settings import BaseSettings
|
|
18
|
-
|
|
19
|
-
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
|
20
|
-
|
|
21
7
|
def get_password_hash(password: str) -> str:
|
|
22
|
-
|
|
8
|
+
salt = bcrypt.gensalt()
|
|
9
|
+
return bcrypt.hashpw(password.encode('utf-8'), salt).decode('utf-8')
|
|
23
10
|
|
|
24
11
|
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
|
25
|
-
|
|
12
|
+
try:
|
|
13
|
+
return bcrypt.checkpw(plain_password.encode('utf-8'), hashed_password.encode('utf-8'))
|
|
14
|
+
except Exception:
|
|
15
|
+
return False
|
|
26
16
|
|
|
27
17
|
class ConfigDBManager:
|
|
28
18
|
def __init__(self, db_path: Path):
|
|
@@ -43,31 +33,34 @@ class ConfigDBManager:
|
|
|
43
33
|
''')
|
|
44
34
|
conn.commit()
|
|
45
35
|
|
|
46
|
-
def
|
|
36
|
+
def user_exists(self, username: str) -> bool:
|
|
37
|
+
with sqlite3.connect(self.db_path) as conn:
|
|
38
|
+
cursor = conn.execute("SELECT 1 FROM users WHERE username = ?", (username,))
|
|
39
|
+
return cursor.fetchone() is not None
|
|
40
|
+
|
|
41
|
+
def create_user(self, username: str, password_hash: str, role: str = "admin") -> bool:
|
|
47
42
|
try:
|
|
48
43
|
with sqlite3.connect(self.db_path) as conn:
|
|
49
|
-
conn.execute(
|
|
50
|
-
INSERT INTO users (username, password_hash, role)
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
conn.execute(
|
|
45
|
+
"INSERT INTO users (username, password_hash, role) VALUES (?, ?, ?)",
|
|
46
|
+
(username, password_hash, role)
|
|
47
|
+
)
|
|
53
48
|
conn.commit()
|
|
54
|
-
|
|
49
|
+
return True
|
|
55
50
|
except sqlite3.IntegrityError:
|
|
56
51
|
return False
|
|
57
52
|
|
|
58
|
-
def update_user_password(self, username: str,
|
|
53
|
+
def update_user_password(self, username: str, new_password_hash: str) -> bool:
|
|
59
54
|
with sqlite3.connect(self.db_path) as conn:
|
|
60
|
-
conn.execute(
|
|
61
|
-
UPDATE users SET password_hash = ? WHERE username = ?
|
|
62
|
-
|
|
55
|
+
cursor = conn.execute(
|
|
56
|
+
"UPDATE users SET password_hash = ? WHERE username = ?",
|
|
57
|
+
(new_password_hash, username)
|
|
58
|
+
)
|
|
63
59
|
conn.commit()
|
|
60
|
+
return cursor.rowcount > 0
|
|
64
61
|
|
|
65
|
-
def
|
|
62
|
+
def get_user_hash(self, username: str) -> str:
|
|
66
63
|
with sqlite3.connect(self.db_path) as conn:
|
|
67
|
-
conn.
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
def user_exists(self, username: str) -> bool:
|
|
72
|
-
return self.get_user(username) is not None
|
|
73
|
-
|
|
64
|
+
cursor = conn.execute("SELECT password_hash FROM users WHERE username = ?", (username,))
|
|
65
|
+
row = cursor.fetchone()
|
|
66
|
+
return row[0] if row else None
|
|
@@ -10,7 +10,8 @@ from jose import JWTError, jwt
|
|
|
10
10
|
from detecti.core.database.config_db import ConfigDBManager, verify_password
|
|
11
11
|
|
|
12
12
|
from dotenv import load_dotenv
|
|
13
|
-
|
|
13
|
+
from detecti.config import DETECTI_HOME
|
|
14
|
+
load_dotenv(DETECTI_HOME / ".env")
|
|
14
15
|
|
|
15
16
|
# Secret key for JWT
|
|
16
17
|
SECRET_KEY = os.environ.get("JWT_SECRET_KEY")
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "detecti-cli"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.4"
|
|
8
8
|
description = "Modern Attack Surface Management & Threat Intelligence Engine"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -43,6 +43,7 @@ dependencies = [
|
|
|
43
43
|
"httpx>=0.27.0",
|
|
44
44
|
"pydantic>=2.7.0",
|
|
45
45
|
"pydantic-settings>=2.2.0",
|
|
46
|
+
"python-dotenv>=1.0.0",
|
|
46
47
|
"typer>=0.12.0",
|
|
47
48
|
"rich>=13.7.0",
|
|
48
49
|
"shodan>=1.31.0",
|
|
@@ -52,7 +53,7 @@ dependencies = [
|
|
|
52
53
|
"fastapi>=0.104.0",
|
|
53
54
|
"uvicorn[standard]>=0.24.0",
|
|
54
55
|
"psutil>=5.9.0",
|
|
55
|
-
"
|
|
56
|
+
"bcrypt>=4.0.0",
|
|
56
57
|
"python-jose[cryptography]>=3.3.0",
|
|
57
58
|
"python-multipart>=0.0.6",
|
|
58
59
|
]
|
|
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
|