Post

VulNyx Shared靶机复盘

难度-Medium

VulNyx Shared靶机复盘

网段扫描

1
2
3
4
5
6
7
8
9
10
└─# arp-scan -l 
Interface: eth0, type: EN10MB, MAC: 00:0c:29:df:e2:a7, IPv4: 192.168.26.128
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.26.1    00:50:56:c0:00:08       VMware, Inc.
192.168.26.2    00:50:56:e8:d4:e1       VMware, Inc.
192.168.26.168  00:0c:29:7a:e6:2f       VMware, Inc.
192.168.26.254  00:50:56:e2:a3:32       VMware, Inc.

4 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.577 seconds (99.34 hosts/sec). 4 responded

端口扫描

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
└─# nmap -p- -sC -sV 192.168.26.168       
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-17 08:03 EST
Nmap scan report for 192.168.26.168 (192.168.26.168)
Host is up (0.0034s latency).
Not shown: 65526 closed tcp ports (reset)
PORT      STATE SERVICE  VERSION
22/tcp    open  ssh      OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey: 
|   256 9d:c2:e5:b9:bc:86:d4:81:5e:ad:aa:8d:87:a8:ad:5b (ECDSA)
|_  256 6a:d1:8a:c1:4d:f9:0c:4f:c5:f6:21:bb:c9:a6:24:53 (ED25519)
80/tcp    open  http     Apache httpd 2.4.57 ((Debian))
|_http-title: Apache2 Debian Default Page: It works
|_http-server-header: Apache/2.4.57 (Debian)
111/tcp   open  rpcbind  2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  3,4          111/tcp6  rpcbind
|   100000  3,4          111/udp6  rpcbind
|   100003  3,4         2049/tcp   nfs
|   100003  3,4         2049/tcp6  nfs
|   100005  1,2,3      39495/tcp   mountd
|   100005  1,2,3      45281/tcp6  mountd
|   100005  1,2,3      51436/udp6  mountd
|   100005  1,2,3      52559/udp   mountd
|   100021  1,3,4      34641/tcp6  nlockmgr
|   100021  1,3,4      43706/udp6  nlockmgr
|   100021  1,3,4      44517/tcp   nlockmgr
|   100021  1,3,4      51347/udp   nlockmgr
|   100024  1          38669/tcp   status
|   100024  1          40579/tcp6  status
|   100024  1          46810/udp   status
|   100024  1          51507/udp6  status
|   100227  3           2049/tcp   nfs_acl
|_  100227  3           2049/tcp6  nfs_acl
2049/tcp  open  nfs_acl  3 (RPC #100227)
38669/tcp open  status   1 (RPC #100024)
39495/tcp open  mountd   1-3 (RPC #100005)
41017/tcp open  mountd   1-3 (RPC #100005)
44517/tcp open  nlockmgr 1-4 (RPC #100021)
49081/tcp open  mountd   1-3 (RPC #100005)
MAC Address: 00:0C:29:7A:E6:2F (VMware)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 72.19 seconds

获取webshell

图 0
图 1

这里需要进行的操作是获取挂载的信息,上面有路径可以将路径文件获取本地,注意点是用户可能需要更改

图 2

没成功可能是我的方式错了

图 3
图 4
图 5
图 6

这里思路断了,需要去扫描web端口看看有什么线索

图 7

新线索wordpress的漏洞

图 8

存在域名,查看一下插件漏洞

图 9
图 10
图 11

这里很多插件漏洞需要一个一个试,不过可以尝试爆破密码再试插件漏洞

图 12

存在LFI,觉得可以尝试php-filter,但是不存在,并且不能直接读取wp-config.php

图 13
图 14

目前想法爆破ssh,因为知道用户名,或者继续进行插件利用

整了半天发现还有LFI没处理完

图 15
图 16

存在日志读取,利用一下日志注入看看

图 17

成功操作,可以获取webshell

图 18
图 19

USER 提权

图 20
图 21
图 22

mysql 无果,可以尝试用上面密码登录用户

图 23

还是无果

图 24

没有想法选择利用工具查看信息

图 25
找到一个zip

图 26
看来是找keepass的密码,这里需要利用一个工具是keepwn

图 27
图 28

到这里就需要等着了

图 29
图 30

这里有账号和密码

图 31
尝试一下发现只有一个用户可以登录账号密码

ROOT 提权

图 32
图 33
图 34
图 35

得深刻理解一下这句话的含有

图 36

有点想法了不过要尝试一下,首先必须回主机因为它为root,我现在需要做到的是把主机/tmp上的文件传过去,因为他是一个挂载的形式

图 37
图 38
图 39

图 40

奥,懂了现在是一起开着的状态同时同步

图 41
有一个问题是他这个不行

图 42
看一下有python,可以利用一下 图 43
没有权限,继续想一下别的方案比如直接更改文件

图 44
图 45
方向是对的,但是没获取到root权限

图 46

图 47
图 48
图 49
图 50

操作有点多余,但至少解决了主机bash和靶机bash版本匹配问题,这里如果有大佬有更加简单的方案可以留言在b站给我

好了到这里靶场就结束了

userflag:760ad04a056fb67653ffc01eda470e45

rootflag:8e03a0a039069f840196498da1750f1e

This post is licensed under CC BY 4.0 by the author.