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

setup.py: create a proper setup script #102

Closed
blshkv opened this issue Jun 10, 2018 · 14 comments
Closed

setup.py: create a proper setup script #102

blshkv opened this issue Jun 10, 2018 · 14 comments

Comments

@blshkv
Copy link

blshkv commented Jun 10, 2018

please create a proper script so it would be easier to install, upgrade and uninstall the tool.
Thank you

blshkv pushed a commit to pentoo/pentoo-overlay that referenced this issue Jun 10, 2018
@kimocoder
Copy link
Contributor

This is also a good idea. I support this one. +1

derv82 added a commit that referenced this issue Aug 19, 2018
As asked by @blshkv in #102.

Running: `sudo python -m wifite`
Install: `sudo python setup.py install`

These steps (and "uninstalling") are mentioned in the README.
@derv82
Copy link
Owner

derv82 commented Aug 19, 2018

Alright, added setup.py & changed some things around.

sudo python setup.py install will install wifite so it can be used in python (import wifite) and can be executed from any terminal (via just wifite).

Uninstalling is really tricky (see stackoverflow) but I included steps for "uninstalling" wifite (via xargs and sudo rm -rf). It removes it but it's not as clean as the installation command.

I did remove Wifite.py (from the root dir) and moved it to bin/wifite -- hopefully this doesn't break a bunch of other people's workflows...

If it looks good, feel free to close. If there's any bugs or something is missing, let me know.

@blshkv
Copy link
Author

blshkv commented Aug 20, 2018

Almost there, I have two comments:

  • the main binary must be installed into /usr/sbin since we expect root user to run it;
  • wordlist-top4800-probable.txt file is getting installed into "/usr" (prefix) which is wrong

@blshkv
Copy link
Author

blshkv commented Aug 20, 2018

FYI, the second issue is tricky, we had a long discussion with an another package:
mschwager/fierce#25 (comment)

and end up using package_data instead of data_files. The downside of this approach is that this file is getting installed for each python system version (multiple times: /usr/lib64/python{2.7,3.6}/site-packages/wifite2)

The more logical path would be something like /usr/share/wifite2/wordlist-top4800-probable.txt if possible

blshkv pushed a commit to pentoo/pentoo-overlay that referenced this issue Aug 20, 2018
derv82 added a commit that referenced this issue Aug 20, 2018
@derv82
Copy link
Owner

derv82 commented Aug 20, 2018

Commit message says it all.

I'm testing on ParrotSec OS btw.

For the wordlist, I specified share/wordlists/wordlist-top4800... and it's installing to /usr/local/share/wordlist-top4800... -- might be different on other distros. But that should avoid copying the file around elsewhere.

For /usr/sbin, I was able to change the install directory to /usr/sbin using setup.cfg's install-scripts directive.

Seems to work for me using just sudo python setup.py install.

Once I get the 👍 I will bump minor version (2.1.10) and close the issue.

@blshkv
Copy link
Author

blshkv commented Aug 20, 2018

Please excuse my meticulousness, but I have already have few dictionaries and worldlists in share/dict and that seems a standard place according to FHS:
/usr/share/dict : Word lists (optional)

http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREDICTWORDLISTS

Would you consider? If not, the current location is fine. Please go ahead and close it

Wuodan pushed a commit to Wuodan/pentoo-overlay that referenced this issue Aug 20, 2018
Wuodan pushed a commit to Wuodan/pentoo-overlay that referenced this issue Aug 20, 2018
Wuodan pushed a commit to Wuodan/pentoo-overlay that referenced this issue Aug 20, 2018
@derv82 derv82 closed this as completed in b889cb9 Aug 20, 2018
@blshkv
Copy link
Author

blshkv commented Aug 20, 2018

I think you forgot to change it in the config as well:

'/usr/share/wordlists/wordlist-top4800-probable.txt',

Line 89 as well

derv82 added a commit that referenced this issue Aug 21, 2018
* Still not "print" option for --crack.
* Checks hashcat for devices, uses --force if no devices are found.
* Interrupting --crack stops entire process, not just a single crack attempt
* Changed wordlist location, hopefully completes #102.
derv82 added a commit that referenced this issue Aug 21, 2018
@derv82
Copy link
Owner

derv82 commented Aug 21, 2018

Config was updated and it should be good now.

@blshkv
Copy link
Author

blshkv commented Aug 21, 2018

Awesome, thanks for your work!

@blshkv
Copy link
Author

blshkv commented Aug 26, 2018

Hi again, I noticed that we forgot to add required and optional dependencies. You might want to create the typical requirements.txt and requirements_opt.txt as an example and call it from setup.py

@derv82
Copy link
Owner

derv82 commented Aug 26, 2018

Wifite only uses the Python standard library, so I don't think there are any required/optional pythonic dependencies.

I would like to have setup.py define system dependencies (like aircrack-ng, ifconfig, reaver, etc) but I don't think that's what setup.py is for.

Let me know if I'm misunderstanding your comment, e.g. if there's dependencies that should be included in setup.py.

@blshkv
Copy link
Author

blshkv commented Aug 26, 2018

that is correct, I was talking about non-python packages. By right, these tools should have a python bindning package which would call its API but we dont have it. My problem that there is no official list of required tools and it's not easy to keep track the required list. For example, I noticed recently that the tool crashes if hcxdumptool and hcxtools are not installed. I have also just realised that the dev-python/pexpect is no longer required. I'm not sure what is the best way to keep track of it.

@derv82
Copy link
Owner

derv82 commented Aug 26, 2018

there is no official list of required tools and it's not easy to keep track the required list

README has the list with install links: https://github.com/derv82/wifite2/#required-tools

Also Wifite checks for required/optional dependencies at startup & warns if any are missing (includes links to repos).

I noticed recently that the tool crashes if hcxdumptool and hcxtools are not installed.

This should not be the case... I just tested the latest version by editing the program names (appending asdf to the end of hashcat, hcxdumptools, and hcxpcaptools):

image

image

If you're getting crashes, create a new Github issue and I'll look into it.

I'm not sure what is the best way to keep track of it.

I think built-in dependency checking is a decent way of getting this working. I thought about allowing Wifite to install the dependencies for the user (maybe just apt-get), but I don't know enough about linux package management to feel confident in doing that.

@blshkv
Copy link
Author

blshkv commented Aug 27, 2018

no, no, no. Please do not go to that path and do not install tools yourself. Tools should not install or modify any system files, this is a malicious behaviour.

The current approach is fine, here is the bug report #131.

Thanks

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

No branches or pull requests

3 participants