-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Update Installation Documentation #1477
Comments
Why not remove the rvm instructions and just point to the rvm home page? |
@plumpNation That's a good idea, but doesn't fix the install scripts, and inconsistency between install scripts. |
Ah yeah, I didn't read the issue properly and mistook it for the installation documentation needing work. My bad. Thanks for all your work. |
Hi, I've been working on an install script: Currently it only supports Debian 9 and Kali Rolling 2018.1. Let me know if it's useful or if I can help with updating the scripts already in the beef repo. |
@0xmachos cool. It looks like you've gone to a lot of effort already. There are some dependencies missing for your script. The wiki page upon which you based the script doesn't mention most of the OS level dependencies, which can be found in the install scripts. Specifically:
I have no idea which of the above are still required. The install script is ancient. Fortunately the installation procedure for these dependencies is pretty standard for most Linux systems, simply depending on the package manager (
Ideally the script should check for if [ -e $HOME/.rvm/scripts/rvm ]; then
source $HOME/.rvm/scripts/rvm
elif [ -e /usr/local/rvm/scripts/rvm ]; then
source /usr/local/rvm/scripts/rvm
else
source /etc/profile.d/rvm.sh
fi Next comes Currently the Gemfile makes use of environment variables to prevent installation of development gems. That's kind of janky. Rather than rely on environment variables, I would prefer if the install script invoked With that out of the way, the biggest issue with writing stable install scripts is testing to ensure they work across many OS. If you or anyone else is keen to help, the best thing to do would be to review the existing scripts and documentation described in this issue and condense it down into one script and one wiki page. From there, the installation steps can be tested on various OS and updated as necessary. As an aside, I'd really like to ditch therubyracer gem, if possible. It causes problems. The second biggest issue is trying to be overly controlling. Trying to handle every edge case for every dependency for every distribution on every platform is a maintenance nightmare that we don't have the developer bandwidth to support. Instead, the installation should be as generic as possible, bailing out with useful error messages, and instructions if it's a known issue. As an example, there's a known issue with the psych gem on Kali. Finally: colors. The script has to use colors. For no reason other than I said so. |
Related #1356 |
A quick check shows that Debian 9 needs
My script also has
Had a quick read of the
I'm happy to cover testing for Kali Rolling and Debian Stable.
Once my script matures a little bit more I'll have a look at opening a PR to merge it with
I'll take another look at what I'm doing with this in mind, cheers. |
Per beefproject/beef#1477 (comment) this will prevent bundle from installing gems required for development purposes.
Regarding Debian, you'll probably find that many of the dependencies listed in the install file are required, it's just that you already had them installed. I had a look at Kali - it looks like the dep is Regarding |
Thanks for that.
Sorry if I'm being an idiot. |
That's correct. |
Perfect, cheers for clarifying that. |
Previous commit c6d9667 changed `bundle install` to be invoked with `—without development` per beefproject/beef#1477 (comment). This commit amends that to add the test group so that `bundle install` is now invoked with `—without test development`.
To clarify the Ruby / rvm / rbenv process flow, it should look something like this:
|
I've raised an issue rbenv/rbenv#1068 with the Much easier to do Given that they don't release new versions regularly I think |
I've updated the install script. It doesn't handle I've removed the Remaining TODO:
It's worth noting that Ruby 2.2 will be end-of-life in a couple weeks. The documentation and source will need to be updated to reflect the move to Ruby 2.3.
|
I've updated the documentation to reflect the upgrade to Ruby 2.3. The I've tested the new install script on Linux Mint 18, Kali 2018, and Parrot 3.11. These are all Debian based. json gem / ruby-dev packageIt appears the Rainbow gemThe Workaround: |
Are there any plans to move BeEF to a newer version of Ruby?
|
@0xmachos Ruby 2.3+ is supported. 2.4.x is supported, but hasn't been tested as thoroughly. 2.5.x hasn't been tested at all. Unfortunately, rbenv does not support fuzzy version matching, which is why the Is there a better way to specify a version? Currently BeEF checks if |
The Ruby version check appears to be broken. From
This checks the version of the system Ruby install. Even if no Ruby version has been installed by RVM or rbenv the version check will pass and produce the following error:
To reproduce:
It needs to check if a Ruby version has been installed by RVM or rbenv and if so what that version is. For RVM this looks something like:
|
@0xmachos Welp. I was hoping RVM would be smart enough to read the Did you reload the terminal after installing RVM? |
The output you provided indicates that the install failed due to insufficient privileges to install Bundler. The code is worked as intended, as the version of Ruby installed is sufficient. Using rvm or rbenv is not recommended. Instead, it's an alternative to using the rubyng ppa for operating systems with outdated Ruby.
That code block is commented out... |
Edit: Nevermind, the user is prompted if sudo privileges are required. |
Sorry I didn't see this comment about abandoning rvm/ rbenv support. I enabled that section of code to test it. Googling the error
Turns up a bunch of results which suggest using rvm or rbenv instead of using I think it's probably a mistake to use It'd be more robust to detect if a version manager is present and if not fail. |
@0xmachos yeah; ditching rbenv / rvm for now. Adding in proper detection for the environment, and offering the choice of installing system ruby, or rbvenv, or rvm, will take some effort. I opted for the simplest method: allowing the user to set up their own Ruby environment, rather than force installing RVM and Ruby and gems which is rather impolite. I probably shouldn't have included the commented out section. I left it in for whoever takes over as I have limited time to contribute. I've tested the installer with system Ruby on Linux Mint 18, Parrot, and Kali 2018 - the latter two seemingly being the most popular Linux operating systems for BeEF users (based on bug reports). It worked fine without prefacing I have no idea how well it will work with rvm / rbenv installed. In theory, if they're installed, the I've also removed the The remaining items for this issue are:
Unfortunately I don't have a Mac, so someone else will need to do this. |
Okay no worries, that also makes sense.
I think RVM was detecting the required version from
I've got a Mac, I can have a look at implementing the |
That would be awesome, thanks! We need to know what needs to be installed with Edit: XCode is likely to be required. Selenium is potentially required, |
I'll try and have a look at Has anymore work been done on figuring out which of the Linux dependancies are actually needed? I've got an issue tracking this in our BeEF script repo AbertayHackers/BeEF#2 however I've not had a chance to do anymore testing. |
@0xmachos unfortunately, no. I have no idea why The SQLite related packages are only required as the default database is SQLite. If you were using PostgreSQL or MySQL, then these dependencies would need to be included instead, along with some Gems (which are currently commented out in the Gemfile). I've just tested the installer on Fedora 27, and it failed to install The second issue was related to the The third and final issue related to the use of the uglifier gem. Same as #1504. |
CentOS 7 failed to find |
@0xmachos I've removed the The The remaining dependencies are likely required; with the exception of SQLite as per above. |
I've done some testing on macOS High Sierra The following dependencies are required:
Removed
Changed
Added
|
Thanks @0xmachos Looks good to me. |
The installation procedure and documentation is a mess.
Two install scripts:https://github.com/beefproject/beef/blob/master/install-beefhttps://github.com/beefproject/beef/blob/master/installEdit: These have been merged into one install file.
Wiki Installation page:https://github.com/beefproject/beef/wiki/InstallationEdit: Done. The installation page now mirrors INSTALL.txt file.
Two README files:https://github.com/beefproject/beef/blob/master/READMEhttps://github.com/beefproject/beef/blob/master/README.mkdThe README file should be dropped in favor of the README.mkd (which should probably be renamed to README.md)Edit: These have been merged into one README.md file.
The READMEs make reference to:https://raw.githubusercontent.com/beefproject/beef/a6a7536e736e7788e12df91756a8f132ced24970/install-beefEdit: This reference has been removed.
These all need to be updated and consolidated.
The text was updated successfully, but these errors were encountered: