diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 44 |
1 files changed, 30 insertions, 14 deletions
@@ -1,22 +1,29 @@ -asn: map hosts to their corresponding ASN via WHOIS - -usage: asn.py [-h] [--host HOST] [--port PORT] [--update] [--populate] - -optional arguments: - -h, --help show this help message and exit - --host HOST IP address to listen on - --port PORT Port to listen on - --update Update dataset submodule and create/populate cache - --populate Create and populate cache from current dataset +asn: map hosts to their corresponding ASN via HTTP/WHOIS + +usage: asn.py [-h] [--whois-host WHOIS_HOST] [--whois-port WHOIS_PORT] [--http-host HTTP_HOST] + [--http-port HTTP_PORT] [--update] [--populate] + +options: + -h, --help show this help message and exit + --whois-host WHOIS_HOST + IP to listen on for WHOIS service (default: 127.0.0.1) + --whois-port WHOIS_PORT + Port to listen on for WHOIS service (default: 4343) + --http-host HTTP_HOST + IP to listen on for HTTP service (default: 127.0.0.1) + --http-port HTTP_PORT + Port to listen on for HTTP service (default: 8080) + --update Update dataset submodule and create/populate cache (default: False) + --populate Create and populate cache from current dataset (default: False) INSTALL $ git submodule init $ git submodule update --recursive --remote - $ doas apk add py3-gitpython (Alpine) + $ doas apk add py3-gitpython py3-waitress py3-flask (Alpine) $ ./asn.py --populate - $ ./asn.py --host 0.0.0.0 --port 4343 + $ ./asn.py optional: forward traffic destined for port 43 (WHOIS default) back to 4343 @@ -24,15 +31,24 @@ optional: forward traffic destined for port 43 (WHOIS default) back to 4343 USAGE - $ whois -h whois.jordan.im 1.1.1.1 + $ whois -h 127.0.0.1 1.1.1.1 IP Address | AS Number | Country | AS Name | Announcement -----------+-----------+---------+---------------+------------- 1.1.1.1 | 13335 | AU | CLOUDFLARENET | 1.1.1.0/24 - $ whois -h whois.jordan.im jordan.im + $ whois -h 127.0.0.1 jordan.im IP Address | AS Number | Country | AS Name | Announcement ------------------+-----------+---------+-------------------+--------------- 185.73.44.145 | 8943 | GB | Jump Networks Ltd | 185.73.44.0/22 2001:ba8:0:4031:: | 8943 | GB | Jump Networks Ltd | 2001:ba8::/32 + + $ curl 127.0.0.1:8080 + + { + "host": "8.8.8.8", + "hostname": "dns.google", + "org": "AS15169 GOOGLE", + "announcement": "8.8.8.0/24" + } |