Hackthebox - Pilgrimage

Pilgrimage

logo

nmap

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Nmap 7.94 scan initiated Wed Sep 20 11:21:58 2023 as: nmap -e tun0 -sC -sV -oA nmap/default -v 10.10.11.219
Nmap scan report for 10.10.11.219
Host is up (0.96s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey:
| 3072 20:be:60:d2:95:f6:28:c1:b7:e9:e8:17:06:f1:68:f3 (RSA)
| 256 0e:b6:a6:a8:c9:9b:41:73:74:6e:70:18:0d:5f:e0:af (ECDSA)
|_ 256 d1:4e:29:3c:70:86:69:b4:d7:2c:c8:0b:48:6e:98:04 (ED25519)
80/tcp open http nginx 1.18.0
|_http-title: Did not follow redirect to http://pilgrimage.htb/
|_http-server-header: nginx/1.18.0
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed Sep 20 11:22:40 2023 -- 1 IP address (1 host up) scanned in 42.74 seconds

pilgrimage.htb 添加到 hosts

git 泄露

gobuster 没扫到,discussion 看到的。。。

ff51deab2671deefd2d96a8bd810a66a.png

githack 下载源码

magick

源码中用到了 magick,查看版本

34cbc01cb42ad3e13886fe89dc04831b.png

CVE-2022-44268

编写任意文件读取 exp 后读取 git 泄露源码中的 sqlite 数据库 /var/db/pilgrimage

3f6e4c04f2ab68ec4be56bd383a23ab0.png

emily:abigchonkyboi123

459771caff063508721a2a7b69cb5fb8.png

成功登录 ssh

linpeas

进程

c88034c0e57c4ca9f23c6a94c6f549f3.png

.sh files

07bcfe632ccd755ea8522f7264abc1c8.png

4f6231a602bb67e5601ca9964cb0d718.png

c94cb5238e9bcdff8c3825e718476fa7.png

binwalk 2.3.2 有 RCE https://www.exploit-db.com/exploits/51249

f6d8796c114e65e35caf0109076f45ae.png

/etc/console-setup

14de1d4e91177554957b36e9e5e47430.png