SkyTower: 1

靶机地址

image-20250505215916240

80 是一个登录界面,存在 SQL 注入,万能密码直接登录进去了

image-20250505215922390

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
Welcome [email protected]

As you may know, SkyTech has ceased all international operations.

To all our long term employees, we wish to convey our thanks for your dedication and hard work.

Unfortunately, all international contracts, including yours have been terminated.

The remainder of your contract and retirement fund, $2 ,has been payed out in full to a secure account. For security reasons, you must login to the SkyTech server via SSH to access the account details.

Username: john
Password: hereisjohn

We wish you the best of luck in your future endeavors.

欢迎访问 [email protected]

您可能已经知道,SkyTech 已停止所有国际业务。

我们衷心感谢所有长期员工的奉献和辛勤工作。

很遗憾,所有国际合同,包括您的合同,均已终止。

您的合同余额和退休金(2 美元)已全额支付至一个安全账户。出于安全考虑,您必须通过 SSH 登录 SkyTech 服务器才能访问账户详情。

用户名:john
密码:hereisjohn

祝您未来一切顺利。

下一步就是通过 ssh 登录上服务器了,但是刚刚并没有扫出来开放了 22 端口,不过有一个代理的 3128 端口,直接通过 proxytunnel 会返回 403,所以尝试在后边跟随命令,输入 john 密码,成功拿到 shell

尝试使用 mount 提权,但一直提示不是一个可交互的终端,script 应该也被改过,perl 也打不开一个交互式的终端,继续不下去了,查看 wp 发现是因为是 .bashrc 的原因,导致了这个终端存在问题,而应该也和我使用的代理有关,删掉了 .bashrc 再次重新连接也还是不行,更换成 proxychains 就可以了

image-20250505215934504

然后在网站目录下拿到了 mysql 数据库的密码,并成功连接

查出来三个邮箱和密码,而这三个都是系统用户,经试验第二个能登录,第三个不能

image-20250505215948122

直接使用 sara/ihatethisjob 登录,也是无法登录的,仍然需要删除目录下的 .bashrc 文件才行,重复之前的操作:

1
2
3
4
5
proxychains ssh [email protected] /bin/bash # 然后输入密码
ls -al
rm .bashrc
# 退出然后重新连接
proxychains ssh [email protected]

没有可以直接能提权的命令,但是发现了两个高权限的命令 lscat

image-20250505215959099

/root 目录下成功拿到 flag 和 root 密码

root/theskytower