如何使用awsEnum基于提供的凭证枚举AWS云端资源

部署运行你感兴趣的模型镜像

关于awsEnum

awsEnum是一款针对AWS云端资源安全的审计工具,该工具基于Python
3开发,可以帮助广大研究人员根据输入的凭证信息来枚举目标AWS云端资源和AWS服务。

当前该工具仍处于测试过程中,发布的为beta版本。该工具的主要目标是为了帮助广大研究人员更好地对AWS云端环境进行安全渗透测试,可以用于漏洞奖励计划、AWS云端安全审计或其他相关的安全研究活动。

功能介绍

1、通过boto3连接AWS服务;

2、awsEnum允许用户设置发送的请求数量,默认为1000;

3、awsEnum支持将分析结果存储为JSON文件;

4、支持将AWS凭证信息存储在awscli配置中,可以将配置文件以文件名参数的形式传递给awsEnum;

5、支持的服务:EC2、IAM、S3;

工具要求

Python 3

pip包管理工具

工具下载

由于该工具基于Python 3开发,因此广大研究人员首先需要在本地设备上安装并配置好Python
3环境。接下来,我们就可以使用下列命令将该项目源码克隆至本地了:

git clone https://github.com/bassammaged/awsEnum.git

工具部署

下载完成后,我们需要利用项目提供的requirements.txt安装该工具所需的其他依赖组件:

python3 -m pip install requirements.txt

工具使用

接下来,我们就可以直接 通过run.py脚本来运行awsEnum了:

python3 run.py

帮助信息

▄▄▄▄▄▄ ▄     ▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄    ▄ ▄▄   ▄▄ ▄▄   ▄▄

█      █ █ ▄ █ █       █       █  █  █ █  █ █  █  █▄█  █

█  ▄   █ ██ ██ █  ▄▄▄▄▄█    ▄▄▄█   █▄█ █  █ █  █       █

█ █▄█  █       █ █▄▄▄▄▄█   █▄▄▄█       █  █▄█  █       █

█      █       █▄▄▄▄▄  █    ▄▄▄█  ▄    █       █       █

█  ▄   █   ▄   █▄▄▄▄▄█ █   █▄▄▄█ █ █   █       █ ██▄██ █

█▄█ █▄▄█▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄█  █▄▄█▄▄▄▄▄▄▄█▄█   █▄█

--------------------------------------------------------

If you are looking to enumerate AWS services. So, welcome

to awsEnum, awsEnum is a python script trying to facilitate

the enumerate phase of AWS cloud with the lowest possible

headache and less noise. Therefore we are not supporting

the `all` mode. ----------------------------------------

--------------------------------------------------------

        developed by bassammaged (@kemet)

                version: 0.1 Beta

--------------------------------------------------------

[!] Make sure you already defined credential profile via AWS CLI.

 

usage: run.py [-h] [-p profile_name] [-r region_name] [-v | --verbose | --no-verbose] [-t TRIES] aws_service_name

 

positional arguments:

  aws_service_name      Specify the aws service for enumration. Supported services are: ['ec2', 'iam', 's3'] (default: all)

 

options:

  -h, --help            show this help message and exit

  -p profile_name, --profile profile_name

                        specify aws credential profile that will be used through the enumeration. (default: default)

  -r region_name, --region region_name

                        specify aws region. (default: eu-central-1)

  -v, --verbose, --no-verbose

                        Allows the script to print out the message level start with debug. (default: False)

  -t TRIES, --tries TRIES

                        set maximum tries. (default: 1000)

参数解释

aws_service_name:指定需要枚举的目标AWS服务,支持的参数:['ec2', 'iam', 's3'],默认:枚举所有资源;

-h, --help:显示工具帮助信息和退出;

-p profile_name, --profile profile_name:指定AWS凭证配置文件;

-r region_name, --region region_name:指定AWS实例区域,默认:eu-central-1;

-v, --verbose, --no-verbose:允许工具输出包含调试信息在内的所有信息,默认:False;

-t TRIES, --tries TRIES:设置最大尝试次数,默认:1000;

输出报告

[

    {

        "AmiLaunchIndex": 0,

        "ImageId": "ami-7c803d1c",

        "InstanceId": "i-05bef8a081f307783",

        "InstanceType": "t2.micro",

        "KeyName": "Default",

        "LaunchTime": "2017-02-12 22:29:24+00:00",

        "Monitoring": {

            "State": "disabled"

        },

        "Placement": {

            "AvailabilityZone": "us-west-2a",

            "GroupName": "",

            "Tenancy": "default"

        },

        "PrivateDnsName": "ip-172-31-41-84.us-west-2.compute.internal",

        "PrivateIpAddress": "172.31.41.84",

        "ProductCodes": [],

        "PublicDnsName": "ec2-35-165-182-7.us-west-2.compute.amazonaws.com",

        "PublicIpAddress": "35.165.182.7",

        "State": {

            "Code": 16,

            "Name": "running"

        },

        "StateTransitionReason": "",

        "SubnetId": "subnet-d962aa90",

        "VpcId": "vpc-1052ce77",

        "Architecture": "x86_64",

        "BlockDeviceMappings": [

            {

                "DeviceName": "/dev/sda1",

                "Ebs": {

                    "AttachTime": "2017-02-12 22:29:25+00:00",

                    "DeleteOnTermination": true,

                    "Status": "attached",

                    "VolumeId": "vol-04f1c039bc13ea950"

                }

            }

        ],

        "ClientToken": "kTOiC1486938563883",

        "EbsOptimized": false,

        "Hypervisor": "xen",

        "IamInstanceProfile": {

            "Arn": "arn:aws:iam::975426262029:instance-profile/flaws",

            "Id": "AIPAIK7LV6U6UXJXQQR3Q"

        },

        "NetworkInterfaces": [

            {

                "Association": {

                    "IpOwnerId": "amazon",

                    "PublicDnsName": "ec2-35-165-182-7.us-west-2.compute.amazonaws.com",

                    "PublicIp": "35.165.182.7"

                },

                "Attachment": {

                    "AttachTime": "2017-02-12 22:29:24+00:00",

                    "AttachmentId": "eni-attach-a4901fc2",

                    "DeleteOnTermination": true,

                    "DeviceIndex": 0,

                    "Status": "attached",

                    "NetworkCardIndex": 0

                },

                "Description": "",

                "Groups": [

                    {

                        "GroupName": "launch-wizard-1",

                        "GroupId": "sg-490f6631"

                    }

                ],

                "Ipv6Addresses": [],

                "MacAddress": "06:b0:7a:92:21:cf",

                "NetworkInterfaceId": "eni-c26ed780",

                "OwnerId": "975426262029",

                "PrivateDnsName": "ip-172-31-41-84.us-west-2.compute.internal",

                "PrivateIpAddress": "172.31.41.84",

                "PrivateIpAddresses": [

                    {

                        "Association": {

                            "IpOwnerId": "amazon",

                            "PublicDnsName": "ec2-35-165-182-7.us-west-2.compute.amazonaws.com",

                            "PublicIp": "35.165.182.7"

                        },

                        "Primary": true,

                        "PrivateDnsName": "ip-172-31-41-84.us-west-2.compute.internal",

                        "PrivateIpAddress": "172.31.41.84"

                    }

                ],

                "SourceDestCheck": true,

                "Status": "in-use",

                "SubnetId": "subnet-d962aa90",

                "VpcId": "vpc-1052ce77",

                "InterfaceType": "interface"

            }

        ],

        "RootDeviceName": "/dev/sda1",

        "RootDeviceType": "ebs",

        "SecurityGroups": [

            {

                "GroupName": "launch-wizard-1",

                "GroupId": "sg-490f6631"

            }

        ],

        "SourceDestCheck": true,

        "VirtualizationType": "hvm",

        "CpuOptions": {

            "CoreCount": 1,

            "ThreadsPerCore": 1

        },

        "CapacityReservationSpecification": {

            "CapacityReservationPreference": "open"

        },

        "HibernationOptions": {

            "Configured": false

        },

        "MetadataOptions": {

            "State": "applied",

            "HttpTokens": "optional",

            "HttpPutResponseHopLimit": 1,

            "HttpEndpoint": "enabled",

            "HttpProtocolIpv6": "disabled",

            "InstanceMetadataTags": "disabled"

        },

        "EnclaveOptions": {

            "Enabled": false

        },

        "PlatformDetails": "Linux/UNIX",

        "UsageOperation": "RunInstances",

        "UsageOperationUpdateTime": "2017-02-12 22:29:24+00:00",

        "PrivateDnsNameOptions": {},

        "MaintenanceOptions": {

            "AutoRecovery": "default"

        }

    }

]

工具运行截图

最后

对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

同时每个成长路线对应的板块都有配套的视频提供:


当然除了有配套的视频,同时也为大家整理了各种文档和书籍资料&工具,并且已经帮大家分好类了。

因篇幅有限,仅展示部分资料,有需要的小伙伴,可以【扫下方二维码】免费领取:

您可能感兴趣的与本文相关的镜像

Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值