Skip to main content

CLI tool that retrieves WHOIS data for IP addresses

Project description

iprecon

InstallationUsageAcknowledgements

iprecon is a small CLI tool you can use to get WHOIS data for IP addresses which a focus on determining IP ownership. Accepts lists of IPs from files or piped via stdin and outputs in different formats (textual table, CSV or JSON). Output per IP is concise and kept to a single line for easy grepping and quick visual inspection.

Installation

Run pip install iprecon to get it from PyPI. Then run iprecon --help to see if it worked.

Alternatively, clone and install requirements from requirements.txt (virtual environment highly recommended).

Usage

To run iprecon you have to give it a list of IP addresses to check. It expects simple lists with one IP per file. Do it in two ways:

  • from file: iprecon --from-file /path/to/ips.txt
  • piped from stdin: cat /path/to/ips.txt | iprecon

You can output to different formats:

  • iprecon -o text: outputs an ASCII table (terminal)
  • iprecon -o csv: outputs a CSV file
  • iprecon -o json: outputs a JSON file

Output is always printed to stdout. Redirect to a file if required (e.g., iprecon -o json > out.json to store a JSON file).

Errors are ignored silently, e.g., if IPs have invalid formats or are private. To see errors on stderr, request verbose output with iprecon -v.

WHOIS data can be requested in different ways. Generally speaking, there is the legacy WHOIS protocol which is text-based and difficult to parse. There is also RDAP, which is an HTTP-based protocol returning structured data. See here for more information. By default, iprecon uses RDAP but if for any reason you get nonsense try if iprecon --request-method whois works better.

The tool is not fast and you may have to wait long when IP lists are large. Try iprecon --request-method rdap-bulk in those cases, which tries to speed up but as much as possible but you may get banned. There is also a delay because of setup so it will actually be slower on small lists. You will also not get any intermediate output. All results are shown at the end.

Acknowledgements

iprecon is nothing more than a tiny wrapper around github.com/secynic/ipwhois, which is the library actually doing all the work. Think of it as a command line interface to the library. It has nice documentation you should read if you want to know what is actually going on.

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

iprecon-1.0.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

iprecon-1.0.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file iprecon-1.0.0.tar.gz.

File metadata

  • Download URL: iprecon-1.0.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for iprecon-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b2c686149f88345c6d58aaa16746b1d56bff28c2a2be950a49f12b2b2e17443e
MD5 25236b1b3a278f5f20d4538473bd5c79
BLAKE2b-256 9cd2a449accd3f533a1c439bd92ca82d23377b71d7453caf87d80e317d018f9e

See more details on using hashes here.

File details

Details for the file iprecon-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: iprecon-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for iprecon-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51ba68db97f00ab998fa7b4ba136eab18ac9105df832634f75599a7df6c73510
MD5 a0e964f01eac4c2c748d951c8ca834f3
BLAKE2b-256 beb24a76ed0daef8e8ae8278672cbe7ce7a06fbbbab06d108099215851d50073

See more details on using hashes here.

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