Skip to main content

Interfaces for popular bulk WHOIS servers

Project description

BulkWhois provides a simple interface to several bulk whois servers. This allows you to look up the ASNs, AS names, country codes, and other assorted information very efficiently for a large number of IP addresses.

Currently implemented bulk whois servers are:

Cymru: BulkWhoisCymru Shadowserver: BulkWhoisShadowserver

Note that these whois servers generally only accept IPv4 IP addresses, not hostnames. IPv6 support is not widely supported by bulk whois servers at present, but will add in support once this becomes available.

So, it’s up to the caller to convert hostnames to IP addresses first. Anything which isn’t an IPv4 address generates a warning and is dropped before sending to the whois server.

Usage:

#!/usr/bin/env python

from bulkwhois.shadowserver import BulkWhoisShadowserver

bulk_whois = BulkWhoisShadowserver()
records = bulk_whois.lookup_ips(["212.58.246.91", "203.2.218.214"])

for record in records:
    print "\t".join([records[record]["ip"], records[record]["asn"],
                    records[record]["as_name"], records[record]["cc"]])

Installation

python setup.py install

Implementation

Current implementation assumes accessing a bulk whois server with a telnet-like interface. Generally, input takes the form of:

begin 192.168.0.1 192.168.0.2 end

Note that different bulk whois servers return different data, so better to choose one you’re happy with first and stick with it to keep things consistent.

For example, using different modules the sample code returns this:

BulkWhoisShadowServer

203.2.218.214 9342 ABCNET-AS AU 212.58.246.91 2818 BBC UK

BulkWhoisCymru

203.2.218.214 9342 ABCNET-AS-AP Australian Broadcasting Commission AU 212.58.246.91 2818 BBC BBC Internet Services, UK GB

Further information:

http://www.shadowserver.org/wiki/pmwiki.php/Services/IP-BGP http://www.team-cymru.org/Services/ip-to-asn.html

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

BulkWhois-0.2.1.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file BulkWhois-0.2.1.tar.gz.

File metadata

  • Download URL: BulkWhois-0.2.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for BulkWhois-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f1e96ba9d08f4225ad691e16921e7c05aae05cf27eb6681d2fc09a9172d9453a
MD5 c3c9a5eecac62f210f41675a83f11ed0
BLAKE2b-256 54c7eae57374f68090f755406d49d25774c45dd41a5435ad176cd87ab6452f4a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page