Skip to content

Installation

Krish Lalwani edited this page Jun 12, 2024 · 3 revisions

WhoKnows is cross-platform compatible and works in any Ruby 2.x environment including Windows, Mac OSX and Linux.

Get WhoKnows

Use WhoKnows in a Linux Security Distribution

The easiest way to get started with WhoKnows is to use it in one of the following Linux distributions.

Download a Release

Visit https://github.com/krishealty/WhoKnows/releases and download the most recent stable release.

Download the release as a ZIP file

unzip WhoKnows-v0.1.1-rc-gamma.zip
cd WhoKnows-0.1.1-rc-gamma/

Termux or any Linux

Get the latest development version

git clone https://github.com/krishealty/WhoKnows.git
cd WhoKnows/

Install Dependencies

Install using the Makefile

This will install WhoKnows system wide under Linux or macOS.

make install

Install Manually

Install the bundler, the Ruby dependency manager.

gem install bundler

Update Bundler

bundle update

Execute bundler from the WhoKnows source folder to install dependencies defined in Gemfile.

bundle install

WhoKnows should be installed in your local folder

./whoknows --version

Install Ruby

It is possible you need to install ruby first.

If you are using Debian or Ubuntu Linux you can use apt. These instructions haven't been checked for recent versions of Ubuntu or Ruby. Please provide feedback.

sudo apt install ruby ruby-dev libopenssl-ruby

For a Fedora-based system you can use yum or dnf to install the dependencies.

sudo dnf -y install ruby ruby-dev rubygems

Optional Dependencies

WhoKnows degrades gracefully when these dependencies aren't available.

MongoDB

Provides logging to Mongo databases.

sudo gem install bson
sudo gem install bson_ext
sudo gem install mongo

RChardet

Language character set detection. This is required for converting results to UTF-8, a dependency of logging to MongoDB. ⚠️ This feature slows performance ⌛

sudo gem install rchardet

Installing in macOS Catalina

Before following the usual instructions to install WhoKnows you will need to install the Ruby environment. In macOS Catalina the default version of Ruby bundled with macOS won't build gems like json.

You have this issue if you see errors like this:

Installing json 2.3.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /private/var/folders/mb/14xtmg051gjfzyj9lqkn49rc0000gn/T/bundler20200914-11972-ab8e0yjson-2.3.1/gems/json-2.3.1/ext/json/ext/generator
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200914-11972-t0xc52.rb extconf.rb
creating Makefile

current directory: /private/var/folders/mb/14xtmg051gjfzyj9lqkn49rc0000gn/T/bundler20200914-11972-ab8e0yjson-2.3.1/gems/json-2.3.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /private/var/folders/mb/14xtmg051gjfzyj9lqkn49rc0000gn/T/bundler20200914-11972-ab8e0yjson-2.3.1/gems/json-2.3.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
         ^~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: note: did not find header 'config.h' in
framework 'ruby' (loaded from '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/folders/mb/14xtmg051gjfzyj9lqkn49rc0000gn/T/bundler20200914-11972-ab8e0yjson-2.3.1/gems/json-2.3.1 for inspection.
Results logged to /var/folders/mb/14xtmg051gjfzyj9lqkn49rc0000gn/T/bundler20200914-11972-ab8e0yjson-2.3.1/extensions/universal-darwin-19/2.6.0/json-2.3.1/gem_make.out

An error occurred while installing json (2.3.1), and Bundler cannot continue.
Make sure that `gem install json -v '2.3.1' --source 'https://rubygems.org/'` succeeds before bundling.

To solve the problem install your own version of Ruby. I recommend rbenv over rvm, but either is fine.

brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile 
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc 
rbenv install 2.6.5
rbenv global 2.6.5

Next verify that you have ruby installed. If you see the following it worked.

ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]

Now bundle install should succeed.

bundle install