insomniacslk / nsidenumerator

Enumerate DNS servers using the NSID EDNS extension (RFC 5001)
10 stars 3 forks source link

-4 and -6 options? #1

Closed tbaschak closed 6 years ago

tbaschak commented 6 years ago

This is a fabulous utility.

Since DNS resolution is supported for target, it might be handy to have a -4 and -6 options to force IPv4 or IPv6 for the target.

My output:

$ python3 nsidenumerator.py b.root-servers.net
Found 1 servers
b'b2-lax'

## Statistics
Total DNS queries      : 1
Timeouts               : 0
Percent failed queries : 0.00

## Warnings
    none

I was wondering which protocol this hit, so I had run again each time for the v4 and v6 addresses.

$ python3 nsidenumerator.py 199.9.14.201
Found 1 servers
b'b2-lax'

## Statistics
Total DNS queries      : 1
Timeouts               : 0
Percent failed queries : 0.00

## Warnings
    none
$ python3 nsidenumerator.py 2001:500:200::b
Found 1 servers
b'b2-mia'

## Statistics
Total DNS queries      : 1
Timeouts               : 0
Percent failed queries : 0.00

## Warnings
    none
insomniacslk commented 6 years ago

Hey @tbaschak , sorry for the late reply, for some reason GitHub is not sending me email notifications anymore, so now I am going manually through all the issues of all my projects :(

I am looking at this right now

insomniacslk commented 6 years ago

Added in https://github.com/insomniacslk/nsidenumerator/commit/0d0d9da1d0b09c3af5c3e83c77424936c0009c93

insomniacslk commented 6 years ago

It's interesting to notice the different responses between IPv4 and IPv6. I got consistently b4-mia ove v6 and b2-mia over v4.

However, example:

Forcing IPv6 on a host with proper IPv6 configuration

$ python3 nsidenumerator.py b.root-servers.net -6 -q
b'b4-mia'

Forcing IPv6 on a sad host without IPv6:

$ python3 nsidenumerator.py b.root-servers.net -6 -q
Traceback (most recent call last):
  File "nsidenumerator.py", line 189, in <module>
    main()
  File "nsidenumerator.py", line 127, in main
    source_port=sport, port=args.dport)
  File "/usr/lib/python3/dist-packages/dns/query.py", line 238, in udp
    s.sendto(wire, destination)
OSError: [Errno 101] Network is unreachable
insomniacslk commented 6 years ago

btw, feel free to close the issue if there's nothing else you want to address :)

insomniacslk commented 6 years ago

Also, sorry for not seeing your PR. Again, issues with GitHub notifications :(

tbaschak commented 6 years ago

Awesome thanks for adding this! Thats all I was looking for was just a way to force resolution over v4 or v6!

No worries about missing a github notification, this wasn't a critical issue or anything :-)