自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

lazys3暴力枚舉buckets

原創(chuàng)
云計(jì)算
最近開(kāi)始研究云安全,將自己研究的一些東西記錄下,希望對(duì)大家有用。

本文的目的是知道一些buckets的名字或者知道該公司名字,想通過(guò)程序來(lái)對(duì)這個(gè)公司下的所有buckets進(jìn)行枚舉,測(cè)試了一些程序,其實(shí)都不太好用。唯一好用的是lazys3,該程序需要ruby環(huán)境支持??梢栽趉ali linux或者pentestbox等執(zhí)行,如果存在buckets則在結(jié)果中顯示200,否則是不存在的,其原理是生成字典進(jìn)行暴力匹配。另外還通過(guò)python程序來(lái)實(shí)現(xiàn)IP地址查詢buckets。

1.1.1安裝lazys3

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

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

1.1.2執(zhí)行命令

    通過(guò)ruby執(zhí)行命令,lazys3后跟的是公司名字或者是buckets名字

ruby lazys3 flaws.cloud

1.1.3查看結(jié)果

圖片

結(jié)果中顯示200的表示是存在,本例中顯示存在laws.cloud,s3 buckets通過(guò)地址進(jìn)行訪問(wèn):

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

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

圖片

1.1.4直接查看文件內(nèi)容

http://flaws.cloud.s3.amazonaws.com/+該目錄下的文件名稱

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

圖片

1.1.5通過(guò)aws命令來(lái)查看buckets

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

前提需要知道s3 buckets名字以及對(duì)應(yīng)的region。

圖片

 1.1.6其他的一些探索

  想通過(guò)IP地址來(lái)查詢存在aws的相關(guān)信息,代碼如下:

import requests
from netaddr import IPNetwork, IPAddress
import json
from xml.dom import minidom
class 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))
責(zé)任編輯:龐桂玉 來(lái)源: 51CTO
相關(guān)推薦

2015-12-22 17:50:12

2021-07-09 19:04:55

Cache查找消息

2014-04-16 11:03:36

MVC3JSON

2009-08-18 10:30:30

C#枚舉

2024-01-18 07:09:10

2012-05-17 09:28:06

代碼審查Java代碼

2010-12-10 11:26:56

“相親式”招聘

2023-09-11 07:17:30

2009-06-25 14:20:01

Java枚舉類型

2018-11-20 14:48:22

微信群集合數(shù)據(jù)

2022-08-10 14:36:43

物聯(lián)網(wǎng)智慧城市智能家居

2012-08-24 13:49:08

2009-05-20 11:30:21

2019-02-25 18:03:15

2011-06-01 16:31:23

枚舉

2011-11-09 13:40:16

Ubuntu瀏覽器

2011-11-29 10:03:24

2013-06-08 10:41:51

2009-10-21 14:44:11

2022-08-06 13:04:27

LinuxSHH
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)