kgretzky / evilginx

PLEASE USE NEW VERSION: https://github.com/kgretzky/evilginx2
MIT License
1.07k stars 260 forks source link

Fix Dockerfile to add compatibility #45

Closed poweroftrue closed 5 years ago

poweroftrue commented 6 years ago

Hello,

I saw issues with combinability in this repo and I faced them also, so I decided to add docker support it will make Evilginx works on any operating system even windows!

Getting started

  1. Install docker any way you like or you can do it simply with curl sudo curl -sSL https://get.docker.com/ | sh.
  2. Now you need to build the docker image docker build -t evilginx . * run this command inside Evilgnix folder.

That's all now you can run the Evilginx image you just build docker run -d --name evilginx -p 80:80 evilginx

Run Evilginx commands

The Docker container will run nginx only because container should do only one thing so I'll add later support for cron jobs (automatic parse log, automatic update cert) vai docker compose.

Now you can run any evilginx command like this:

$ docker exec -it evilginx /evilginx/evilginx.py setup --enable google -d test.com

Now restart container (to restart Nginx):

$ docker restart evilginx

Export sites and logs

You can use docker volume to mount evilginx folder outside the container to easily edit sites or view logs

  1. Stop evilginx container if you started docker stop evilginx
  2. Run evilginx with volume docker run -d --name evilginx -p 80:80 -v "$PWD/sites":/evilginx/sites evilginx.

Now if any file changed inside the container it reflects in your sites dir.

This still under testing I got OpenResty up and running and I'll test all functionality later tomorrow.

I also suggest that @kgretzky create a public image on docker hub something like kgretzku/evilginx so no build required just pulling the image it will reduce the time to get started. If you want I can do it.

Please, anyone, feel free to try it out and tell me if any issues occurred.