Skip to main content

abuse_whois

PyPI version Python CI Coverage Status

A Sigma and RDAP/Whois based abuse contacts finder.

img

This tool is highly inspired from the following libraries:

How It Works

  • Query a given address via RDAP (fallback to Whois is if RDAP fails)
  • Check a query result with Sigma rules and find contacts (fallback to regex if there is no match)

Requirements

  • Python 3.10+

Installation

pip install abuse_whois

# or if you want to use built-in REST API
pip install abuse_whois[api]

Usage

As a library

from abuse_whois import get_abuse_contacts

await get_abuse_contacts("1.1.1.1")
await get_abuse_contacts("github.com")
await get_abuse_contacts("https://github.com")
await get_abuse_contacts("foo@example.com")

As a CLI tool

abuse_whois 1.1.1.1
abuse_whois example.com
abuse_whois foo@example.com
abuse_whois http://example.com

As a REST API

$ uvicorn abuse_whois.api.main:app
INFO:     Started server process [2283]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

$ http localhost:8000/api/whois/ address=https://github.com

With Docker

git clone https://github.com/ninoseki/abuse_whois
cd abuse_whois
docker build . -t abuse-whois
docker run -i -d -p 8000:8000 abuse-whois

Settings

All settings can be done via environment variables or .env file.

Name Type Default Desc.
QUERY_TIMEOUT int 10 Timeout value for whois lookup (seconds)
QUERY_CACHE_SIZE int 1024 Cache size for whois lookup
QUERY_CACHE_TTL int 3600 Cache TTL value for whois lookup (seconds)
QUERY_MAX_RETRIES int 3 Max retries on timeout error
ADDITIONAL_WHOIS_RULE_DIRECTORY str Additional contains contain whois rule files
ADDITIONAL_SHARED_HOSTING_RULE_DIRECTORY str Additional directory contains shared hosting rule files

Contributions

abuse_whois works based on a combination of static rules and a parsing result of whois response.

Please submit a PR (or submit a feature request) if you find something missing.

Metadata

Release files for abuse-whois 0.10.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abuse-whois 0.10.2
File Size Uploaded
abuse_whois-0.10.2.tar.gz 225.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for abuse-whois 0.10.2
File Interpreter ABI Platform
abuse_whois-0.10.2-py3-none-any.whl Python 3 none any Details

Total release size: 260.1 kB

Release files / abuse_whois-0.10.2.tar.gz

Download URL abuse_whois-0.10.2.tar.gz
Size 225.5 kB
Tags Source
SHA-256 checksum
How to use checksums
458e8ee8f660b41793cbb0a2387458e3cd22f04d5b348d37757d30de071499ca
BLAKE2b-256 checksum
How to use checksums
7d35a59b9feddd3e4e5cccac18f90ee1a0c50008fed8b0fde97830ee8b58e3cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2025.

Transparency log

Release files / abuse_whois-0.10.2-py3-none-any.whl

Download URL abuse_whois-0.10.2-py3-none-any.whl
Size 34.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a206dad95dde9bc8d345808641c8e71e9ee49e97607178e408c2ce13e7a72c
BLAKE2b-256 checksum
How to use checksums
f5ad6bba308700371a72a317ff8e9878b54e9b67374051af748765409849d7c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.2 This release

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page