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

Add setup file to project #73

Closed MohitS10 closed 6 years ago

MohitS10 commented 6 years ago

Refer #16

codingo commented 6 years ago

Thank-you @MohitS10!

In testing the install does definitely work but the application then loses the reference to the default worklist (try running without a -w flag against a target). Is there a way we can retain this? Happy for changes to the wordlist reference as well, if required.

I've also made some minor changes for PEP8 refactoring, but nothing that would impact on this.

codingo commented 6 years ago

This looks to be a potential solution to the problem: https://stackoverflow.com/questions/1612733/including-non-python-files-with-setup-py

codingo commented 6 years ago

Further investigation of this one

  1. This required a manifest.in file to encapsulate the wordlists, this appears to be working
  2. The application uses the following code to locate a wordlist:
DEFAULT_WORDLIST_FILE = os.path.join(
    os.path.dirname(os.path.abspath(__file__)),
    'wordlists',
    'virtual-host-scanning.txt'
)

Basically - ./wordlists/virtual-host-scanning.txt.

After running the ./setup.py in a kali instance, the application then runs from:

/usr/local/lib/python2.7/dist-packages/VHostScan-1.7-py2.7.egg/EGG-INFO/scripts

As there's no wordlist directory here, the application fails. The trick to this will be finding a way for the default wordlist to still work if the project is simply cloned, or for ./wordlists to be copied into the directory mentioned above (so the reference works).

Happy to look into this from here @MohitS10?

MohitS10 commented 6 years ago

So basically when you are running the script using the PATH variable, there is no wordlist directory present there as opposed it being present in the cloned directory. What if instead of adding the script present in the python packages folder, we add the script present in the cloned repo to the PATH? Will that do? Copying ./wordlists to the python packages directory doesn't feel right to me. Rest is up to you ;)

codingo commented 6 years ago

That's a good outcome, I'm quite happy for that - it makes sense. I agree, cloning the wordlists directory into packages doesn't make much sense.

codingo commented 6 years ago

@MohitS10 just touching base to see where you landed with this one?

MohitS10 commented 6 years ago

Hi. I think I've managed to do this. I'll be pushing the changes tonight so you can test.

codingo commented 6 years ago

Awesome, looking forward to it

codingo commented 6 years ago

@MohitS10 How'd you get on with this one?

MohitS10 commented 6 years ago

@codingo I tried stuff out. However I am not able to permanently add the files to path through code. :( We could split this issue into 2 parts, 1: installing dependencies, which has been done. 2: adding script to PATH without losing the reference to the default wordlist, which i am trying to figure out. I looked into this to figure out a way if we could somehow add a reference during setup: http://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files.

codingo commented 6 years ago

Ok - let's tackle it from that angle unless a way to do it in setup.py comes up. @timkent any other ideas?

codingo commented 6 years ago

@MohitS10 Any luck with this?

codingo commented 6 years ago

@MohitS10?

ccsplit commented 6 years ago

@codingo,

In order to resolve this issue you will more than likely have to use pkg_resources instead of the os.path.join(__file__) method. This is caused by it using an .egg or zip format in some cases which the current method won't work.

I am currently working on getting it working and will let you know once I do. Hopefully in the next couple of days. At that point we can decide if you want me to try and merge the changes into @MohitS10's master branch and then into here or simply create another PR.

codingo commented 6 years ago

At your discretion - this has gone stale for a while. If you merge it to this branch I'll push it up, but I'm ok with a new branch as well.

ccsplit commented 6 years ago

Sounds good. If you want to take a look/test my current changes feel free. The preliminary changes are pushed up into my fork. I just want to run the current tests and make sure the tests run with python setup.py test before creating a PR.

codingo commented 6 years ago

I'm on site for a few days - but can look after. Looks like our travis ci is broken at present as well. Tagging @timkent in case he has a chance to look at it also.

codingo commented 6 years ago

@ccsplit just touching base to see where this one has landed?

ccsplit commented 6 years ago

@codingo, Most of it is currently done, however, still doing some testing and it looks like there are issues when installing numpy through the setup.py on my Mac, and currently testing on my linux system to see if it properly installs. If you want I can create a PR with the current changes so you can also test it.

codingo commented 6 years ago

Closing this in favor of #83

MohitS10 commented 6 years ago

Hi @codingo. I wasn't able to contribute at all the past month. I'll be started again in December. Sorry for the inconvenience.

codingo commented 6 years ago

All good, don't sweat it!