NSSCTF 4th

NSSCTF 4th

Aristore

Misc

TRyAsSH

Challenge

nss/20254th

Solution

本题考点是 rbash 逃逸

一开始拿 nc 连接发现应该改用 ssh 连接(其实看到题目名称早该想到的)

然后根据题目描述 nss/20254th 不难想到出题人想表达的是用户名 nss 对应的密码是 20254th

1
ssh -t nss@node10.anna.nssctf.cn -p 21588

连上来之后输出了这些东西然后就立刻断连了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-142-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Sun Aug 24 13:36:41 2025 from 124.240.80.16
Hello guy. There are to many good challengs in NSSCTF 4th.

Why you still look at this musc game? Please go on.

Bye bye.

我当时粗看以为下面的也是机器连接上之后像上半部分一样默认的输出,后来偶然看到提示i want more and more and more回来做这道题才发现下半部分的不对劲(唉,这题这么简单早该做出来的)

那就问题就很显然是出在 more 这里了,估计下面这段内容是用 more 读取的(大多数师傅估计都不会把命令行窗口缩得太小吧,因此这一点不太明显),然后要从 more 入手 get shell

题目很可能是设置了 more 读取完文件之后就立即退出,因此很容易想到要把终端窗口的高度调得非常小,小到连那几行欢迎语都放不下,more 命令就不得不停下来,在屏幕底部显示一个 –More– 的提示,就像这样:

1
2
3
4
5
Hello guy. There are to many good challengs in NSSCTF 4th.

Why you still look at this musc game? Please go on.

--More--(93%)

粗略尝试 !/bin/bash!/bin/sh 都没法直接拿到 shell,于是尝试使用 v 命令启动编辑器

按下 V 成功进入了 vi 编辑器,接下来就可以使用 vi 逃逸了,依次输入:

1
2
:set shell=/bin/sh
:shell

拿到 shell 之后读取根目录下的flag文件即可

(下面这里本该有一张图片的,但由于未知原因导致其无法正常显示,图片链接我就放这了👉 https://origin.picgo.net/2025/08/25/NSSCTF4th-1b2e92368811cf41a.png

NSSCTF4th-1

1
NSSCTF{e68147f1-e0ef-47a8-a424-3400f85803b1}
  • 标题: NSSCTF 4th
  • 作者: Aristore
  • 创建于 : 2025-08-25 04:00:00
  • 更新于 : 2025-08-25 04:30:46
  • 链接: https://www.aristore.top/posts/NSSCTF4th/
  • 版权声明: 版权所有 © Aristore,禁止转载。
评论
目录
NSSCTF 4th