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.1.0.tar.gz (45.2 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.1.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ipsak-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eed746b4669d950790a5de4eab2ae1a493049efaa583b92314d7684015bc3e91
MD5 e2c693f173e93f611af9b0f9412073d4
BLAKE2b-256 0c77fd06c830bc60a40ff27b966699958a1f2f24a59cdfd43b01aa71abf69027

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipsak-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: ipsak-0.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8dbb1f6b3df76ccf2dd675dc3fb45be6ffcb83211e764ff7d3d54b76bace54
MD5 fbc62322b4b3cc43760ab48c70ac27eb
BLAKE2b-256 3c5155f83c912da35b27ebd6faea565c5d5330c2e6cf4470ea7abfeaad18d7da

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipsak-0.1.0-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