orgia


Nameorgia JSON
Version 0.1 PyPI version JSON
download
home_page
SummaryUse RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.
upload_time2024-01-31 10:13:57
maintainer
docs_urlNone
authorsttlr
requires_python>=3.10
license
keywords asn cidr network organisation rdap recon whois
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:
```sh
pipx install git+https://github.com/sttlr/orgia
orgia -h
```

Or run without installing:
```sh
pipx run --spec git+https://github.com/sttlr/orgia orgia -h
```

### Docker
```sh
git clone https://github.com/sttlr/orgia
cd orgia
```
```sh
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:
```sh
orgia --org ORGNAME --cidrs
```

### Enriched
Try even more enriched Orgnames when searching.
```sh
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:
```sh
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":
```sh
orgia --org ORGNAME --sources ripe,arin
```

#### IPv4 only
Don't print IPv6 Networks/CIDRs in the output:
```sh
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```:
```sh
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:
```sh
orgia --org ORGNAME --cidrs --config PATH_TO_CONFIG.yaml
```

Empty config looks like this:
```yaml
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](https://github.com/sttlr/org_info) - parse directly from RIPE, APNIC, AfriNIC WHOIS databases:
```sh
./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:
```sh
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:
```python
from orgia.nics import RIPE, ARIN, LACNIC, APNIC, AFRINIC
```

Or low-level:
```python
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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "orgia",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "asn,cidr,network,organisation,rdap,recon,whois",
    "author": "sttlr",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4e/27/3450d3c6229939e7c76f906019d2d1f1e70b458743eaa81029a0dd928b57/orgia-0.1.tar.gz",
    "platform": null,
    "description": "# orgia\nUse RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.\n\nUseful for conducting Recon on a big Organisation.\n\nFor example, after running orgia the OG way on \"Hilton\", I got ```96436``` v4 IPs.\n\n## Installation\n### pipx\nGlobal installation:\n```sh\npipx install git+https://github.com/sttlr/orgia\norgia -h\n```\n\nOr run without installing:\n```sh\npipx run --spec git+https://github.com/sttlr/orgia orgia -h\n```\n\n### Docker\n```sh\ngit clone https://github.com/sttlr/orgia\ncd orgia\n```\n```sh\ndocker build -t orgia .\ndocker run --rm orgia -h\n```\n\n## Usage\n```\nusage: orgia [-h] [--org ORG_NAME] [--version] [--silent] [--debug] [-c PATH] [--sources SOURCE]\n             [--orgs-input-file PATH] [--asns-input-file PATH] [--networks-input-file PATH]\n             [--max-enrich] [-o PATH] [--adjacent]\n             [--orgs | --asns | --networks | --cidrs | --export-all PATH] [--jsonl] [--ip4-only]\n\nUse RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.\n\noptions:\n  -h, --help            show this help message and exit\n  --org ORG_NAME        organization name (ex. \"Hilton\")\n  --version             show program's version number and exit\n  --silent              display results only (useful for piping to jq)\n  --debug               print debug info\n  -c PATH, --config PATH\n                        path to .yaml config file\n  --sources SOURCE      comma separated, possible values: all (default), arin, ripe, apnic,\n                        afrinic, lacnic\n  --orgs-input-file PATH\n                        path to input file with Organisation handles\n  --asns-input-file PATH\n                        path to input file with ASN handles\n  --networks-input-file PATH\n                        path to input file with Network handles\n  --max-enrich          use level 2 when trying to bruteforce entity name\n  -o PATH, --output PATH\n                        path to output file (default stdout)\n  --adjacent            parse adjacent (dirty): ASNs from Orgs and Orgs from Networks\n  --orgs                show only Organisation handles in output\n  --asns                show only ASNs in output\n  --networks            show only Network handles in output\n  --cidrs               show only CIDRs in output\n  --export-all PATH     folder to export everything\n  --jsonl               show output in jsonl formal\n  --ip4-only            show only IPv4 networks in output\n\nby sttlr\n```\n\n### Quick\nGet CIDRs for specified Orgname:\n```sh\norgia --org ORGNAME --cidrs\n```\n\n### Enriched\nTry even more enriched Orgnames when searching.\n```sh\norgia --org ORGNAME --max-enrich --cidrs\n```\n\n### Resolve only\nIf 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:\n```sh\norgia --asns-input-file ORGNAME_asn_handles.txt \\\n  --orgs-input-file ORGNAME_org_handles_.txt \\\n  --networks-input-file ORGNAME_networks_handles.txt\n```\n\nYou can combine it with any of the output options: ```--cidrs```, ```--orgs```, ```--asns```, ```--networks```, ```--export-all```\n\n### Specific\n#### Select source\nChoose source (arin, ripe, apnic, afrinic, lacnic) - default \"all\":\n```sh\norgia --org ORGNAME --sources ripe,arin\n```\n\n#### IPv4 only\nDon't print IPv6 Networks/CIDRs in the output:\n```sh\norgia --org ORGNAME --ip4-only --cidrs\n```\n\n#### Pipe to jq\nBy default, orgia prints handles only (for ```--orgs```, ```--asns```, ```--networks```).\n\nYou can pass ```--jsonl``` to use JSON as the output format. When piping to ```jq``` also use ```--silent```:\n```sh\norgia --org ORGNAME --asns --silent --jsonl | jq\n```\n\n#### Use config\nWhitelist or blacklist handles, names, emails in output.\n\nWhen checking, input is lowercased and ```in``` is used for comparison (checks if a config string ```in``` a test string).\n\nYou can create a config file and pass it via ```--config``` option:\n```sh\norgia --org ORGNAME --cidrs --config PATH_TO_CONFIG.yaml\n```\n\nEmpty config looks like this:\n```yaml\norgs:\n  whitelist-handles: []\n  blacklist-handles: []\n  whitelist-names: []\n  blacklist-names: []\n  whitelist-emails: []\n  blacklist-emails: []\n\nasns:\n  whitelist-handles: []\n  blacklist-handles: []\n  whitelist-names: []\n  blacklist-names: []\n  whitelist-emails: []\n  blacklist-emails: []\n  \nnetworks:\n  whitelist-handles: []\n  blacklist-handles: []\n  whitelist-names: []\n  blacklist-names: []\n  whitelist-emails: []\n  blacklist-emails: []\n```\n\n### OG\nComprehensive.\n\nCreate handle input files via [org_info](https://github.com/sttlr/org_info) - parse directly from RIPE, APNIC, AfriNIC WHOIS databases:\n```sh\n./bin/query_asn ORGNAME > ORGNAME_asns_from_org_info.txt\n./bin/query_org ORGNAME > ORGNAME_orgs_from_org_info.txt\n./bin/query_inetnum ORGNAME > ORGNAME_networks_from_org_info.txt\n```\n\nThen run the OG:\n```sh\norgia --org ORGNAME \\\n  --sources all \\\n  --max-enrich \\\n  --asns-input-file ORGNAME_asns_from_org_info.txt \\\n  --orgs-input-file ORGNAME_orgs_from_org_info.txt \\\n  --networks-input-file ORGNAME_networks_from_org_info.txt \\\n  --export-all orgia_ORGNAME_export \\\n  --config orgia_ORGNAME_config.yaml\n```\n\nFolder with results (```orgia_ORGNAME_export```) will contain:\n- ```cidrs.txt``` - list of all CIDRs\n- ```asns.jsonl``` - ASN info in JSONL format\n- ```orgs.jsonl``` - Organisation info in JSONL format\n- ```networks.jsonl``` - Network info in JSONL format\n\n### Adjacent mode (dirty)\nYou can use ```--adjacent``` option, to also extract ASNs from Orgs and Orgs from Networks.\nNOTE: It's dirty, and will result in lots of trash results.\n\n### API\nYou can import orgia as a package to use it in your scripts:\n```python\nfrom orgia.nics import RIPE, ARIN, LACNIC, APNIC, AFRINIC\n```\n\nOr low-level:\n```python\nfrom orgia.nics import RDAP, Engine\n```\n\nNOTE: orgia isn't designed to be used this way.\n\n### TODO\nPull requests are welcome ;)\n- Implement Async via ```httpx.AsyncClient()```\n- Improve upon developer API - get rid of ```args``` argument when creating a class\n- Add more options in a config file\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Use RDAP and WHOIS to find ASNs, Networks, and CIDRs about Organisations.",
    "version": "0.1",
    "project_urls": {
        "Homepage": "https://github.com/sttlr/orgia"
    },
    "split_keywords": [
        "asn",
        "cidr",
        "network",
        "organisation",
        "rdap",
        "recon",
        "whois"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20c664541058a25dead7c323638a157d9248bb21201962a8e121674c0324a693",
                "md5": "32bce7eff0ee1544cc827fabbc48de7e",
                "sha256": "145dee3fabc12cae1648db9ca077cf4d18c2089be56beb4bc7f20ca84296dcd8"
            },
            "downloads": -1,
            "filename": "orgia-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "32bce7eff0ee1544cc827fabbc48de7e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 14162,
            "upload_time": "2024-01-31T10:13:55",
            "upload_time_iso_8601": "2024-01-31T10:13:55.195842Z",
            "url": "https://files.pythonhosted.org/packages/20/c6/64541058a25dead7c323638a157d9248bb21201962a8e121674c0324a693/orgia-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e273450d3c6229939e7c76f906019d2d1f1e70b458743eaa81029a0dd928b57",
                "md5": "e9f83c3e520e3a75438ee2c614f92a81",
                "sha256": "40f8211ea99c4422eea931bfdf24217f2dcc7cc5fc83e7c9902312da7905d550"
            },
            "downloads": -1,
            "filename": "orgia-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e9f83c3e520e3a75438ee2c614f92a81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10636,
            "upload_time": "2024-01-31T10:13:57",
            "upload_time_iso_8601": "2024-01-31T10:13:57.290239Z",
            "url": "https://files.pythonhosted.org/packages/4e/27/3450d3c6229939e7c76f906019d2d1f1e70b458743eaa81029a0dd928b57/orgia-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 10:13:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sttlr",
    "github_project": "orgia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "orgia"
}
        
Elapsed time: 4.05190s