Skip to content
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 setup file to project #73

Closed
wants to merge 6 commits into from
Closed

Conversation

MohitS10
Copy link

@MohitS10 MohitS10 commented Oct 11, 2017

Refer #16

@codingo
Copy link
Owner

codingo commented Oct 11, 2017

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.

Copy link
Owner

@codingo codingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although ./setup.py install works it currently loses the reference to the default wordlist.

@codingo
Copy link
Owner

codingo commented Oct 11, 2017

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

@codingo
Copy link
Owner

codingo commented Oct 11, 2017

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
Copy link
Author

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
Copy link
Owner

codingo commented Oct 12, 2017

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
Copy link
Owner

codingo commented Oct 13, 2017

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

@MohitS10
Copy link
Author

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

@codingo
Copy link
Owner

codingo commented Oct 16, 2017

Awesome, looking forward to it

@codingo
Copy link
Owner

codingo commented Oct 18, 2017

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

@MohitS10
Copy link
Author

@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
Copy link
Owner

codingo commented Oct 19, 2017

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

@codingo
Copy link
Owner

codingo commented Oct 23, 2017

@MohitS10 Any luck with this?

@codingo
Copy link
Owner

codingo commented Oct 31, 2017

@MohitS10?

@ccsplit
Copy link
Contributor

ccsplit commented Oct 31, 2017

@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
Copy link
Owner

codingo commented Oct 31, 2017

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
Copy link
Contributor

ccsplit commented Oct 31, 2017

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
Copy link
Owner

codingo commented Oct 31, 2017

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
Copy link
Owner

codingo commented Nov 8, 2017

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

@ccsplit
Copy link
Contributor

ccsplit commented Nov 8, 2017

@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
Copy link
Owner

codingo commented Nov 8, 2017

Closing this in favor of #83

@codingo codingo closed this Nov 8, 2017
@MohitS10
Copy link
Author

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
Copy link
Owner

codingo commented Nov 14, 2017

All good, don't sweat it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants