CloudCheck
UPDATE: Now rewritten in Rust, with over 20 new providers added!
CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider. It includes:
- A Rust CLI
- A Rust library
- Python bindings
Cloud Provider Signatures
The latest cloud provider signatures are available in cloud_providers_v2.json, which is updated daily via CI/CD. Domains associated with each cloud provider are fetched dynamically from the v2fly community repository, and CIDRs are fetched from ASNDB.
Used by BBOT and BBOT Server.
CLI Usage
# installation
# usage
# output:
{
}
# output:
{
}
Python Library Usage
# installation
=
= await
# [{'name': 'Google', 'tags': ['cloud']}]
Rust Library Usage
# Add to Cargo.toml
[]
= "8.0"
= { = "1", = ["full"] }
use CloudCheck;
async
Update the JSON database
Adding a new cloud provider
When adding a new cloud provider:
-
Create a new file in the
cloudcheck/providersdirectory and name it whatever you want, e.g.amazon.py. -
Inside that file, create a new class that inherits from
BaseProvider. -
Inside that class, fill out any of the following attributes that are relevant to your provider:
v2fly_company: The company name for v2fly domain fetching. This will dynamically fetch domains from the v2fly community repository, whose purpose is to keep track of domain ownership across different companies.org_ids: A list of organization IDs from ASNDB. These are always preferable to hard-coded ASNs or CIDRs, since they are updated daily from live sources. Big companies like Amazon typically have one organization ID per Regional Internet Registries (ARIN, RIPE, APNIC, LACNIC, AFRINIC), and within that organization ID, they may have multiple ASNs.asns: A list of ASNs, e.g.[12345, 67890]cidrs: A list of CIDRs, e.g.["1.2.3.4/32", "5.6.7.8/32"](it's always preferred to useorg_idsor if necessaryasnsover manually-specified CIDRs)domains: A list of domains, e.g.["amazon.com", "amazon.co.uk"](it's always preferred to usev2fly_companyinstead of hard-coding domains)tags: A list of tags for the provider. These are used in BBOT to tag IPs, DNS names etc. that match this provider. Examples:cloud,cdn,waf, etc.regexes: A dictionary of regexes for the provider. These are used in BBOT to extract / validate cloud resources like storage buckets. Currently valid regexes are:STORAGE_BUCKET_NAME: A regex for the name of a storage bucket (useful when brute-forcing bucket names, as you can discard invalid bucket names early).STORAGE_BUCKET_HOSTNAME: A regex for the hostname of a storage bucket
In addition to the above attributes, if you have a custom source of CIDRsor domains, you can override the
fetch_cidrs()orfetch_domains()methods (which by default return an empty list) to go fetch your custom TXT/JSON file, etc.
Supported cloud providers
- Akamai (source)
- Alibaba (source)
- Amazon (source)
- Arvancloud (source)
- Azure (source)
- Backblaze (source)
- Cisco (source)
- Cloudflare (source)
- Cloudfront (source)
- Dell (source)
- DigitalOcean (source)
- Fastly (source)
- GitHub (source)
- Google (source)
- Heroku (source)
- Hetzner (source)
- HPE (source)
- Huawei (source)
- IBM (source)
- Imperva (source)
- Kamatera (source)
- Oracle Cloud (source)
- OVH (source)
- Rackspace (source)
- Salesforce (source)
- Scaleway (source)
- Tencent (source)
- Wasabi (source)
- Zoho (source)