diff --git a/docker-compose.yml b/docker-compose.yml index c3b6c4d..832d44d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,9 @@ services: # ---------------------------------------- # NGINX (Web Server) # ---------------------------------------- - nginx: + victim-nginx: image: nginx:stable-alpine - container_name: sec_lab_nginx + container_name: sec_lab_victim_nginx ports: - "58690:80" # روی سرور پورت 80 باز باشد volumes: @@ -39,14 +39,15 @@ services: restart: always # اپلیکیشن دوم: سرور هکر (یک سرور بسیار سبک برای میزبانی پی‌لودها) - hacker-app: - image: nginx:alpine - container_name: sec_lab_hacker + attacker-app: + image: nginx:stable-alpine + container_name: sec_lab_attacker_nginx + ports: + - "58691:80" # مپ کردن به پورت 8002 سرور volumes: - - ./hacker_files:/usr/share/nginx/html:ro + - ./hacker_site:/usr/share/nginx/html:ro networks: - lab_net - restart: always networks: lab_net: diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index ed7e787..6c4c914 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -1,22 +1,15 @@ -# تنظیمات سایت قربانی (Laravel) -server { - listen 80; - server_name victim.lab; - root /var/www/html/public; - 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; - } -} +# تنظیم برای victim.lab + + ServerName victim.lab + ProxyPreserveHost On + ProxyPass / http://127.0.0.1:8001/ + ProxyPassReverse / http://127.0.0.1:8001/ + -# تنظیمات سایت مهاجم (Static/Hacker) -server { - listen 80; - server_name attacker.lab; - location / { - proxy_pass http://hacker-app:80; - } -} \ No newline at end of file +# تنظیم برای attacker.lab + + ServerName attacker.lab + ProxyPreserveHost On + ProxyPass / http://127.0.0.1:8002/ + ProxyPassReverse / http://127.0.0.1:8002/ + \ No newline at end of file