Giter Site home page Giter Site logo

aslookup's People

Contributors

dspruell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

izuzi zhcharles

aslookup's Issues

Handle missing AS attributes gracefully

Python 3.10.6
aslookup 1.4.0

Sample IP address (185.252.179.18) causes cymru parser to choke:

$ as-lookup -s cymru -r -v 185.252.179.18
[DEBUG] raw DNS record response: "46308 | 185.252.179.0/24 | BG | ripencc | 2018-03-28"
[DEBUG] raw DNS record response: "46308 | US | arin | 2023-04-05 |"
Traceback (most recent call last):
  File "/home/dspruell/.local/bin/as-lookup", line 8, in <module>
    sys.exit(main())
  File "/home/dspruell/.local/pipx/venvs/aslookup/lib/python3.10/site-packages/aslookup/cli.py", line 105, in main
    data = get_as_data(addr, service=args.service)
  File "/home/dspruell/.local/pipx/venvs/aslookup/lib/python3.10/site-packages/aslookup/lookup.py", line 237, in get_as_data
    asdata = get_cymru_data(asdata_text, extra=extra_data)
  File "/home/dspruell/.local/pipx/venvs/aslookup/lib/python3.10/site-packages/aslookup/lookup.py", line 115, in get_cymru_data
    as_name=fields[4],
IndexError: list index out of range

Seen from shadowserver parser:

$ as-lookup -s shadowserver -r -v 185.252.179.18
[DEBUG] raw DNS record response: "46308 | 185.252.179.0/24 |  | US | "
[WARNING] no value for AS name; overriding with ISP
ASData(handle='AS46308', asn='46308', as_name='', rir=None, reg_date=None, prefix='185.252.179.0/24', cc='US', domain=None, isp='', data_source='shadowserver')

Error in lookup from service cymru

Sometimes, lookups of IP addresses using Team Cymru's service results in an error; examples:

% as-lookup 37.128.207.56 45.84.0.83
37.128.207.56    AS42532 | LV | VEESP-LV-AS
45.84.0.83       Error in lookup from service cymru for IP 45.84.0.83 (origin_data response: v=spf1 mx -all)
% as-lookup 45.58.52.67 216.189.159.197 37.128.207.56
45.58.52.67      AS7489 | HK | HOSTUS-GLOBAL-AS HostUS
216.189.159.197  AS7489 | HK | HOSTUS-GLOBAL-AS HostUS
37.128.207.56    Error in lookup from service cymru for IP 37.128.207.56 (origin_data response: v=spf1 mx -all)

There appears to be inconsistency to the behavior; as noted above, two lookups involving the IP 37.128.207.56 were inconsistent, returning IP-BGP data the first time but resulting in the error the second time.

To further complicate things, sometimes after messing around with resolutions against caching resolvers manually, something changes and IP-BGP data resolves cleanly:

% as-lookup -s cymru 37.128.207.56
37.128.207.56    AS42532 | LV | VEESP-LV-AS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.