Usage

usage: querycontacts [-h] [--provider PROVIDER] [--version] ip

QueryContact - Find the Abuse contact for a IP address

positional arguments:
ip                   query network abuse contacts for a given ip address

optional arguments:
-h, --help           show this help message and exit
--provider PROVIDER  change standard network abuse contacts provider.
                    Defaults to abuse-contacts.abusix.org
--version            show program's version number and exit

Example

>>> from querycontacts import ContactFinder
>>> qf = ContactFinder()
>>> qf.find('127.0.0.2')
['root@localhost', 'abuse@localhost']

>>> qf.find('::ffff:7f00:2')
['root@localhost']

Installation

pip install querycontacts

API

class querycontacts.ContactFinder(provider='abuse-contacts.abusix.org')

Contact Finder

__init__(provider='abuse-contacts.abusix.org')

Init

Parameters:provider (string) – Abuse contact lookup provider
__weakref__ None

list of weak references to the object (if defined)

find(ip)

Find the abuse contact for a IP address

Parameters:ip (string) – IPv4 or IPv6 address to check
Returns:emails associated with IP
Return type:list
Returns:none if no contact could be found
Return type:None
Raises:ValueError: if ip is not properly formatted
set_provider(provider)

set the provider for a specific path

Parameters:provider (string) – Abuse contact lookup provider

Indices and tables

Table Of Contents

This Page