# Smogcloud | Find Cloud Assets That No One Wants Exposed

**URL:** <https://onehack.st/t/smogcloud-find-cloud-assets-that-no-one-wants-exposed/176869>\
**Category:** Tools & Scripts\
**Tags:** hacking, freebies, tips-tricks, hosting\
**Created:** [March 28, 2021, 2:53pm UTC](https://onehack.st/t/smogcloud-find-cloud-assets-that-no-one-wants-exposed/176869 "2021-03-28T14:53:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueHacker](https://onehack.st/user_avatar/onehack.st/bluehacker/32/174721_2.png) [@BlueHacker](https://onehack.st/u/BlueHacker)\
**Post date:** [March 28, 2021, 2:53pm UTC](https://onehack.st/t/smogcloud-find-cloud-assets-that-no-one-wants-exposed/176869/1 "2021-03-28T14:53:46Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/0/3/0374cd3edcf19c095692cf4e434223c26d968d3e.png)

Find exposed AWS cloud assets that you did not know you had. A comprehensive asset inventory is step one to any capable security program. We made smogcloud to enable security engineers, penetration testers, and AWS administrators to monitor the collective changes that create dynamic and ephemeral internet-facing assets on a more frequent basis. May be useful to identify:

- Internet-facing FQDNs and IPs across one or hundreds of AWS accounts
- Misconfigurations or vulnerabilities
- Assets that are no longer in use
- Services not currently monitored
- Shadow IT

**Getting Started**

1. Install and [setup golang](https://www.callicoder.com/golang-installation-setup-gopath-workspace/)
2. Install smogcloud using the following command

```auto
    go get -u github.com/BishopFox/smogcloud

```

1. Set up aws environment variable for the account you wish to query. We suggest utilizing a read-only [Security Auditor](https://medium.com/@HorosAWSData/how-to-add-an-aws-user-with-security-audit-access-819f0aef7cee) role. The following commands can be used to set environment variables:

```auto
export AWS_ACCOUNT_ID='' # Describe accountexport AWS_ACCESS_KEY_ID='' # Access key for aws accountexport AWS_SECRET_ACCESS_KEY='' # Secret key for aws account

```

1. Run the application

```auto
smogcloud

```

or

```auto
go run main.go

```

**Current Services**

Supported services for extracting internet exposures:

```auto
* API Gateway* CloudFront* EC2* Elastic Kubernetes Service* Elastic Beanstalk* Elastic Search* Elastic Load Balancing * IoT* Lightsail* MediaStore* Relational Database Service* Redshift* Route53* S3

```

**AWS Patterns**

From studying Open API documentation on RESTful AWS endpoints we determined these are the patterns of exposure URIs that you may find in AWS accounts. It is important to understand how to interact with these native services to test them for vulnerabilities and other misconfigurations. Security engineers may want to monitor Cloudtrail logs or build DNS monitoring for requests to these services.

- s3
  - https://{user\_provided}.s3.amazonaws.com

- cloudfront
  - https://{random\_id}.cloudfront.net

- ec2
  - ec2-{ip-seperated}.compute-1.amazonaws.com

- es
  - https://{user\_provided}-{random\_id}.{region}.es.amazonaws.com

- elb
  - http://{user\_provided}-{random\_id}.{region}.elb.amazonaws.com:80
  - https://{user\_provided}-{random\_id}.{region}.elb.amazonaws.com:443

- elbv2
  - https://{user\_provided}-{random\_id}.{region}.elb.amazonaws.com

- rds
  - mysql://{user\_provided}.{random\_id}.{region}.rds.amazonaws.com:3306
  - postgres://{user\_provided}.{random\_id}.{region}.rds.amazonaws.com:5432

- route53
  - {user\_provided}

- execute-api
  - https://{random\_id}.execute-api.{region}.amazonaws.com/{user\_provided}

- cloudsearch
  - [https://doc-{user\_provided}-{random\_id}.{region}.cloudsearch.amazonaws.com](https://doc-%7Buser_provided%7D-%7Brandom_id%7D.%7Bregion%7D.cloudsearch.amazonaws.com/)

- transfer
  - sftp://s-{random\_id}.server.transfer.{region}.amazonaws.com

- iot
  - mqtt://{random\_id}.iot.{region}.amazonaws.com:8883
  - https://{random\_id}.iot.{region}.amazonaws.com:8443
  - https://{random\_id}.iot.{region}.amazonaws.com:443

- mq
  - [https://b-{random\_id}-{1,2}.mq.{region}.amazonaws.com:8162](https://b-%7Brandom_id%7D-%7B1%2C2%7D.mq.%7Bregion%7D.amazonaws.com:8162/)
  - ssl://b-{random\_id}-{1,2}.mq.{region}.amazonaws.com:61617

- kafka
  - b-{1,2,3,4}.{user\_provided}.{random\_id}.c{1,2}.kafka.{region}.amazonaws.com
  - {user\_provided}.{random\_id}.c{1,2}.kafka.{region}.amazonaws.com

- cloud9
  - https://{random\_id}.vfs.cloud9.{region}.amazonaws.com

- mediastore
  - https://{random\_id}.data.mediastore.{region}.amazonaws.com.

- kinesisvideo
  - https://{random\_id}.kinesisvideo.{region}.amazonaws.com

- mediaconvert
  - https://{random\_id}.mediaconvert.{region}.amazonaws.com

- mediapackage
  - https://{random\_id}.mediapackage.{region}.amazonaws.com/in/v1/{random\_id}/channel

- elasticbeanstalk
  - https://{random\_id}.{user\_provided}.elasticbeanstalk.com

- cognito
  - https://{user\_provided}.auth.{region}.amazoncognito.com

**References**

- [AWS SDK Go](https://docs.aws.amazon.com/sdk-for-go/api/)
- [API-guru Open API for AWS](https://github.com/APIs-guru/openapi-directory/tree/master/APIs/amazonaws.com)
- [aws-cli](https://github.com/aws/aws-cli)

**Authors**

- **Oscar Salazar** – _Initial work_ – [Bishop Fox](https://github.com/tracertea)
- **Rob Ragan** – _Initial work_ – [Bishop Fox  
 ](https://github.com/basicScandal)[@sweepthatleg](https://twitter.com/sweepthatleg)
- **Brandon Gaudet** – _Initial work_ – [Bishop Fox](https://github.com/brandondgaudet)

**Contributions**

We do our best to maintain our tools, but can’t always keep them as up to date as we’d like. So, we always appreciate code contributions, feature requests, and bug reports.

**Acknowledgments**

Thank you for inspiration

- [Cloudmapper](https://github.com/duo-labs/cloudmapper)
- [AWS Public IPs](https://github.com/arkadiyt/aws_public_ips)
- [John Backes & Tiros](https://aws.amazon.com/blogs/security/aws-security-profile-john-backes-senior-software-development-engineer/)
- [IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html)
- [Cartography](https://github.com/lyft/cartography)

## GitHub:

> **[GitHub - BishopFox/smogcloud: Find cloud assets that no one wants exposed 🔎 ☁️](https://github.com/BishopFox/smogcloud)**
>
> Find cloud assets that no one wants exposed 🔎 ☁️
