sudo apt update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
This script incorrectly detect the OS as Debian. To fix it,
do this:
sudo nano /etc/apt/sources.list.d/docker.list
In nano, change "debian" to "ubuntu"
like this:
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable
Type Ctrl+X, Y, Enter to save the file.
Then execute these commands:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
The version of docker-compose in the repositories is too old.
Execute these commands to install a newer version:
sudo curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Now start docker, and make it automatically
start on reboot:
sudo systemctl start docker
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
git clone https://github.com/OWASP/crAPI.git
cd crAPI
sudo deploy/docker/build-all.sh
sudo nano /usr/local/bin/start_crapi
Enter this script into nano,
replacing "/root" with the directory
you used to git crAPI:
#!/bin/bash
/usr/local/bin/docker-compose -f /root/crAPI/deploy/docker/docker-compose.yml --compatibility up -d
Save the file. Then make it executable
with this command:
sudo chmod a+x /usr/local/bin/start_crapi
sudo apt install socat
First, move to the root user:
sudo su -
crontab -e
Add these lines to the crontab:
@reboot socat tcp-listen:80,reuseaddr,fork tcp:localhost:8888 &
@reboot socat tcp-listen:18025,reuseaddr,fork tcp:localhost:8025 &
@reboot /usr/local/bin/start_crapi
Save the file and reboot the server.
It takes a few minutes to start crapi.
To test it, open your server's IP address in a Web browser. You should see the crAPI login page, as shown below.
Flag AP 110.1: Netstat (15 pts)
On your server, execute this command:The flag is covered by a green rectangle in the image below.
sudo netstat -pant
Posted 5-4-22