GuardianUnivalle-Benito-Yucra 0.1.31__py3-none-any.whl → 0.1.32__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.
Potentially problematic release.
This version of GuardianUnivalle-Benito-Yucra might be problematic. Click here for more details.
- GuardianUnivalle_Benito_Yucra/detectores/detector_keylogger.py +22 -22
- {guardianunivalle_benito_yucra-0.1.31.dist-info → guardianunivalle_benito_yucra-0.1.32.dist-info}/METADATA +1 -1
- {guardianunivalle_benito_yucra-0.1.31.dist-info → guardianunivalle_benito_yucra-0.1.32.dist-info}/RECORD +6 -6
- {guardianunivalle_benito_yucra-0.1.31.dist-info → guardianunivalle_benito_yucra-0.1.32.dist-info}/WHEEL +0 -0
- {guardianunivalle_benito_yucra-0.1.31.dist-info → guardianunivalle_benito_yucra-0.1.32.dist-info}/licenses/LICENSE +0 -0
- {guardianunivalle_benito_yucra-0.1.31.dist-info → guardianunivalle_benito_yucra-0.1.32.dist-info}/top_level.txt +0 -0
|
@@ -20,6 +20,7 @@ Algoritmos:
|
|
|
20
20
|
* Fórmula: S_keylogger = w_keylogger * (procesos + archivos + instalaciones)
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
+
""" E:\EcuacionPotosi\GuardianUnivalle-Benito-Yucra\GuardianUnivalle_Benito_Yucra\detectores\detector_keylogger.py """
|
|
23
24
|
from __future__ import annotations
|
|
24
25
|
import psutil
|
|
25
26
|
import os
|
|
@@ -64,13 +65,10 @@ class KEYLOGGERDefenseMiddleware(MiddlewareMixin):
|
|
|
64
65
|
Guarda los resultados en el objeto request para uso posterior.
|
|
65
66
|
"""
|
|
66
67
|
try:
|
|
67
|
-
|
|
68
|
+
# Detecta en modo interactivo
|
|
69
|
+
resultado = self.detector.ejecutar_escaneo(modo_interactivo=True)
|
|
68
70
|
request.keylogger_attack_info = resultado
|
|
69
71
|
except Exception as e:
|
|
70
|
-
# Evita que un error detenga Django
|
|
71
|
-
import logging
|
|
72
|
-
|
|
73
|
-
logger = logging.getLogger("keyloggerdefense")
|
|
74
72
|
logger.error("Error en KEYLOGGERDefenseMiddleware: %s", e)
|
|
75
73
|
|
|
76
74
|
|
|
@@ -165,7 +163,7 @@ class KEYLOGGERDefense:
|
|
|
165
163
|
o software espía potencialmente malicioso.
|
|
166
164
|
"""
|
|
167
165
|
|
|
168
|
-
def ejecutar_escaneo(self):
|
|
166
|
+
def ejecutar_escaneo(self, modo_interactivo=False):
|
|
169
167
|
procesos = detectar_procesos_sospechosos()
|
|
170
168
|
archivos = detectar_archivos_sospechosos()
|
|
171
169
|
programas = detectar_programas_instalados()
|
|
@@ -173,34 +171,36 @@ class KEYLOGGERDefense:
|
|
|
173
171
|
total_hallazgos = len(procesos) + len(archivos) + len(programas)
|
|
174
172
|
score = calcular_score_keylogger(total_hallazgos)
|
|
175
173
|
|
|
174
|
+
evento = {
|
|
175
|
+
"tipo": "Keylogger",
|
|
176
|
+
"procesos": procesos,
|
|
177
|
+
"archivos": archivos,
|
|
178
|
+
"programas": programas,
|
|
179
|
+
"score": score,
|
|
180
|
+
"descripcion": [],
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
if total_hallazgos > 0:
|
|
177
|
-
descripcion = [
|
|
184
|
+
evento["descripcion"] = [
|
|
178
185
|
f"Procesos sospechosos: {len(procesos)}",
|
|
179
186
|
f"Archivos sospechosos: {len(archivos)}",
|
|
180
187
|
f"Programas sospechosos: {len(programas)}",
|
|
181
188
|
]
|
|
189
|
+
if modo_interactivo:
|
|
190
|
+
# Retornar hallazgos para mostrar al usuario antes de bloquear
|
|
191
|
+
return evento
|
|
182
192
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
evento = {
|
|
186
|
-
"tipo": "Keylogger",
|
|
187
|
-
"descripcion": descripcion,
|
|
188
|
-
"procesos": procesos,
|
|
189
|
-
"archivos": archivos,
|
|
190
|
-
"programas": programas,
|
|
191
|
-
"score": score,
|
|
192
|
-
}
|
|
193
|
-
|
|
193
|
+
# Si no es interactivo, registra y bloquea automáticamente
|
|
194
194
|
registrar_evento(
|
|
195
195
|
tipo="Keylogger",
|
|
196
196
|
descripcion=f"Detectados {total_hallazgos} elementos sospechosos.",
|
|
197
197
|
severidad="ALTA" if score >= 0.5 else "MEDIA",
|
|
198
198
|
)
|
|
199
|
-
|
|
200
199
|
return evento
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
|
|
201
|
+
# Si no hay hallazgos
|
|
202
|
+
evento["descripcion"] = ["Sin hallazgos"]
|
|
203
|
+
return evento
|
|
204
204
|
|
|
205
205
|
|
|
206
206
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GuardianUnivalle-Benito-Yucra
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.32
|
|
4
4
|
Summary: Middleware y detectores de seguridad (SQLi, XSS, CSRF, DoS, Keylogger) para Django/Flask
|
|
5
5
|
Author-email: Andres Benito Calle Yucra <benitoandrescalle035@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -6,15 +6,15 @@ GuardianUnivalle_Benito_Yucra/criptografia/intercambio_claves.py,sha256=9djnlzb0
|
|
|
6
6
|
GuardianUnivalle_Benito_Yucra/criptografia/kdf.py,sha256=_sbepEY1qHEKga0ExrX2WRg1HeCPY5MC5CfXZWYyl-A,709
|
|
7
7
|
GuardianUnivalle_Benito_Yucra/detectores/detector_csrf.py,sha256=wt9LRMG9XK4eSSmW91tlGmsJWfyk445b8-n2oxlXlwo,7893
|
|
8
8
|
GuardianUnivalle_Benito_Yucra/detectores/detector_dos.py,sha256=KpsFnZvPmtKVgxR2Em_gIQvoho3sGOE_qQSWOEhts48,6163
|
|
9
|
-
GuardianUnivalle_Benito_Yucra/detectores/detector_keylogger.py,sha256=
|
|
9
|
+
GuardianUnivalle_Benito_Yucra/detectores/detector_keylogger.py,sha256=Hio8QBBVgpHkhNekw1pJx7y8BtldVbRHFDZ0s8RghFU,7939
|
|
10
10
|
GuardianUnivalle_Benito_Yucra/detectores/detector_sql.py,sha256=o2IXqF3Nbsh5roPihyLal42iCzgxfyX3D6Ef-cxOpVo,6644
|
|
11
11
|
GuardianUnivalle_Benito_Yucra/detectores/detector_xss.py,sha256=Ipw1XXBd1-SsOOhhl9joQGduTq0GhSa61TRTyASF3XE,6795
|
|
12
12
|
GuardianUnivalle_Benito_Yucra/middleware_web/middleware_web.py,sha256=23pLLYqliUoMrIC6ZEwz3hKXeDjWfHSm9vYPWGmDDik,495
|
|
13
13
|
GuardianUnivalle_Benito_Yucra/mitigacion/limitador_peticion.py,sha256=ipMOebYhql-6mSyHs0ddYXOcXq9w8P_IXLlpiIqGncw,246
|
|
14
14
|
GuardianUnivalle_Benito_Yucra/mitigacion/lista_bloqueo.py,sha256=6AYWII4mrmwCLHCvGTyoBxR4Oasr4raSHpFbVjqn7d8,193
|
|
15
15
|
GuardianUnivalle_Benito_Yucra/puntuacion/puntuacion_amenaza.py,sha256=Wx5XfcII4oweLvZsTBEJ7kUc9pMpP5-36RfI5C5KJXo,561
|
|
16
|
-
guardianunivalle_benito_yucra-0.1.
|
|
17
|
-
guardianunivalle_benito_yucra-0.1.
|
|
18
|
-
guardianunivalle_benito_yucra-0.1.
|
|
19
|
-
guardianunivalle_benito_yucra-0.1.
|
|
20
|
-
guardianunivalle_benito_yucra-0.1.
|
|
16
|
+
guardianunivalle_benito_yucra-0.1.32.dist-info/licenses/LICENSE,sha256=5e4IdL542v1E8Ft0A24GZjrxZeTsVK7XrS3mZEUhPtM,37
|
|
17
|
+
guardianunivalle_benito_yucra-0.1.32.dist-info/METADATA,sha256=n2CYltEwsbvvDqxBQthGNb46KplvOZ6s8BKuGEgOR7w,1893
|
|
18
|
+
guardianunivalle_benito_yucra-0.1.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
guardianunivalle_benito_yucra-0.1.32.dist-info/top_level.txt,sha256=HTWfZM64WAV_QYr5cnXnLuabQt92dvlxqlR3pCwpbDQ,30
|
|
20
|
+
guardianunivalle_benito_yucra-0.1.32.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|