- update the docker compose yml to be like:
- Add the capability
“NET_ADMIN”
and“NET_RAW”
- Bind your local port
2022:22
version: '3'
services:
ubuntu1:
container_name: ubuntu1
image: ubuntu-494
tty: true
stdin_open: true
cap_add:
- NET_ADMIN
- NET_RAW
networks:
kali_net:
ipv4_address: 10.3.0.2
ports:
- "2022:22"
kali1:
container_name: kali1
image: kali-494
tty: true
stdin_open: true
volumes:
- "kali_data:/usr/my_work"
networks:
kali_net:
ipv4_address: 10.3.0.3
MS2:
container_name: ms2
image: cyberacademylabs/metasploitable2
platform: linux/amd64
tty: true
stdin_open: true
networks:
kali_net:
ipv4_address: 10.3.0.4
openvas:
container_name: openvas
image: immauss/openvas
tty: true
stdin_open: true
environment:
USERNAME: user
PASSWORD: admin_pass
SKIPSYNC: true
ports:
- "9392:9392"
volumes:
- "kali_data:/usr/my_work"
networks:
kali_net:
ipv4_address: 10.3.0.5
nessus:
container_name: nessus
image: tenableofficial/nessus
platform: linux/amd64
restart: always
environment:
USERNAME: user
PASSWORD: admin_pass
ACTIVATION_CODE: VUNQ-N3AA-HNQK-R2WD-6NSX
ports:
- 8834:8834
volumes:
- "kali_data:/usr/my_work"
networks:
kali_net:
ipv4_address: 10.3.0.6
volumes:
kali_data:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '$WORK'
networks:
kali_net:
driver: bridge
ipam:
config:
- subnet: 10.3.0.0/16
gateway: 10.3.0.1
- install
ufw
andopenssh-server
:
apt install ufw openssh-server -y
- Make sure that the two services are up and running
# This is how to enable ssh
sudo service ssh start
# This will show you the status of the ssh
sudo service ssh status
# This how we check if it accessable from your host
ssh localhost
# The authenticity of host 'localhost (127.0.0.1)' can't be established.
# ED25519 key fingerprint is SHA256:H+/SWyU8BgjbMDG13jc/na9TzbGxLLjaK0Sfop+LaUk.
# This key is not known by any other names
# Are you sure you want to continue connecting (yes/no/[fingerprint])? ^C
- Check if the Accessable from docker network
- from your
Kali
# ssh from Kali
ssh 10.3.0.2
- Now try to access that from your local machine
ssh localhost -p 2022