From f5eab0badf905f95bea39476849d2ca9055aecd8 Mon Sep 17 00:00:00 2001 From: mcoder Date: Tue, 14 Apr 2026 16:44:08 +0330 Subject: [PATCH] Add --- docker-compose.yml | 10 ++++++++++ docker/nginx/default.conf | 27 +++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 338bb46..c3b6c4d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,16 @@ services: - lab_net restart: always +# اپلیکیشن دوم: سرور هکر (یک سرور بسیار سبک برای میزبانی پی‌لودها) + hacker-app: + image: nginx:alpine + container_name: sec_lab_hacker + volumes: + - ./hacker_files:/usr/share/nginx/html:ro + networks: + - lab_net + restart: always + networks: lab_net: driver: bridge \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 9bfd80d..ed7e787 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -1,27 +1,22 @@ +# تنظیمات سایت قربانی (Laravel) server { listen 80; - - # شناسایی همزمان هر دو دامنه شبیه‌سازی شده - server_name victim.lab attacker.lab localhost; - + server_name victim.lab; root /var/www/html/public; - index index.php index.html; - - # لاگ‌های مجزا برای تحلیل حملات - access_log /var/log/nginx/sec-lab-access.log; - error_log /var/log/nginx/sec-lab-error.log; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - + index index.php; + location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass php:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } +} - location ~ /\.ht { - deny all; +# تنظیمات سایت مهاجم (Static/Hacker) +server { + listen 80; + server_name attacker.lab; + location / { + proxy_pass http://hacker-app:80; } } \ No newline at end of file