GuardianUnivalle-Benito-Yucra 0.1.30__py3-none-any.whl → 0.1.31__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.

@@ -209,7 +209,7 @@ class CSRFDefenseMiddleware(MiddlewareMixin):
209
209
  intentos_csrf = len(descripcion)
210
210
  s_csrf = w_csrf * intentos_csrf
211
211
 
212
- request.sql_attack_info = {
212
+ request.csrf_attack_info = {
213
213
  "ip": client_ip,
214
214
  "tipos": ["CSRF"],
215
215
  "descripcion": descripcion,
@@ -142,7 +142,7 @@ class DOSDefenseMiddleware(MiddlewareMixin):
142
142
  )
143
143
 
144
144
  # Enviar a sistema de auditoría
145
- request.sql_attack_info = {
145
+ request.dos_attack_info = {
146
146
  "ip": client_ip,
147
147
  "tipos": ["DoS"],
148
148
  "descripcion": descripcion,
@@ -39,6 +39,40 @@ if not logger.handlers:
39
39
  handler = logging.StreamHandler()
40
40
  handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s"))
41
41
  logger.addHandler(handler)
42
+ # =========================================
43
+ # Middleware de Keylogger para Django
44
+ # =========================================
45
+ from django.utils.deprecation import MiddlewareMixin
46
+
47
+
48
+ class KEYLOGGERDefenseMiddleware(MiddlewareMixin):
49
+ """
50
+ Middleware que ejecuta el escaneo de keyloggers
51
+ en cada request entrante.
52
+ """
53
+
54
+ def __init__(self, get_response=None):
55
+ super().__init__(get_response)
56
+ # Importa tu clase de detección
57
+ from .detector_keylogger import KEYLOGGERDefense
58
+
59
+ self.detector = KEYLOGGERDefense()
60
+
61
+ def process_request(self, request):
62
+ """
63
+ Ejecuta el escaneo antes de procesar la vista.
64
+ Guarda los resultados en el objeto request para uso posterior.
65
+ """
66
+ try:
67
+ resultado = self.detector.ejecutar_escaneo()
68
+ request.keylogger_attack_info = resultado
69
+ except Exception as e:
70
+ # Evita que un error detenga Django
71
+ import logging
72
+
73
+ logger = logging.getLogger("keyloggerdefense")
74
+ logger.error("Error en KEYLOGGERDefenseMiddleware: %s", e)
75
+
42
76
 
43
77
  # =====================================================
44
78
  # === CONFIGURACIÓN DE PARÁMETROS ===
@@ -172,7 +172,7 @@ class XSSDefenseMiddleware(MiddlewareMixin):
172
172
  s_xss,
173
173
  )
174
174
 
175
- request.sql_attack_info = {
175
+ request.xss_attack_info = {
176
176
  "ip": client_ip,
177
177
  "tipos": ["XSS"],
178
178
  "descripcion": matches,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GuardianUnivalle-Benito-Yucra
3
- Version: 0.1.30
3
+ Version: 0.1.31
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
@@ -4,17 +4,17 @@ GuardianUnivalle_Benito_Yucra/auditoria/registro_auditoria.py,sha256=YxEtF6ZJj8M
4
4
  GuardianUnivalle_Benito_Yucra/criptografia/cifrado_aead.py,sha256=wfoRpaKvOqPbollNQsDNUNWClYJlXYTKTYvv0qcR6aI,962
5
5
  GuardianUnivalle_Benito_Yucra/criptografia/intercambio_claves.py,sha256=9djnlzb022hUhrDbQyWz7lWLbkn_vQZ4K7qar1FXYmo,829
6
6
  GuardianUnivalle_Benito_Yucra/criptografia/kdf.py,sha256=_sbepEY1qHEKga0ExrX2WRg1HeCPY5MC5CfXZWYyl-A,709
7
- GuardianUnivalle_Benito_Yucra/detectores/detector_csrf.py,sha256=8gynkJlxF2XfHPLdWaMS048b5Tuhznsb4JI3bqggC0g,7892
8
- GuardianUnivalle_Benito_Yucra/detectores/detector_dos.py,sha256=ech5UmUwK84EPSVZvjI0Q4Pq7w8WGymuYc77LgAKiiA,6163
9
- GuardianUnivalle_Benito_Yucra/detectores/detector_keylogger.py,sha256=T46HXHT3LZz3kke4GcxOM8urJSy-Vq2BEDfo9_F56Pw,6717
7
+ GuardianUnivalle_Benito_Yucra/detectores/detector_csrf.py,sha256=wt9LRMG9XK4eSSmW91tlGmsJWfyk445b8-n2oxlXlwo,7893
8
+ GuardianUnivalle_Benito_Yucra/detectores/detector_dos.py,sha256=KpsFnZvPmtKVgxR2Em_gIQvoho3sGOE_qQSWOEhts48,6163
9
+ GuardianUnivalle_Benito_Yucra/detectores/detector_keylogger.py,sha256=OFJvtv53T7VZ7Y6aUVbh69X3odKQih6c36_CrmHpl7M,7859
10
10
  GuardianUnivalle_Benito_Yucra/detectores/detector_sql.py,sha256=o2IXqF3Nbsh5roPihyLal42iCzgxfyX3D6Ef-cxOpVo,6644
11
- GuardianUnivalle_Benito_Yucra/detectores/detector_xss.py,sha256=kdXJsoDjvBVccrO2QiE65Q527sUjy1WmlzYg8rDjmqA,6795
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.30.dist-info/licenses/LICENSE,sha256=5e4IdL542v1E8Ft0A24GZjrxZeTsVK7XrS3mZEUhPtM,37
17
- guardianunivalle_benito_yucra-0.1.30.dist-info/METADATA,sha256=yS2g75_JDicESJXiuBDwCJXOYiyCe0lrXzlSjEB8XNM,1893
18
- guardianunivalle_benito_yucra-0.1.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- guardianunivalle_benito_yucra-0.1.30.dist-info/top_level.txt,sha256=HTWfZM64WAV_QYr5cnXnLuabQt92dvlxqlR3pCwpbDQ,30
20
- guardianunivalle_benito_yucra-0.1.30.dist-info/RECORD,,
16
+ guardianunivalle_benito_yucra-0.1.31.dist-info/licenses/LICENSE,sha256=5e4IdL542v1E8Ft0A24GZjrxZeTsVK7XrS3mZEUhPtM,37
17
+ guardianunivalle_benito_yucra-0.1.31.dist-info/METADATA,sha256=vQcoQBkoN-xyETRaFzql04uf3vTfoksVTIeykOZcd4k,1893
18
+ guardianunivalle_benito_yucra-0.1.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ guardianunivalle_benito_yucra-0.1.31.dist-info/top_level.txt,sha256=HTWfZM64WAV_QYr5cnXnLuabQt92dvlxqlR3pCwpbDQ,30
20
+ guardianunivalle_benito_yucra-0.1.31.dist-info/RECORD,,