Skip to content
Permalink
Browse files

Fixed #80. Added musashi target.

  • Loading branch information...
JGillam committed Jul 13, 2019
1 parent 282ee08 commit c4e836e0f0385c214abb3a89acd2660886cc5aad
Showing with 97 additions and 2 deletions.
  1. +1 −1 config/home/bookmarks.html
  2. +14 −1 install/targets.yml
  3. +82 −0 install/targets/musashi/musashi-task.yml
@@ -14,6 +14,6 @@ <H1>Bookmarks</H1>
<DT><A HREF="http://dvwa.wtf/" ADD_DATE="1515602695">DVWA</A>
<DT><A HREF="http://juice-shop.wtf/#/search" ADD_DATE="1515014560" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACQ0lEQVQ4jY2SzUtUYRTGn/Pe9975uk4zfiRpoRamZNBCiUyQxkVgEbVxH0FBm1a1TmjTqk1I1CroHwhxW7kKpqZC0Eqkmgo/rp/jfN25H+97WiUGztDZnuf8eM7DAzQYzg2aPHcxwTwp6mmoESA/PTbe0Z24a0TIgcaqIMxQ//Sb/RpZ7/jVo+HOtY3wXqI1zKRMiS/TDtIROco/rk1Qz8v8X92B1nJPB+OJZuuBERMZZ92HV9MIbANBixwKXDW5krsSb+iA08ljUmMcBLi1EOsbPnrPpQAwdovB5cKmPg5gvj5AqSoJwwUY0aYuWAmFxOGTILMN2PrsqdWPbmMHEbOKUJdYM1Kdw4hHK6D0GOD/hNaLZTcIKg0zMMy4y4wCADAzSJhA4AClt1C+U9S+qDYElOyST4QdsAJYgaABEQfarkOZ/YXtbNZrCMhkZkMho1vprjHE030g9oDqPKAq0GF1+91jBHUzYEDMnTl6JFwtx3y1DTeWB8QOqLkdqvgaQXGpcmpfAf9p4sLAgOUnvZsgvoOOSHcYh6XPp9B+wkazLVB1PJQ/uZuGY02hJh72PJ+t7TlYuDBg+0HttmEZ982kmSAm6CKDsxV4+RCOx0AphLSSrdHe0zeCte8vAHyTAJA929/iB7UnZNBVs8kkklSGhpYRwxIhRbHsg4gYhBWyI+9D59eM2nCX9174OtLXVEN4CYJMIcSW8tUuC/YNSx6Sthw1JI1IWy7B4qmCYS4OPfsQ4H+HAfo9MRzL3Ro0D9r/AYU7+H7GSFGwAAAAAElFTkSuQmCC">Juice Shop</A>
<DT><A HREF="http://dojo-scavenger.wtf/" ADD_DATE="1515014578" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA70lEQVQ4jc3SPU7DQBDF8Z9Z21iIBpCg4CgUFBSchJYCJHo4C5wCLpAbREKIngIivkSMHVPYQWRjJSl50hQ7mvfX7pvlv2oHlxjiFudYX9UccIcmqiskqwD28dYDuMdmPLzWc97Gdw94C7vLAAlyjHsA4+4GM54YADW+evqlngxiQJPneaVNP9awgy8GlGX5WRTFQBvcbx8DfET9eQCeq6p67YanescILzEg1gZOQgiP5tf4gFPtlmaU4ADXaZo+ZVkWG+Ma4QbH0xdcYBJCaEIIy8x/a4KzFEdI6nou4GVKcJhqv+50xwsDiswN9n4AXSVV4VRFzn0AAAAASUVORK5CYII=">dojo-scavenger</A>
<DT><A HREF="http://client.cors.dem/" ADD_DATE="1515014560">CORS Demonstrator</A>
<DT><A HREF="http://cors-dojo.wtf/" ADD_DATE="1515014560">CORS Demonstrator</A>
</DL><p>
</DL><p>
@@ -58,14 +58,27 @@
shell: '/tmp/npm_setup.sh'
when: stat_npm.stat.exists == False

- name: Add yarn repo key
apt_key:
url: https://dl.yarnpkg.com/debian/pubkey.gpg
state: present

- name: Add yarn repository
apt_repository:
repo: deb https://dl.yarnpkg.com/debian/ stable main

- name: Install nodejs
apt:
name: nodejs
name:
- nodejs
- yarn
update_cache: yes

- import_tasks: targets/juice-shop/juice-shop-tasks.yml
- import_tasks: targets/dvwa/dvwa-tasks.yml
- import_tasks: targets/mutillidae/mutillidae-tasks.yml
- import_tasks: targets/samurai-dojo/samurai-dojo-tasks.yml
- import_tasks: targets/musashi/musashi-task.yml


handlers:
@@ -0,0 +1,82 @@
- name: Get the latest release of musashi
git:
repo: https://github.com/SamuraiWTF/musashi-js.git
dest: /opt/targets/musashi
depth: 1
force: yes

- name: Install musashi with yarn
yarn:
path: /opt/targets/musashi


- name: Script to start Musashi
copy:
dest: /usr/local/bin/start_musashi.sh
content: |
#!/bin/bash
cd /opt/targets/musashi
sudo yarn start &
mode: 0744
force: no

- name: Create service descriptor for wtf-juice-shop
copy:
dest: /etc/systemd/system/wtf-musashi.service
content: |
[Unit]
Description=Musashi Target service
[Service]
Type=forking
ExecStart=/usr/local/bin/start_musashi.sh
[Install]
WantedBy=multi-user.target
mode: 0744

- name: Start Musashi
service:
name: wtf-musashi.service
state: started
enabled: yes

- name: Setup hosts file entries
lineinfile:
dest: /etc/hosts
line: '127.0.0.8 cors-dojo.wtf'

- name: Setup nginx reverse-proxy config for CORS client
copy:
dest: /etc/nginx/conf.d/musashi-cors-client.conf
content: |
server {
listen 80;
server_name cors-dojo.wtf;
location / {
proxy_pass http://localhost:3021;
}
}
mode: 0644
notify:
- restart nginx

- name: Setup hosts file entries for api
lineinfile:
dest: /etc/hosts
line: '127.0.0.9 api.cors.dem'

- name: Setup nginx reverse-proxy config for CORS API
copy:
dest: /etc/nginx/conf.d/musashi-cors-api.conf
content: |
server {
listen 80;
server_name api.cors.dem;
location / {
proxy_pass http://localhost:3020;
}
}
mode: 0644
notify:
- restart nginx

0 comments on commit c4e836e

Please sign in to comment.
You can’t perform that action at this time.