Find where to report a domain for abuse
Project description
abuse_whois
Yet another way to find where to report an abuse.
This tool is highly inspired from the following libraries:
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 | jq .
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 |
RULE_EXTENSIONS | CommaSeparatedStrings | yaml,yml | Rule file extensions |
ADDITIONAL_WHOIS_RULE_DIRECTORIES | CommaSeparatedStrings | Additional directories contain whois rule files | |
ADDITIONAL_SHARED_HOSTING_RULE_DIRECTORIES | CommaSeparatedStrings | Additional directories contain 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
abuse_whois-0.8.2.tar.gz
(17.1 kB
view hashes)
Built Distribution
Close
Hashes for abuse_whois-0.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 724826f0a6edf800d42facbb3a4a4d8c66dd536f52636075a80fe71a1d5a0b66 |
|
MD5 | 25f67c197632cd8b5ab54a6e66074b13 |
|
BLAKE2b-256 | 24038de4e031e6a3ab76d1a9a6f25905d1736e1e1178998c56ba50a5c8d5d6f7 |