Fetch the details of assets hosted on AWS.

Overview

onaws

onaws is a simple tool to check if an IP/hostname belongs to the AWS IP space or not. It uses the AWS IP address ranges data published by AWS to perform the search.

The tool could be used for:

  • Continuous recon of assets
  • Gathering assets using a specific service (e.g. EC2)
  • Finding region information for S3 buckets
  • ... etc.

onaws

Install

pip install onaws

Usage

Given an IP:

onaws 52.219.47.34

Given a hostname:

A domain or subdomain can be passed as input:

onaws example.com

You may also supply an S3 bucket hostname as input:

onaws dropbox.s3.amazonaws.com

List of hostnames

onaws accepts line-delimited hosts on STDIN. This is helpful if you want to pipe the output of other tools to onaws:

$ cat hosts.txt
uber.s3.amazonaws.com
aws.com
google.com


$ cat hosts.txt | onaws
{
    "uber.s3.amazonaws.com": {
        "is_aws_ip": true,
        "ip_address": "52.218.46.121",
        "service": "S3",
        "region": "eu-west-1",
        "matched_subnet": "52.218.0.0/17",
        "hostname": "uber.s3.amazonaws.com"
    },
    "aws.com": {
        "is_aws_ip": true,
        "ip_address": "52.84.13.117",
        "service": "CLOUDFRONT",
        "region": "GLOBAL",
        "matched_subnet": "52.84.0.0/15",
        "hostname": "aws.com"
    },
    "google.com": {
        "is_aws_ip": false
    }
}

Output

If the IP/hostname falls in the AWS IP range, onaws will return the service, region and other details in the output:

{
    "is_aws_ip": true,
    "ip_address": "52.218.196.155",
    "service": "S3",
    "region": "us-west-2",
    "matched_subnet": "52.218.128.0/17",
    "hostname": "flaws.cloud"
}

Contribution

I welcome contributions from the public. If you find something that could be improved, please file an Issue or send a PR :)

Credits

  • Thanks to @TomNomNom for suggesting the name.
Comments
  • Code refactor; input + output streaming (#1 and #2); better output

    Code refactor; input + output streaming (#1 and #2); better output

    I refactor the code and introduce input + output streaming (closes #1 and closes #2), with the output being in JSONL format. The input streaming approach was taken from the PR by @havefish (#3)—good stuff!

    Furthermore, I improve the output and make it list-input-friendly by showing the specified input. It now looks as follows: image

    opened by KarimPwnz 1
  • Cache ip ranges

    Cache ip ranges

    Given the size of the AWS IP ranges file, this PR makes onaws cache it. The cache is updated when the etag header, which represents the MD5 checksum of the remote data, does not match the local data checksum.

    The local cache is located at ~/.onaws/ip-ranges.json, and all functionality related to fetching the IP ranges has been moved to ipranges.py.

    opened by KarimPwnz 0
  • ISSUE #1, ISSUE #2: streaming input and output

    ISSUE #1, ISSUE #2: streaming input and output

    • current changes stream the input, hence the processing should occur at constant memory
    • However, as the output is still being gathered in-memory, the memory consumption on large input still remains; to be solved in issue #2.
    • a optional parameter has been added -s that takes two values t: text or j: json
    • with this change the whole process should run at constant memory
    • Example Usage: cat file.txt | onaws -sj
    opened by havefish 0
  • Line delimited Output

    Line delimited Output

    • currently the output is dumped in a single JSON.
    • this approach won't work for a large input
    • also streaming the output won't be possible, to use the output the while thing has to be produced first.
    • the solution is line delimited JSON or plain text
    opened by havefish 0
  • Added -i and -o parameters for input and output files

    Added -i and -o parameters for input and output files

    Quick and dirty solution to add input and output files to work in my pipeline. The changes should not break anything afaik, you can merge it if you like. Thank you for the code!

    opened by kz0ltan 0
Releases(v1.0.3)
Custom bot I've made to host events on my personal Discord server.

discord_events Custom bot I've made to host events on my personal Discord server. You can try the bot out in my personal server here: https://discord.

AlexFlipnote 5 Mar 16, 2022
A bot that is an updated & modified version of calvinnfernando's WebReg-Bot

WaitList-Bot A bot that is an updated & modified version of calvinnfernando's WebReg-Bot to automate getting into waitlisted classes in UCSD WebReg on

Issac In 1 Dec 01, 2022
Flood discord webhooks

Webhook-Spammer Flood discord webhooks Asynchronous webhook spammer Fast & Efficient Usage - Use it with atleast 500 threads Put a valid webhook Use a

trey 1 Apr 22, 2022
Joshua McDonagh 1 Jan 24, 2022
Upload on Doodstream by Url, File and also by direct forward post from other channel...

Upload on Doodstream by Url, File and also by direct forward post from other channel...

Pʀᴇᴅᴀᴛᴏʀ 8 Aug 10, 2022
A collection of scripts to steal BTC from Lightning Network enabled custodial services. Only for educational purpose! Share your findings only when design flaws are fixed.

Lightning Network Fee Siphoning Attack LN-fee-siphoning is a collection of scripts to subtract BTC from Lightning Network enabled custodial services b

Reckless_Satoshi 14 Oct 15, 2022
A Discord bot that may save your day by predicting it.

Sage A Discord bot that may save your day by predicting it.

1 Nov 17, 2022
A tool to build scripts to toggle between minimal & default services in Windows based on user defined lists.

A tool to build scripts to toggle between minimal & default services in Windows based on user defined lists.

AMIT 29 Jan 01, 2023
A Telegram bot for combining emojis.

combimoji combimoji is a Telegram bot for combining emojis. How can I use it? You can find combimoji at @combimoji_bot, however it is not up (as of No

Yarema Mishchenko 2 Dec 02, 2021
Python Capfire API wrapper

General CampfireAPI based on Campfire web. Install pip install Campfire-API Quickstart Use it without login: from campfire_api import CampfireAPI cf

Ghost 0 Jan 03, 2022
Official Python wrapper for the Quantel Finance API

Quantel is a powerful financial data and insights API. It provides easy access to world-class financial information. Quantel goes beyond just financial statements, giving users valuable information l

Guy 47 Oct 16, 2022
Windows版本微信客户端(非网页版)自动化,可实现简单的发送、接收微信消息

wxauto Windows版本微信客户端自动化,可实现简单的发送、接收微信消息

357 Dec 29, 2022
An API wrapper library for opensea api.

Opensea API An API wrapper library for opensea api. Installation pip3 install opensea Usage Retrieving assets: from opensea import get_assets # This

Ankush Singh 38 Jul 17, 2022
Easy to use API Wrapper for somerandomapi.ml.

Overview somerandomapi is an API Wrapper for some-random-api.ml Examples Asynchronous from somerandomapi import Animal

Myxi 1 Dec 31, 2021
Purpose To make a cloudflare challenge pass successfully, Can be use cf_clearance bypassed by cloudflare

Purpose To make a cloudflare challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with the cf_clearance, make sure you use the same IP and UA as when you got it.

vvanglro 129 Jan 09, 2023
A Discord bot to combat phishing links for Steam trades and Discord gifts.

delink-bot A Discord bot to combat phishing links for Steam trades and Discord gifts. Requirement python3 -m pip install -U discord.py python3 -m pip

hugonun 15 Dec 09, 2022
Mventory is an API-driven solution for Makerspaces, Tinkerers, and Hackers.

Mventory is an API-driven inventory solution for Makers, Makerspaces, Hackspaces, and just about anyone else who needs to keep track of "stuff".

Make Monmouth 107 Dec 21, 2022
A discord bot that will help you browse/download nhentai sources.

Risa Introduction Risa is an nHentai discord bot that will help you browse and download your favorite doujin inside your own discord server. Hosting M

markee7 14 Oct 25, 2021
Dodo - A graphical, hackable email client based on notmuch

Dodo Dodo is a graphical email client written in Python/PyQt5, based on the comm

Aleks Kissinger 44 Nov 12, 2022
Tiktok 2 Instagram With Python

Tiktok2Instagram 📸 About The Project What it does: Download the source video from a user inputted Tiktok URL. 📙 Add audio to the Tiktok video from a

Carter Belisle 4 Feb 06, 2022