-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IPv6 support #668
Add IPv6 support #668
Conversation
Make get_ips and is_ip recognise IPv6 addresses (to some extent) LW2.pm: better location for $LW2_CAN_IPv6 check Add IPv6 support
Hey, any feedback on this so far? I'm happy to add a documentation commit if you'd like. Just let me know which of the documentation files need changing. |
I haven't had a chance to test it yet. I need some more git learnin' since when I checkout your branch I don't see any changes to easily test with. |
Github pitfall ;-/ . I was on your fork + IPv6 branch you PR'ed from. Then I copied the URL from the browser. That was your master branch however as I figured now. :=) Sorry! Works for IPv6. However I encountered two issues:
The error message is kind of misleading and it also should try IPv4 here. |
I was definitely concerned about the second point when working through the code back in January. Forgot about it when waiting for feedback on the original WIP branch. IIRC, both have the same root cause: when nikto resolves a hostname to multiple IP addresses, it has only ever taken the first IP address from the list and scanned it. That was less visible in an IPv4-only world, assuming you didn't luck out and the first IP happened to be down but the others were up. Question is, what is the desirable behaviour now?
Note: changing the "only scan the first IP" behaviour is easier said than done, but I'll look again at the details. |
Inconveniently, I'm going to blindly add a loop within _stream_socket_alloc to try to establish a connection using each result returned from getaddrinfo() in turn, and take the first successfully established socket. This will hopefully fix @drwetter's point that:
Should be able to force-push that change to this PR within the next couple of hours. |
Ok, what I didn't say that the host I tested from, doesn't have an IPv6 uplink. It can reach the hosts in the internal network. Other than that: Still need to check your recent commit.
IMO it would be great if the maintainers will get back on this, you mentioned this before. Before, in the IPv4 only world, it might have been ok to just scan one IPv4 address, assuming the other A record(s) are the same. In the dual stack world it is more likely that one encounters two different vhosts. So just taking one shot seems a bit arbitrary to me. Also, to me as a user, it would seem more handy when both records are scanned or tried to be scanned. Or, the nmap way, just don't scan IPv6 unless -6 is specified. Speaking of it: nmap also scans only one IPv4 address but has a handy switch |
All of those sound like possible options. I don't have a preference but am happy to contribute towards any implementation. (IMHO these feel like separate changes to this PR.) There are probably multiple different ways to implement any of those suggestions, but the one that comes to mind is:
...seems like this should work? |
Main changes:
In LW2.pm:
In nikto_core.plugin:
In nikto_fileops.plugin: