codingo / VHostScan

A virtual host scanner that performs reverse lookups, can be used with pivot tools, detect catch-all scenarios, work around wildcards, aliases and dynamic default pages.
GNU General Public License v3.0
1.19k stars 231 forks source link

Update IP validation to support IPv6 #91

Closed linted closed 6 years ago

linted commented 6 years ago

I noticed that the way validation of ip addresses were being handled only supports ipv4, so I changed it to a built in method of ip validation.

codingo commented 6 years ago

Nice catch. Looks like this is still failing some of our test cases, do you mind correcting and then I can test?

linted commented 6 years ago

Yeah I am looking at it now. I just want to make sure of something first, is this supposed to run on python2 or python3? the install instructions say to use python2 but the travis-cli is running it off of python3. the ipaddress module in python2 needs unicode strings which require code that I think is breaking in the python3 run.

codingo commented 6 years ago

Definitely python3. I've just checked the installation instructions and can't see a reference to Python 2.x. Could you let me know where you saw this?

linted commented 6 years ago

Oh, sorry! When I read python setup.py install in the readme's installation guide, I assumed that meant to run everything with python 2. It might be helpful to change that to python3 setup.py install to help people copy/pasting on systems with both versions installed.

I have an idea why this might not be running on py3, but I won't be able to get to it till tomorrow. I'll let you know if my fix works then.

codingo commented 6 years ago

Not a problem, no rush! I'll raise a different issue to revisit the setup instructions.

linted commented 6 years ago

I realized that I actually forgot to add the import statement for the ip_address function. It was hidden by the try except block around the function. I feel dumb lol

linted commented 6 years ago

@codingo hey I tried my hand at updating the tests to check for ipv6 support. I just added a ipv6 address to the prefix and suffix tests. Is that the way you would like the test, or should I create a separate test for the ipv4 and ipv6 addresses?

codingo commented 6 years ago

I think separate tests would be the best approach for this. Could you add to this PR?

linted commented 6 years ago

Cool, I made the ipv6 checks different functions. looks like everything is working.

codingo commented 6 years ago

Excellent, all looks good. Thank-you!