我想用docker搭载渗透测试的虚拟机环境,跪求大佬帮忙


Kali Linux 配置如下:
配置 IP 地址:10.10.10.128
vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.10.10.128
netmask 255.255.255.0
gateway 10.10.10.254
配置 hosts 文件
root@attacker:~# vim /etc/hosts
10.10.10.128 attacker.dvssc.com
10.10.10.129 www.dvssc.com
10.10.10.130 service.dvssc.com
10.10.10.254 gate.dvssc.com
配置主机名:
root@attacker:~# vim /etc/hostname
attacker.dvssc.com
Owaspbwa 1.2 配置如下:
root@owaspbwa:~# vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.10.10.129
netmask 255.255.255.0
gateway 10.10.10.254
配置主机名:
root@owaspbwa:~# vim /etc/hostname
www.dvssc.com
Metasploitable2-Linux 配置如下:
配置 IP 地址:
root@www:~# vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.10.10.254
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
auto eth1
iface eth1 inet static
address 192.168.10.254
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
配置主机名:
root@www:~# vim /etc/hostname
gate.dvssc.com
设置路由转发:
root@gate:~# vim /etc/sysctl.conf
net.ipv4.ip_forward=1
配置路由转发规则:
root@gate:~# /sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0
-j MASQUERADE
配置路由转发规则开机启动:
root@gate:~# vim /etc/rc.local
/sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j
MASQUERADE
Windows 2K Metasploit 配置如下:
配置 IP 地址:
IP Address. . . . . . . . . . . . : 10.10.10.130
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.10.10.254
WinXP Metasploit 配置如下:
配置 IP 地址:
IP Address. . . . . . . . . . . . : 192.168.10.128
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.10.254
配置 hosts 文件:
192.168.10.128 intranet1.dvssc.com
192.168.10.254 gate.dvssc.com
10.10.10.128 attacker.dvssc.com
10.10.10.129 www.dvssc.com
10.10.10.130 service.dvssc.com
10.10.10.254 gate.dvssc.com

这是去年实验室布置的任务,他们要虚拟机来配置, 但是我的电脑只有ubuntu系统,虚拟机软件我是懒得装,所以只能把这个放一放,一直在想有没有其他更好的办法来解决,只到我遇到了docker。
不过有几个问题我还是搞不懂

  • 能不能用docker容器做NAT服务器,联系其他容器
  • docker容器的ip地址能不能指定
  • docker只有一张网卡怎么办
  • docker容器能做内部的gateway吗

其实的话学了docker没多久,想通过搭载渗透环境来练练手,奈何能力太弱,求小伙伴们指点一下