Skip to content

Commit

Permalink
Merge pull request #1 from justin-p/switch_away_from_docker
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-p authored Nov 19, 2020
2 parents 7c5509e + eb8db3b commit 85a5447
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 65 deletions.
9 changes: 6 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
# defaults file for evilginx2
evilginx2_path: /opt/evilginx2
evilginx2_repo_url: https://github.com/kgretzky/evilginx2
evilginx2_repo_tag: 2.4.0
evilginx2_version: 2.4.0
evilginx2_platform: linux
evilginx2_arch: amd64
evilginx2_sha256: sha256:595a77ddfb6f674bd5bc1c297ae912f5ebf6ba218a2f857ff46b7b37d1a9678b
evilginx2_download_destination: "/tmp/evilginx2-{{ evilginx2_version }}-{{ evilginx2_platform }}-{{ evilginx2_arch }}.tar.gz"
evilginx2_install_destination: /opt
24 changes: 1 addition & 23 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,4 @@ dependencies:
version: 1.1.14
tags: molecule-idempotence-notest
- role: robertdebock.core_dependencies
version: 1.5.0
- include_role:
name: geerlingguy.docker
version: 2.8.1
- role: geerlingguy.pip
version: 2.0.0
vars:
pip_package: python3-pip
pip_install_packages:
- name: docker
- include_role:
name: igor_mukhin.bash_aliases
version: v1.1.0
vars:
bash_aliases:
- {
alias: 'setup_tmux',
command: 'tmux new-session -d -s "evilginx"'
}
- {
alias: 'start_evilginx2',
command: 'docker run -it -p 80:80 -p 443:443 -v /root/.evilginx:/root/.evilginx -v /opt/evilginx2/phishlets/:/app/phishlets evilginx2'
}
version: 1.5.0
2 changes: 0 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@
pip_package: python3-pip
pip_install_packages:
- name: docker
- role: igor_mukhin.bash_aliases
version: v1.1.0
13 changes: 13 additions & 0 deletions tasks/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Install dependencies from apt
ansible.builtin.package:
name: "{{ evilginx2_packages }}"
state: present

- name: "Ensure the {{ evilginx2_install_destination }} directory exists"
file:
path: "{{ evilginx2_install_destination }}"
state: directory
owner: root
group: root
mode: "0750"
31 changes: 31 additions & 0 deletions tasks/evilginx2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: Check if we already downloaded the zip.
stat:
path: "{{ evilginx2_download_destination }}"
register: tar

- name: "Downloading evilginx-{{ evilginx2_platform }}-{{ evilginx2_arch }}.tar.gz"
get_url:
validate_certs: True
url: "{{ evilginx2_url }}"
checksum: "{{ evilginx2_sha256 }}"
dest: "{{ evilginx2_download_destination }}"
when: not tar.stat.exists

- name: Unzip evilginx-{{ evilginx2_platform }}-{{ evilginx2_arch }}.tar.gz
unarchive:
src: "{{ evilginx2_download_destination }}"
dest: "{{ evilginx2_install_destination }}"
remote_src: yes
mode: 0740
when: not tar.stat.exists

- name: Run evilginx2 in tmux session # noqa 305
shell: "{{ item }}"
with_items:
- tmux new-session -d -s "start_tmux_server"
- tmux kill-server
- tmux new-session -d -s "evilginx2"
- tmux send-keys -t evilginx2.0 'cd {{ evilginx2_install_destination }}/evilginx' ENTER
- tmux send-keys -t evilginx2.0 'sudo ./evilginx' ENTER
changed_when: false
41 changes: 5 additions & 36 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
---
# tasks file for evilginx2- include_role:
- name: Install git and tmux are installed
ansible.builtin.package:
name: "{{ evilginx2_packages }}"
state: present

- name: Ensure the "{{ evilginx2_path }}" directory exists
file:
path: "{{ evilginx2_path }}"
state: directory
owner: root
group: root
mode: "0750"

- name: Clone evilginx2 using the "{{ evilginx2_repo_tag }}"
git:
repo: "{{ evilginx2_repo_url }}"
dest: "{{ evilginx2_path }}"
version: "{{ evilginx2_repo_tag }}"

- name: Build docker image for evilginx2
docker_image:
name: evilginx2
build:
pull: no
path: "{{ evilginx2_path }}"
source: build

- name: Run evilginx2 container in tmux session # noqa 305
shell: "{{ item }}"
with_items:
- tmux new-session -d -s "start_tmux_server"
- tmux kill-server
- tmux new-session -d -s "evilginx2"
- tmux send-keys -t evilginx2.0 start_evilginx2 ENTER
changed_when: false
# tasks file for evilginx2
- block:
- import_tasks: dependencies.yml
- import_tasks: evilginx2.yml
become: true
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# vars file for evilginx2
evilginx2_url: "https://github.com/kgretzky/evilginx2/releases/download/{{ evilginx2_version }}/evilginx-{{ evilginx2_platform }}-{{ evilginx2_arch }}.tar.gz"
evilginx2_packages:
- git
- tmux

0 comments on commit 85a5447

Please sign in to comment.