-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·33 lines (24 loc) · 1.01 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -euo pipefail
sudo apt-get update
sudo apt-get install -y docker.io python-pip rabbitmq-server
cp server-scripts/add_user.py docker/ssh-docker/
cp server-scripts/user_shell.py docker/ssh-docker/
cp server-scripts/change_user_pass.py docker/ssh-docker
pushd docker/ssh-docker
docker build -t shell-image .
docker create -it --name shell-server -h tamuctf-shell -p 4300:4300 -p 2222:2222 -v /dev/fuse:/dev/fuse -v /var/run/docker.sock:/var/run/docker.sock shell-image
docker start shell-server
docker exec -d shell-server shellinaboxd -b -t -p 4300 &
docker exec -d shell-server /usr/sbin/sshd -p 2222 &
docker exec -d shell-server setfacl -m g:ctf-users:rw /var/run/docker.sock
popd
pushd docker/apache-docker
docker build -t apache-image .
docker run -itd --name apache-server -p 80:80 -p 443:443 apache-image
popd
docker run -d --hostname shell-rabbit --name rabbit-server -p 5672:5672 -p 15672:15672 rabbitmq:latest
sleep 10s
pushd server-scripts/
python shell_queue_recv.py &> rabbitmqlog.txt &
popd