urbanadventurer / WhatWeb

Next generation web scanner

Home Page:https://www.morningstarsecurity.com/research/whatweb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Whatweb not working in ArchLinux

Edu4rdSHL opened this issue · comments

Hi, im trying to execute whatweb and i got the following errors:

If im trying to scan a website under https, the tool say: "https://domain.example ERROR: uninitialized constant Target::OpenSSL". Well it's fixed adding to the script "require 'openssl'" in the top.

The next error is that when im exceuting whatweb, repeatedly it doesnt show nothing, no errors, no output, nothing. Exapmple:

shl@SecHackLabs:~/Github/linuxscripts$ whatweb -v https://google.com
shl@SecHackLabs:~/Github/linuxscripts$ whatweb -v https://google.com
shl@SecHackLabs:~/Github/linuxscripts$ whatweb -v https://google.com
shl@SecHackLabs:~/Github/linuxscripts$ whatweb -v https://google.com
WhatWeb report for https://google.com ... etc, then it's working.

What version of WhatWeb are you using? Are you installing from a package? Are you installing from Rubygems? Are you installing from Github (master branch or 0.5.0-dev branch) ?

It's happening with any version, the previus one and the latest, using a package and using the git version. My actual version is: 0.4.9.

In past versions I never had that problem.

Strange. At a guess, it's a botched make install. Does it work if you cd /path/to/whatweb and ./whatweb ?

Updated.

Nope, same "errors". Anyways, I suggested add the require 'openssl' in the script top. Im going to increase the verbose to see whats hapening.

The verbose show it:
/home/$user/WhatWeb/lib/plugins.rb:78: warning: instance variable @locked not initialized
/home/$user/WhatWeb/lib/plugins.rb:236: warning: instance variable @matches not initialized

But are only warnings, no errors, weird.

Hello! I run WhatWeb on the Arch Linux (BlackArch) and if I try to scan hosts with HTTPS protocol or with redirection to HTTPS I get the error. For example:

whatweb mi-al.ru
Output:

https://mi-al.ru/ ERROR: uninitialized constant Target::OpenSSL
http://mi-al.ru [302 Found] Country[RUSSIAN FEDERATION][RU], HTTPServer[nginx/1.12.2], IP[185.26.122.50], RedirectLocation[https://mi-al.ru/], Title[302 Found], nginx[1.12.2]
https://mi-al.ru/ [ Unassigned]

I fixed the error for me. To the /usr/bin/whatweb file I added the string
require 'openssl'

WhatWeb version 0.4.9
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

same problems here with the packaged version on debian sid: openssl error for every https website that I tried, and no output at all for many websites.

I just discovered that the no output problem is not systematic: sometimes I get output, but most times I don't. For the same website. See here under my latest session: both websites didn't produce any output a few minutes before (hence my research in the bug database), but suddenly I got output twice, and then none again. Very strange.

hobbes@sphax:~$ whatweb www.lybrafox.be
http://www.lybrafox.be [200 OK] Apache[2.4.10], Cookies[SESS892e31f8cd3c6193f0dd582922ab1fb9], Country[BELGIUM][BE], Drupal, DublinCore, HTTPServer[Debian Linux][Apache/2.4.10 (Debian)], IP[193.104.37.150], JQuery, Script[text/javascript], Title[Lybrafox Technologies | Votre magasin partenaire en informatique à Namur]
hobbes@sphax:~$ whatweb http://www.fondsaaafx1.com/
http://www.fondsaaafx1.com/ [200 OK] Cookies[_icl_current_language], Country[ROMANIA][RO], HTML5, HTTPServer[nginx], IP[146.66.65.191], JQuery[1.12.4], MetaGenerator[Divi v.3.0.87,WPML ver:3.2.7 stt:61,1;,WordPress 4.9.4], Script[text/javascript], Title[Fonds AAA FX 1 | Alternative High Return Hedge Fund based in Luxemburg], UncommonHeaders[link,host-header,x-proxy-cache], WordPress[4.9.4], X-UA-Compatible[IE=edge], nginx
hobbes@sphax:~$ whatweb http://www.fondsaaafx1.com/
hobbes@sphax:~$ whatweb http://www.fondsaaafx1.com/
hobbes@sphax:~$ whatweb http://www.fondsaaafx1.com/
hobbes@sphax:~$ whatweb http://www.lybrafox.be
hobbes@sphax:~$ whatweb www.lybrafox.be
hobbes@sphax:~$

I'm the Debian maintainer of WhatWeb. I do confirm that the "require 'openssl'" is needed. Also second the empty output, for me it's rare - say 1 times out of 10 tries. All I know ATM that the default Ruby version is changed recently. It's 'ruby 2.5.0p0 (2017-12-25 revision 61468)' now.
If you have any idea how to narrow down the empty output, I'd be happy to try.

Hi all, today i checked the code and i can confirm that the error is reproduced by the ruby 2.5-* version. If you add to the script top #!/usr/bin/env ruby-2.4 all issues are solved. Then for the next realease of general whatweb you need add the following lines:

Line 1. #!/usr/bin/env ruby-2.4
Line 37. require 'openssl'

Also, you need change the ruby package dependece for ruby-2.4

I remain attentive to comments.

I confirm this issue affects Ruby versions 2.4 and 2.5.
I have fixed this is both the master and 0.5.0-dev branches.

I'm always getting the empty output when scanning sites under https, the openssl issue was solved.

Adding a ruby version < to 2.5.* fix the issue. I'm opening a new issue for that.