《Metasploit渗透测试魔鬼训练营》总结 (二)
测试环境配置
1.靶机环境
DMZ区:
-
Kali attacker.dvssc.com 10.10.10.128/24
-
OWASP www.dvscc.com 10.10.10.129/24
-
Win2K3 Metasploit service.dvssc.com 10.10.10.130/24
-
Metasploit_ubuntu gate.dvssc.com 10.10.10.254/24
内网区:
- Metasploit_ubuntu gate.dvssc.com 192.168.10.254(GW)
- WinXPenSP3 intranet1.dvssc.com 192.168.10.128/24
2.hosts文件配置
-
Kali vim /etc/hosts
-
Windows type C:\WINDOWS\system32\drivers\etc\hosts
3.网关Metasploit_ubuntu设置
#vim /etc/network/interfaces
设置两个网卡地址为自己需要的地址
# 打开数据包路由转发功能
root@metasploitable:~# vim /etc/sysctl.conf
net.ipv4.ip_forward=1
# 设置转发规则
root@metasploitable:~# vi /etc/rc.local/sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
exit 0
root@metasploitable:~# iptables -t nat -nL
...
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 192.168.12.0/24 0.0.0.0/0
...