SIDN / CycleHunter

Python software that reads zone files, extract NS records, and detect cyclic dependencies
https://tsuname.io
BSD 2-Clause "Simplified" License
37 stars 14 forks source link

"could not match domain names to NS records" #27

Open bortzmeyer opened 3 years ago

bortzmeyer commented 3 years ago

What does it mean? This is with a very small zonefile where (unlike #26 ) I just added a cycle:

foo IN NS ns1.bar.bortzmeyer.fr.                                                                                                           

bar IN NS ns1.foo.bortzmeyer.fr.                                                                                                           

And it crashes CycleHunter:

% python3 CycleHunter.py --zonefile bortzmeyer.fr --origin bortzmeyer.fr  --base-dir . --workers 1
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:12<00:00,  3.06s/it]
Step 1:  read timed out zones
Step 2: create Authority objects
Step 3: get only zones without in-bailiwick/in-zone authoritative servers
Step 4: sort which ones are cyclic
analyzing foo.bortzmeyer.fr. Domain 1 from 2
analyzing bar.bortzmeyer.fr. Domain 2 from 2
step 7: writing down results
step 8: read cyclic domains
step 8a: read zone file and find them
troubleddomains: {}
step 8b: writing it to json
set()
{}
ERROR:  could not match domain names to NS records; please check zoneMatcher.py
bortzmeyer commented 3 years ago

Note that if I rerun the analysis, CycleHnnter apparently cannot re-read the JSOn files:

100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:12<00:00,  3.06s/it]
Step 1:  read timed out zones
Step 2: create Authority objects
Step 3: get only zones without in-bailiwick/in-zone authoritative servers
Step 4: sort which ones are cyclic
analyzing foo.bortzmeyer.fr. Domain 1 from 2
analyzing bar.bortzmeyer.fr. Domain 2 from 2
step 7: writing down results
step 8: read cyclic domains
Traceback (most recent call last):
  File "/home/bortzmeyer/tmp/CycleHunter/zoneMatcher.py", line 111, in getCyclic
    deps = json.load(f)
  File "/usr/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 89 (char 88)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "CycleHunter.py", line 68, in <module>
    zone_matcher(cyclic_domain_file=output4, zonefile=args.zonefile, zoneorigin=args.origin, output_file=args.save_file)
  File "/home/bortzmeyer/tmp/CycleHunter/zoneMatcher.py", line 135, in zone_matcher
    cyclic = getCyclic(cyclic_domain_file)
  File "/home/bortzmeyer/tmp/CycleHunter/zoneMatcher.py", line 116, in getCyclic
    tempD = json.loads(line)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 89 (char 88)