urbanadventurer / WhatWeb

Next generation web scanner
https://www.morningstarsecurity.com/research/whatweb
GNU General Public License v2.0
5.47k stars 902 forks source link

How to install it on Windows or MacOS #264

Closed pharazone closed 4 years ago

pharazone commented 5 years ago

I use these two platforms, and I can not installed it on my PC/MAC. So how can I install it? Thank you.

bcoles commented 5 years ago

Visit https://github.com/urbanadventurer/WhatWeb/wiki/Installation for installation instructions.

Alternatively:

git clone https://github.com/urbanadventurer/WhatWeb
bundle install
pharazone commented 5 years ago

I followed the URL for installation, but it didn't work…… image I can't launch it with "./whatweb" command.

bcoles commented 5 years ago

One of the dependencies is failing to install as per the output.

You might have luck with bundle install --without test

Alternatively, the Ruby environment is more friendly on Mac.

pharazone commented 5 years ago

I followed this command, but when I typed "whatweb", still nothing.....

pharazone commented 5 years ago

image Here's my log.

tgotwig commented 4 years ago

You can also use it via docker:

docker run --tty --interactive --rm guidelacour/whatweb \
   ./whatweb nonexistent.domain

from https://hub.docker.com/r/guidelacour/whatweb/

lillois59 commented 4 years ago

Hello World,

For me its working using theses step (Macos 10.6) after git clone whatweb 👍 1: cd whatweb 2: \curl -sSL https://get.rvm.io | bash -s stable --ruby (Install RVM stable with ruby) 3: * To start using RVM you need to run source /Users/test/.rvm/scripts/rvm 3.1: source /Users/test/.rvm/scripts/rvm 4: bundle install --without test 5: ./whatweb yourtarget.com

urbanadventurer commented 4 years ago

In macOS Catalina the default version of Ruby bundled with macOS won't build gems like json. You will 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