Ruby and Whatweb Install on Windows

admin 2022年3月17日07:27:20评论531 views字数 2437阅读8分7秒阅读模式

这是一篇没什么价值的文章,但是因为没有发,所以记录一下
本强迫症在 Whatweb Wiki中未发现Win平台下的安装方法,并且没有发现其他可用的文章指引,本文参考其 Whatweb WiKi,记录了如何实现Windows下安装Ruby与Whatweb,

Ruby and Whatweb Install on Windows

目录索引:
0x01 安装ruby2.x
0x02 安装whatweb
0x03 kali下与windows下运行效果对比
0x04 其他替代工具推荐与小技巧

环境移植小技巧: ruby安装过后可以把整个安装文件夹打包保存,换电脑直接复制文件过去解压到相同目录下,然后把ruby.exe目录加入环境变量即可实现免安装重用。 还适用与python3、golang、nodejs等环境
0x00简述WhatWeb
    WhatWeb是一款网站指纹识别工具,基于Ruby开发,因此是跨平台兼容的,可以在任何Ruby 2.x环境(包括Windows,Mac OSX和Linux)中运行。


    它能识别的指纹包括内容管理系统(CMS),博客平台,统计/分析包,JavaScript库,Web服务器和嵌入式设备。


    WhatWeb目前拥有超过1800个插件,每个都可以识别不同的东西。WhatWeb还可识别版本号,电子邮件地址,帐户ID,Web框架模块,SQL错误等。

WhatWeb安装Wiki:
https://github.com/urbanadventurer/WhatWeb/wiki/Installation

0x01安装Ruby2.x Devkit

1.1 RubyInstallers 下载   

下载地址 https://rubyinstaller.org/downloads/

多种下载测试后最终选择下载Ruby + Devkit 2.7.2-1(x64)版本

Ruby and Whatweb Install on Windows
按照其提示:如果您不知道要安装哪个版本,并且开始使用Ruby,建议您使用Ruby + Devkit 2.7.X(x64)安装程序。它提供了最多数量的兼容gem,并与Ruby一起安装了MSYS2 Devkit,因此可以立即编译具有C扩展名的gem。仅当必须使用自定义32位本机DLL或COM对象时,才建议使用32位(x86)版本。

另外,其安装的 MSYS2 Devkit中的环境,在其他跨平台语言上也用的上,比如golang程序的编译

1.2 rubyinstallers安装选项

1、右击以管理员权限运行rubyinstaller-devkit-2.7.2-1-x64.exe(后续自动安装开发环境需要管理员权限)

2、勾选MSYS2开发者工具链条后下一步自动安装
Ruby and Whatweb Install on Windows


3、安装ruby完成后勾选安装开发者工具链,在CMD界面输入1,3安装
Ruby and Whatweb Install on Windows
Ruby and Whatweb Install on Windows

1.3 ruby.exe加入环境变量(默认安装时候会自动加入)

往path环境变量中添加C:[安装目录]Ruby27bin ,没有加的话需手动加入,并且刷新环境变量(刷新环境变量需要重启电脑或其他方式)

Ruby and Whatweb Install on Windows

1.4 检测ruby安装状态

任意目录输入命令: ruby -v
Ruby and Whatweb Install on Windows

0x02安装Whatweb

2.1 下载whatweb

项目地址:https://github.com/urbanadventurer/WhatWeb
当前版本 0.5.3

下载后解压至无中文路径文件夹下

PS:安装过程中部分报错与文件路径有关,建议路径不带中文字符

2.2 手动安装

以管理员权限在whatweb目录下打开CMD窗口

#安装bundler程序,Ruby依赖关系管理器。
gem install bundler
Ruby and Whatweb Install on Windows

#更新Bundler【可忽略】
bundle update
Ruby and Whatweb Install on Windows

#从WhatWeb源文件夹执行bundle,以安装Gemfile中定义的依赖
bundle install
Ruby and Whatweb Install on Windows

#安装成功进行检测
ruby whatweb --version
Ruby and Whatweb Install on Windows

2.3 可选依赖项

此处忽略安装可选依赖项目MongoDB与RCharde。
Mongo数据库用于日志记录。
#MongoDB日志记录依赖项安装:
gem install bson
gem install bson_ext
gem install mongo
gem install rchardet  #RChardet字符集检测。将结果转换为UTF-8后输出到mongodb

#当这些依赖项不可用时,WhatWeb会正常降级,但是不会影响正常使用。

2.4 whatweb报错记录

#未安装依赖报错:
提示 bundle install 类的错误(无图)
安装带有开发链条的版本

#中文路径报错:
incompatible character encodings: 
GBK and UTF-8 (Encoding::CompatibilityError)
Ruby and Whatweb Install on Windows

0x03Whatweb运行效果对比

3.1 win运行whatweb 

ruby whatweb www.baidu.com
PS:whatweb执行入口就是whatweb目录下那个没有后缀的whatweb文件
Ruby and Whatweb Install on Windows

3.2 kali运行

whatweb www.baidu.com
Ruby and Whatweb Install on Windows

3.3 输出结果对比:对比结果颜色存在差异,查询结果无差异。

Ruby and Whatweb Install on Windows

0x04其他

替代工具推荐

ruby安装过程有点麻烦,有没有其他语言重构的whatweb项目呢?

经过测试Gayhub上多个前辈们的whatweb和wappalyzer的其他语言重构项目,发现其中有一个对指纹库移植比较成功的项目 WebHunt [python3]

PS:以前缺工具都自己改,现在不一样了,我学会了git clone


Buzz2d0 / WebHunt 用于分析Web组件的令行工具

https://github.com/WebHunt-Kits/WebHunt.git

WebHunt 是对https://github.com/webanalyzer/rules组件规则[fofa、wappalyzer、whatweb]的实现,修改部分规则,新增了支持多线程,支持管理组件更新、支持指纹库同步等功能。

本文始发于微信公众号(NOVASEC):Ruby and Whatweb Install on Windows

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年3月17日07:27:20
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Ruby and Whatweb Install on Windowshttp://cn-sec.com/archives/495360.html

发表评论

匿名网友 填写信息