0.0
No commit activity in last 3 years
No release in over 3 years
Simplified ver. of WhatWeb.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 0.8
~> 0.1
~> 12.3
~> 3.8
~> 4.0
~> 3.4

Runtime

~> 3.3
~> 2.15
~> 0.19
~> 0.2.2
 Project Readme

SimpleWhatWeb

Gem Version Build Status Maintainability Coverage Status

It's a simplified & gemified version of WhatWeb.

Motivations

WhatWeb is a great tool, but there are some points could be improved IMHO.

  • (A little bit) messy codebase.
  • Lack of some testing.
  • Not gemified.

So I created this.

Installation

gem 'simple_whatweb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install simple_whatweb

Usage

As a CLI

Commands

Commands:
  whatweb help [COMMAND]  # Describe available commands or one specific command
  whatweb list_plugins    # List all plugins
  whatweb scan URL        # Scan against a given URL

Example

$ whatweb scan http://localhost:8000 | jq .
{
  "HTTPServer": [
    {
      "name": "server string",
      "string": "WEBrick/1.4.2 (Ruby/2.5.1/2018-03-29)",
      "certainty": 100
    }
  ],
  "Ruby": [
    {
      "regexp": [
        "Ruby"
      ],
      "search": "headers[server]",
      "certainty": 100
    },
    {
      "regexp": [
        "WEBrick"
      ],
      "search": "headers[server]",
      "certainty": 100
    }
  ],
  "Title": [
    {
      "name": "page title",
      "string": "Index of /",
      "certainty": 100
    }
  ]
}

As a library

require "whatweb"
require "pp"

# create a scan target
target = WhatWeb::Target.new("http://localhost:8000")
# loads plugins
plugins = WhatWeb::PluginManager.load_plugins

results = {}
plugins.each do |name, plugin|
  # execute a plugin against the target
  result = plugin.execute(target)
  results[name] = result unless result.empty?
end

pp results
# {"HTTPServer"=>
#   [{:name=>"server string",
#     :string=>"WEBrick/1.4.2 (Ruby/2.5.1/2018-03-29)",
#     :certainty=>100}],
#  "Ruby"=>
#   [{:regexp=>["Ruby"], :search=>"headers[server]", :certainty=>100},
#    {:regexp=>["WEBrick"], :search=>"headers[server]", :certainty=>100}],
#  "Title"=>[{:name=>"page title", :string=>"Index of /", :certainty=>100}]}

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.