当前位置:首页 >时尚 >lazys3暴力枚举buckets 力枚其实都不太好用

lazys3暴力枚举buckets 力枚其实都不太好用

2024-06-30 16:27:15 [百科] 来源:避面尹邢网

lazys3暴力枚举buckets

原创 作者: 陈小兵 云计算 最近开始研究云安全,力枚将自己研究的力枚一些东西记录下,希望对大家有用。力枚

本文的力枚目的是知道一些buckets的名字或者知道该公司名字,想通过程序来对这个公司下的力枚所有buckets进行枚举,测试了一些程序,力枚其实都不太好用。力枚唯一好用的力枚是lazys3,该程序需要ruby环境支持。力枚可以在kali linux或者pentestbox等执行,力枚如果存在buckets则在结果中显示200,力枚否则是力枚不存在的,其原理是力枚生成字典进行暴力匹配。另外还通过python程序来实现IP地址查询buckets。力枚

lazys3暴力枚举buckets 力枚其实都不太好用

1.1.1安装lazys3

官方地址:https://github.com/nahamsec/lazys3

lazys3暴力枚举buckets 力枚其实都不太好用

git clone https://github.com/nahamsec/lazys3.git

lazys3暴力枚举buckets 力枚其实都不太好用

1.1.2执行命令

    通过ruby执行命令,力枚lazys3后跟的是公司名字或者是buckets名字

ruby lazys3 flaws.cloud

1.1.3查看结果

图片

结果中显示200的表示是存在,本例中显示存在laws.cloud,s3 buckets通过地址进行访问:

flaws.cloud+.s3.amazonaws.com=flaws.cloud.s3.amazonaws.com

http://flaws.cloud.s3.amazonaws.com/

图片

1.1.4直接查看文件内容

http://flaws.cloud.s3.amazonaws.com/+该目录下的文件名称

http://flaws.cloud.s3.amazonaws.com/hint3.html

图片

1.1.5通过aws命令来查看buckets

aws s3 ls  s3://flaws.cloud/ --no-sign-request --region us-west-2

前提需要知道s3 buckets名字以及对应的region。

图片

 1.1.6其他的一些探索

  想通过IP地址来查询存在aws的相关信息,代码如下:

import requestsfrom netaddr import IPNetwork, IPAddressimport jsonfrom xml.dom import minidomclass Nimbusland:    def __init__(self):        self.aws_url = 'https://ip-ranges.amazonaws.com/ip-ranges.json'        self.azure_url = 'https://download.microsoft.com/download/0/1/8/018E208D-54F8-44CD-AA26-CD7BC9524A8C/PublicIPs_20200824.xml'        try:            self._load_aws_ips()            self._load_azure_ips()        except Exception as e:            raise Exception("Error loading IP addresses: " + str(e))    def _load_ips(self, url):        try:            response = requests.get(url, allow_redirects=True, verify=False)            response.raise_for_status()            return response.content        except Exception as e:            raise Exception("Error loading IP addresses: " + str(e))    def _load_aws_ips(self):        try:            self.aws_ips = json.loads(self._load_ips(self.aws_url))        except Exception as e:            raise Exception("Error loading AWS IP addresses: " + str(e))    def _load_azure_ips(self):        try:            self.azure_ips = minidom.parseString(self._load_ips(self.azure_url).decode("utf-8")).getElementsByTagName('Region')        except Exception as e:            raise Exception("Error loading Azure IP addresses: " + str(e))    def get_ip_info(self, target_ip, ip_data, region_key, vendor_name):        for item in ip_data:            if IPAddress(target_ip) in IPNetwork(str(item["ip_prefix"])):                return [target_ip, str(item["ip_prefix"]), str(item[region_key]), vendor_name, str(item["service"])]        return False    def get_aws_ip_info(self, target_ip):        try:            return self.get_ip_info(target_ip, self.aws_ips["prefixes"], "region", 'AWS')        except Exception as e:            raise Exception("Error getting AWS IP information: " + str(e))    def get_azure_ip_info(self, target_ip):        try:            return self.get_ip_info(target_ip, self.azure_ips, "Name", 'Azure')        except Exception as e:            raise Exception("Error getting Azure IP information: " + str(e))
责任编辑:庞桂玉 来源: 51CTO lazys3buckets

(责任编辑:娱乐)

    推荐文章
    热点阅读