Skip to main content

Use RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.

Project description

orgia

Use RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.

Useful for conducting Recon on a big Organisation.

For example, after running orgia the OG way on "Hilton", I got 96436 v4 IPs.

Installation

pipx

Global installation:

pipx install git+https://github.com/sttlr/orgia
orgia -h

Or run without installing:

pipx run --spec git+https://github.com/sttlr/orgia orgia -h

Docker

git clone https://github.com/sttlr/orgia
cd orgia
docker build -t orgia .
docker run --rm orgia -h

Usage

usage: orgia [-h] [--org ORG_NAME] [--version] [--silent] [--debug] [-c PATH] [--sources SOURCE]
             [--orgs-input-file PATH] [--asns-input-file PATH] [--networks-input-file PATH]
             [--max-enrich] [-o PATH] [--adjacent]
             [--orgs | --asns | --networks | --cidrs | --export-all PATH] [--jsonl] [--ip4-only]

Use RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.

options:
  -h, --help            show this help message and exit
  --org ORG_NAME        organization name (ex. "Hilton")
  --version             show program's version number and exit
  --silent              display results only (useful for piping to jq)
  --debug               print debug info
  -c PATH, --config PATH
                        path to .yaml config file
  --sources SOURCE      comma separated, possible values: all (default), arin, ripe, apnic,
                        afrinic, lacnic
  --orgs-input-file PATH
                        path to input file with Organisation handles
  --asns-input-file PATH
                        path to input file with ASN handles
  --networks-input-file PATH
                        path to input file with Network handles
  --max-enrich          use level 2 when trying to bruteforce entity name
  -o PATH, --output PATH
                        path to output file (default stdout)
  --adjacent            parse adjacent (dirty): ASNs from Orgs and Orgs from Networks
  --orgs                show only Organisation handles in output
  --asns                show only ASNs in output
  --networks            show only Network handles in output
  --cidrs               show only CIDRs in output
  --export-all PATH     folder to export everything
  --jsonl               show output in jsonl formal
  --ip4-only            show only IPv4 networks in output

by sttlr

Quick

Get CIDRs for specified Orgname:

orgia --org ORGNAME --cidrs

Enriched

Try even more enriched Orgnames when searching.

orgia --org ORGNAME --max-enrich --cidrs

Resolve only

If you have input files with handles, pass them via --asns-input-file, --orgs-input-file, --networks-input-file and orgia will resolve them for you:

orgia --asns-input-file ORGNAME_asn_handles.txt \
  --orgs-input-file ORGNAME_org_handles_.txt \
  --networks-input-file ORGNAME_networks_handles.txt

You can combine it with any of the output options: --cidrs, --orgs, --asns, --networks, --export-all

Specific

Select source

Choose source (arin, ripe, apnic, afrinic, lacnic) - default "all":

orgia --org ORGNAME --sources ripe,arin

IPv4 only

Don't print IPv6 Networks/CIDRs in the output:

orgia --org ORGNAME --ip4-only --cidrs

Pipe to jq

By default, orgia prints handles only (for --orgs, --asns, --networks).

You can pass --jsonl to use JSON as the output format. When piping to jq also use --silent:

orgia --org ORGNAME --asns --silent --jsonl | jq

Use config

Whitelist or blacklist handles, names, emails in output.

When checking, input is lowercased and in is used for comparison (checks if a config string in a test string).

You can create a config file and pass it via --config option:

orgia --org ORGNAME --cidrs --config PATH_TO_CONFIG.yaml

Empty config looks like this:

orgs:
  whitelist-handles: []
  blacklist-handles: []
  whitelist-names: []
  blacklist-names: []
  whitelist-emails: []
  blacklist-emails: []

asns:
  whitelist-handles: []
  blacklist-handles: []
  whitelist-names: []
  blacklist-names: []
  whitelist-emails: []
  blacklist-emails: []
  
networks:
  whitelist-handles: []
  blacklist-handles: []
  whitelist-names: []
  blacklist-names: []
  whitelist-emails: []
  blacklist-emails: []

OG

Comprehensive.

Create handle input files via org_info - parse directly from RIPE, APNIC, AfriNIC WHOIS databases:

./bin/query_asn ORGNAME > ORGNAME_asns_from_org_info.txt
./bin/query_org ORGNAME > ORGNAME_orgs_from_org_info.txt
./bin/query_inetnum ORGNAME > ORGNAME_networks_from_org_info.txt

Then run the OG:

orgia --org ORGNAME \
  --sources all \
  --max-enrich \
  --asns-input-file ORGNAME_asns_from_org_info.txt \
  --orgs-input-file ORGNAME_orgs_from_org_info.txt \
  --networks-input-file ORGNAME_networks_from_org_info.txt \
  --export-all orgia_ORGNAME_export \
  --config orgia_ORGNAME_config.yaml

Folder with results (orgia_ORGNAME_export) will contain:

  • cidrs.txt - list of all CIDRs
  • asns.jsonl - ASN info in JSONL format
  • orgs.jsonl - Organisation info in JSONL format
  • networks.jsonl - Network info in JSONL format

Adjacent mode (dirty)

You can use --adjacent option, to also extract ASNs from Orgs and Orgs from Networks. NOTE: It's dirty, and will result in lots of trash results.

API

You can import orgia as a package to use it in your scripts:

from orgia.nics import RIPE, ARIN, LACNIC, APNIC, AFRINIC

Or low-level:

from orgia.nics import RDAP, Engine

NOTE: orgia isn't designed to be used this way.

TODO

Pull requests are welcome ;)

  • Implement Async via httpx.AsyncClient()
  • Improve upon developer API - get rid of args argument when creating a class
  • Add more options in a config file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orgia-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orgia-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file orgia-0.1.1.tar.gz.

File metadata

  • Download URL: orgia-0.1.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for orgia-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d7b74acd94e02e5b500dcf3780be1098e2436f24c8b4504efa0f6cb4fcdd8e88
MD5 687ee882d0c10e153a06f760943d8286
BLAKE2b-256 09793a79b07b03974cff5746984f8660a90fbf36e9219dc848f8ef04a20779e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for orgia-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on sttlr/orgia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orgia-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: orgia-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for orgia-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20e42a89affd12cc09025c5a722b81fb0e814347e91f900cb73dc4f1eb8a91f3
MD5 e18bc5b1f57f4b0b8d25db38ff770b46
BLAKE2b-256 b897e94f016775e1e30f202bbd02e6414d7f973f66ac6ef1642a5813b09cd4d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for orgia-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on sttlr/orgia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page