Home

Awesome

ronin-web-server

CI Code Climate Gem Version

Description

ronin-web-server is a custom Ruby web server based on Sinatra tailored for security research and development.

Features

Examples

Create and run a simple web app:

require 'ronin/web/server'

class App < Ronin::Web::Server::Base

  # mount a file
  file '/sitemap.xml', './files/sitemap.xml'

  # mount a directory
  directory '/downloads/', '/tmp/downloads/'

  get '/' do
    # renders views/index.erb
    erb :index
  end

  get '/test' do
    "raw string here"
  end

  get '/exploit', asn: 13335 do
    # route that only matches the AS13335 netblock
  end

  get '/exploit', asn_name: 'GOOGLE' do
    # route that only matches GOOGLE netblocks
  end

  get '/exploit', country_code: 'US' do
    # route that only matches US netblocks
  end

  get '/exploit', browser: :firefox do
    # route that only matches firefox web browsers
  end

  get '/exploit', browser: :chrome, browser_version: /^99\./ do
    # route that only matches chrome 99.X.Y.Z web browsers
  end

  get '/exploit', os: :ios, os_version: '15.6' do
    # route that only matches iOS 15.6 devices
  end

  # catchall route
  get '/exploit' do
    "nothing to see here"
  end

end

App.run!

Note: See {Ronin::Web::Server::Base} and Sinatra's Intro for additional documentation.

Requirements

Install

$ gem install ronin-web-server

Gemfile

gem 'ronin-web-server', '~> 0.1'

Development

  1. Fork It!
  2. Clone It!
  3. cd ronin-web-server/
  4. bundle install
  5. git checkout -b my_feature
  6. Code It!
  7. bundle exec rake spec
  8. git push origin my_feature

License

ronin-web-server - A custom Ruby web server based on Sinatra.

Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)

ronin-web-server is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ronin-web-server is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with ronin-web-server. If not, see https://www.gnu.org/licenses/.