Skip to main content

The IP Swiss Army Knife — fast IP, CIDR, and domain information queries for network operations

Project description

ipsak

The IP Swiss Army Knife -- fast IP, CIDR, and domain information queries for network operations.

One command gives you ASN, geolocation, WHOIS, DNS, RPKI validation, DNSBL reputation, subnet math, and traceroute -- all in parallel.

Quickstart

uvx ipsak 8.8.8.8

Demo

$ ipsak 8.8.8.8

  8.8.8.8 · dns.google · AS15169 GOOGLE - Google LLC, US · Ashburn, US · Public

                Network                              Location
  ASN         AS15169                    Country     United States (US)
  Org         GOOGLE - Google LLC, US    Region      Virginia
  Prefix      8.8.8.0/24                City        Ashburn
  RIR         ARIN                      ISP         Google LLC
  RPKI        ✓ Valid                    Org         Google Public DNS
                 WHOIS                   TZ          America/New_York
  Range       8.8.8.0 - 8.8.8.255       Coords      39.0300, -77.5000
  Name        GOGL
  Org         Google LLC                      Reputation
  Abuse       network-abuse@google.com   DNSBL    Clean (6 lists checked)
  Country     US
  Created     2023-12-28
  Updated     2023-12-28
$ ipsak dns google.com

  google.com DNS
  A         142.251.35.142
  AAAA      2607:f8b0:400f:801::200e
  MX        10 smtp.google.com.
  NS        ns1.google.com.
            ns4.google.com.
            ns2.google.com.
            ns3.google.com.
  TXT       "v=spf1 include:_spf.google.com ~all"
            ...
  SOA       ns1.google.com. dns-admin.google.com. ...
$ ipsak calc 10.0.0.0/24

  10.0.0.0/24 Subnet
  Network         10.0.0.0
  Broadcast       10.0.0.255
  Netmask         255.255.255.0
  Wildcard        0.0.0.255
  Prefix          /24
  First Host      10.0.0.1
  Last Host       10.0.0.254
  Addresses       256
  Usable          254
  IP Version      IPv4

Install

Requires Python 3.11+.

Run without installing

uvx ipsak 8.8.8.8

Install with uv

uv tool install ipsak
ipsak 8.8.8.8

Install with pipx or pip

pipx install ipsak
# or
pip install ipsak

Install from source

git clone https://github.com/linsomniac/ipsak.git
cd ipsak
uv tool install .

Usage

ipsak <target>              # Full info (ASN, geo, WHOIS, DNS, RPKI, reputation)
ipsak dns <domain|ip>       # DNS records or reverse DNS
ipsak whois <target>        # WHOIS/RDAP lookup
ipsak calc <cidr>           # Subnet calculator
ipsak trace <target>        # Traceroute (fast parallel ICMP; needs root for raw sockets)
ipsak myip                  # Show public and local IP addresses

The target can be an IPv4/IPv6 address, a CIDR block, or a domain name. When no subcommand is given, ipsak defaults to info.

Options

Flag Description
--json / -j Output as JSON
--trace / -t Include traceroute in info output
--timeout / -T Lookup timeout in seconds (default: 10)
--version / -V Show version

Traceroute

ipsak trace uses a fast parallel raw-ICMP engine when it has the privileges to open raw sockets (root, sudo, or CAP_NET_RAW). If it doesn't, it falls back to the system traceroute or tracepath binary.

sudo ipsak trace 8.8.8.8
# or grant the capability once:
sudo setcap cap_net_raw+ep "$(readlink -f "$(which ipsak)")"
ipsak trace 8.8.8.8

What it queries

All lookups run concurrently for fast results:

  • ASN -- Team Cymru DNS mapping
  • Geolocation -- ip-api.com
  • WHOIS/RDAP -- via ipwhois library
  • DNS -- forward (A, AAAA, CNAME, MX, NS, TXT, SOA) and reverse (PTR)
  • RPKI -- Cloudflare RPKI validator
  • Reputation -- DNSBL checks (Spamhaus, Barracuda, SORBS, etc.)
  • Bogon detection -- RFC 1918, RFC 5737, loopback, link-local, etc.
  • Subnet calculator -- network/broadcast/host range math

License

CC0 1.0 Universal -- public domain. See LICENSE.

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

ipsak-0.9.2.tar.gz (45.3 kB view details)

Uploaded Source

Built Distribution

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

ipsak-0.9.2-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file ipsak-0.9.2.tar.gz.

File metadata

  • Download URL: ipsak-0.9.2.tar.gz
  • Upload date:
  • Size: 45.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ipsak-0.9.2.tar.gz
Algorithm Hash digest
SHA256 867f98e279dd10b2af417e7ac60ce878f26d0e841b87f351003db60545e0d915
MD5 19263662d325393af1182ac9709972d3
BLAKE2b-256 70c89a67fb3cce280fc93f3b4457f04422961ccc9f2fac27bdb0a38f85520404

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipsak-0.9.2.tar.gz:

Publisher: release.yml on linsomniac/ipsak

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

File details

Details for the file ipsak-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: ipsak-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ipsak-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f4957887e5edc5bbc8cff88ab284d8cf2380bbd37eab1215c9f7919aaf818a1
MD5 6d922622b7f4c9ff4e1462d7942e57d7
BLAKE2b-256 ad94d4e2824a1a80673d83e2653a9a3a26f829c8ff258ef9e9d72dfb326c2188

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipsak-0.9.2-py3-none-any.whl:

Publisher: release.yml on linsomniac/ipsak

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