114 lines
3.5 KiB
Plaintext
114 lines
3.5 KiB
Plaintext
1 - 📦 INSTALACIÓN DEL ENTORNO
|
|
===============================
|
|
|
|
1.1 - 📦 CLONAR EL REPO
|
|
--------------------------------
|
|
|
|
git clone https://git.gugler.com.ar/earamburu/selenium.git
|
|
|
|
1.2 -▶️ LEVANTAR CONTENEDORES DOCKER
|
|
------------------------------------
|
|
Ejecutar en la raíz del proyecto:
|
|
|
|
docker compose up -d # o alternativamente (para versiones antiguas): docker-compose up -d
|
|
|
|
1.3 -▶️ INSTALAR DEPENDENCIAS PHP Y PYTHON
|
|
------------------------------------------
|
|
Instalar requisitos para el entorno(PHP 8.4 y python3):
|
|
|
|
sudo apt install composer php8.4-curl php8.4-intl php8.4-mbstring php8.4-xml php8.4-cli python3
|
|
|
|
|
|
1.4 -🌐 VERIFICAR LOS SISTEMAS ESTEN FUNCIONANDO
|
|
------------------------------------------------
|
|
|
|
🧪 Selenium Grid: http://localhost:4444
|
|
📁 File Explorer: http://localhost:8081
|
|
|
|
|
|
2-📍 EJECUTAR LOS TEST
|
|
=======================
|
|
|
|
2.1 - 🔒 LOGIN FALLIDO
|
|
-----------------------
|
|
|
|
1. Instalar el paquete webdriver para PHP (en la raíz del proyecto):
|
|
|
|
composer require php-webdriver/webdriver
|
|
|
|
2. Ejecutar test de monitoreo:
|
|
|
|
php inicia_sesion_error.php
|
|
|
|
💡 Se puede ver la ejecución en tiempo real en Selenium Grid (http://localhost:4444) o por consola.
|
|
|
|
2.2 -🔒 MONITOREO DE PHISHING EN BUSCADORES
|
|
--------------------------------------------
|
|
|
|
1. Instalar dependencias phpmailer y phpdotenv para PHP (en la raíz del proyecto):
|
|
|
|
composer require phpmailer/phpmailer
|
|
composer require vlucas/phpdotenv
|
|
|
|
2. Crear archivo `.env` (opcional, para envío de correo):
|
|
|
|
EMAIL="tucorreo@gmail.com"
|
|
PASSWORD="tu_clave"
|
|
|
|
⚠️ Si no se define `.env`, el test funciona igual pero **no se enviará email**.
|
|
|
|
3. Ejecutar test de monitoreo:
|
|
|
|
php test_buscador.php
|
|
|
|
💡 Se puede ver la ejecución en tiempo real en Selenium Grid (http://localhost:4444) o por consola.
|
|
|
|
|
|
2.3 - 📊 MONITOREO DE MÉTRICAS DE SITIO
|
|
----------------------------------------
|
|
|
|
1. Instalar librerías necesarias de Python:
|
|
|
|
pip install 'urllib3<2' 'chardet<5'
|
|
pip install selenium python-dotenv requests
|
|
|
|
2. Ejecutar el test:
|
|
|
|
python3 metricas_gugler.py
|
|
|
|
💡 Se puede ver la ejecución en tiempo real en Selenium Grid (http://localhost:4444) o por consola.
|
|
|
|
|
|
|
|
3 - 📅 INCORPORAR LOS MONITOREOS EN TAREAS PROGRAMADAS
|
|
========================================================
|
|
|
|
🕒 3.1- EN LINUX UTILIZANDO CRONTAB
|
|
----------------------------------
|
|
Ejecutar: crontab -e
|
|
|
|
Incorporar y guardar:
|
|
|
|
0 * * * * /usr/bin/php /Ruta_proyectoXX/test_buscador.php >> /tmp/monitoreo_buscador.log 2>&1
|
|
30 * * * * /usr/bin/python3 /Ruta_proyectoXXX/metricas_gugler.py >> /tmp/metricas.log 2>&1
|
|
|
|
🕒 3.2- WINDOWS UTILIZANDO TAREAS PROGRAMADAS
|
|
-----------------------------------------
|
|
Abrí Task Scheduler (taskschd.msc en Ejecutar).
|
|
En el panel derecho, elegí Crear tarea….
|
|
Pestaña General:
|
|
Nombre: Monitoreo de Phishing
|
|
Marca "Ejecutar tanto si el usuario inició sesión como si no"
|
|
Pestaña Desencadenadores:
|
|
Nuevo…
|
|
Iniciar tarea: En un horario
|
|
Configuración: Diariamente
|
|
Repetir cada: 1 hora
|
|
Duración: Indefinidamente
|
|
Pestaña Acciones:
|
|
Nuevo…
|
|
Acción: Iniciar un programa
|
|
Programa/script: ruta al ejecutable (php.exe o python.exe)
|
|
Agregar argumentos: ruta completa al script.
|
|
|