-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·33 lines (25 loc) · 1.24 KB
/
deploy.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
# Deploy Kali as a docker container. Tested on Amazon Linux 2.
# by Drew Blokzyl (@linuxkd)
# https://github.com/linuxkd/kali-docker/
# Update and install docker and jq, then start docker service
sudo yum update -y
sudo yum install -y docker jq
sudo service docker start
sudo systemctl enable docker
# Create an image named kali from the specified Dockerfile
sudo docker build -t kali-image https://raw.githubusercontent.com/linuxkd/kali-docker/master/Dockerfile
# Create a container named kali based on our image also named kali
sudo docker create --name kali kali-image
sudo docker start kali
# The path where we want to easily access our /root folder for the kali container
sudo mkdir /pentest
# Get the local path on disk from the container, then soft link it for easy access
mount_path="$(sudo docker inspect kali | jq -r '.[].Mounts[0].Source')"
sudo ln -s "$mount_path" /pentest/kali-root
# Grab the wrapper script so you can get into the container by just calling "kali"
curl -s "https://raw.githubusercontent.com/linuxkd/kali-docker/master/kali" --output /tmp/kali
chmod +x /tmp/kali
sudo mv /tmp/kali /usr/local/bin
# Append our path for root to be able to find the script
echo -e "\n$PATH=$PATH:/usr/local/bin" | sudo tee -a /root/.bashrc