Closed MohitS10 closed 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.
This looks to be a potential solution to the problem: https://stackoverflow.com/questions/1612733/including-non-python-files-with-setup-py
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?
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 ;)
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.
@MohitS10 just touching base to see where you landed with this one?
Hi. I think I've managed to do this. I'll be pushing the changes tonight so you can test.
Awesome, looking forward to it
@MohitS10 How'd you get on with this one?
@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.
Ok - let's tackle it from that angle unless a way to do it in setup.py comes up. @timkent any other ideas?
@MohitS10 Any luck with this?
@MohitS10?
@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.
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.
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.
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.
@ccsplit just touching base to see where this one has landed?
@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.
Closing this in favor of #83
Hi @codingo. I wasn't able to contribute at all the past month. I'll be started again in December. Sorry for the inconvenience.
All good, don't sweat it!
Refer #16