koji

Build Status Coverage Status

koji (工事) is a development/staging environment detector.

Features

  • Web app debug feature detection (CodeIgniter, Django, FuelPHP and etc.)
  • Suspicious domain detection (e.g. dev.*.com, stg.*.com)
  • Self-signed certificate detection

Installation

gem install koji

Usage

As a CLI

$ koji help
Commands:
  koji check URL       # check a given URL
  koji help [COMMAND]  # Describe available commands or one specific command

$ koji check https://github.com/ninoseki/koji
{
  "verdict": "Not underconstruction",
  "score": 0
}

$ koji check https://dev.example.com
{
  "verdict": "Possibly underconstruction",
  "score": 50
}

$ koji check http://phpdebugbar.com/
{
  "verdict": "Underconstruction",
  "score": 100
}

$ koji check http://phpdebugbar.com/ --verbose
{
  "verdict": "Underconstruction",
  "score": 100,
  "plugin_reports": [
    {
      "name": "PHPDebugBar",
      "evidence_list": [
        "The website contains PHP DebugBar"
      ],
      "score": 100
    }
  ]
}

$ koji check https://self-signed.badssl.com/ --verbose
{
  "verdict": "Underconstruction",
  "score": 100,
  "plugin_reports": [
    {
      "name": "SelfSignedCertificate",
      "evidence_list": [
        "The website has a self-signed certificate"
      ],
      "score": 100
    }
  ]
}

As a library

require "koji"

website = Koji::Website.new("http://example.com")
detector = Koji::Detector.new(website)

puts detector.report
puts detector.detailed_report