Coder Social home page Coder Social logo

ronin-rb / ronin-app Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 5.0 359 KB

[WIP] A local web interface for Ronin.

Home Page: https://ronin-rb.dev

License: GNU Affero General Public License v3.0

Dockerfile 0.20% Ruby 46.74% Procfile 0.04% JavaScript 0.96% CSS 0.87% Shell 3.32% HTML 47.87%
local webapp roninrb wip masscan network-scanning nmap spider exploit-database payloads-database recon ruby hacktoberfest infosec security-tools dry-schema dry-types dry-validation

ronin-app's Introduction

ronin-app

ronin-app is a small web application that is meant to be ran locally by the user. It provides a web interface to ronin-support, ronin-repos, ronin-db, ronin-payloads, ronin-exploits, as well as automating ronin-nmap, ronin-masscan, and ronin-web-spider.

Features

  • Provides a web interface to explore and search the ronin database.
  • Allows managing ronin-repos from the web interface.
  • Allows listing and building the built-in or installed 3rd-party payloads.
  • Allows listing installed 3rd-party exploits.
  • Supports automating nmap and masscan scans and importing their results into the ronin database.
  • Supports automating spidering websites and importing all visited URLs into the ronin database.
  • Small memory footprint (~184K).
  • Fast (~1.251ms response time).

Synopsis

Usage: ronin-app [options]

Options:
    -V, --version                    Prints the version and exits
    -H, --host IP                    The host to listen on (Default: localhost)
    -p, --port PORT                  The port to listen on (Default: 1337)
        --db NAME                    The ronin-db database to connect to
        --db-uri URI                 The ronin-db database URI to connect to
    -h, --help                       Print help information

Starts the ronin web app
$ ronin-app

Note: the ronin-app command will automatically open a browser for http://localhost:1337, if ran in a real terminal.

Requirements

Security

  • This app is intended to be ran locally.
  • All HTML output is escaped with Rack::Utils.escape_html.
  • All HTTP params are validated using dry-validation.

Development

  1. Fork It!
  2. Clone It!
  3. cd ronin-app
  4. ./scripts/setup
  5. git checkout -b my_feature
  6. Code It!
  7. Test It - bundle exec rake spec
  8. Try It - ./scripts/server then visit http://localhost:1337/
  9. Push It - git push origin my_feature

docker-compose

You can also use docker-compose to build and run the app:

$ docker-compose build
$ docker-compose up

Directory Structure

  • Gemfile - defines all gem dependencies.
  • Procfile - defines the various services of the app that will be started.
  • Procfile.dev - defines the various services of the app that will be started in development mode.
  • config.ru - The main entry point for rackup/puma.
  • config/ - Contains all app configuration files.
  • lib/ronin/app/helpers/ - Contains all Sinatra helper modules which define methods that
  • app.rb - The main Rack app that contains HTTP routes.
  • app/ - Contains sub-App classes that contains grouped HTTP routes
  • workers.rb - The main entry point for Sidekiq which loads all worker classes from lib/workers/.
  • workers/ - Contains all Sidekiq worker classes. can be called within the views.
  • lib/ronin/app/types.rb - Defines custom dry-types.
  • lib/ronin/app/types/ - Contains additional custom types.
  • lib/ronin/app/validations/ - Contains dry-validations logic for validating submitted HTTP params.
  • views/ - Contains all ERB views that are rendered by app.rb.
  • views/layout.erb - The main page layout view.
  • public/ - Contains all static assets (images, CSS stylesheets, and JavaScript).
  • scripts/ - Contains scripts for setting up or starting the app.

License

Copyright (C) 2023-2024 Hal Brodigan ([email protected])

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

ronin-app 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with ronin-app. If not, see http://www.gnu.org/licenses/.

ronin-app's People

Contributors

ai-mozi avatar postmodern avatar sweetdevil144 avatar ttilberg avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ronin-app's Issues

Package as a gem

Package ronin-app as a gem. Add gemspec.yml and ronin-app.gemspec files. This will allow easily installing ronin-app as a gem, or being added as a dependency.

Add a `/nmap/import` route

Add a route for importing nmap XML files. Also add a Sidekiq worker for importing nmap XML files. The "upload" form should use a <input type="filePath"> input to only upload the file path, which will then be passed to the Sidekiq worker.

Display `Notes` on all `/db/` `show.erb` views

ronin-db-activerecord 0.2.0 added an notes association to IPAddress, HostName, MACAddress, EmailAddress, URL, etc. All /db/ show.erb views should display notes as Notes. Also add a _notes.erb partial template for rendering a notes Array.

Add a `/repos` section

Add routes for accessing Ronin::Repos::CacheDir. It should list installed repos, allow installing a repo from a git URI, updating repo(s), or uninstalling a repo.

Add a `Workers::Vulns` sidekiq worker class

Add a Workers::Vulns sidekiq worker class that scans a URL for web vulnerabilities using Ronin::Vulns::URLScanner. It must create a report of found vulnerabilities that is somehow passed back to the frontend.

Add red asterisks to required form fields

Add the typical red asterisk to all required form fields.

Could add this as a CSS class.

.label.is-required::after {
  content: ' *';
  color: red;
}

Would also need to add the usual blurb text " means a required field" to the forms.

Add a fancy D3 network graph visualization

Add a fancy D3 network graph visualization that can visualize a single IP, Host, or URL, then show related database records as connected nodes. When the user clicks on another node, load that node's related database records and render them as additional connected nodes. This will allow the user to explore the database without loading ALL of the data into the browser at once.

Eventually add a NixOS build file for `nix shell`

Add a Nix build file so users can run nix shell and have all of the dependencies installed within a nix environment. I'm not a NixOS user and know little about it, so I'll need help on this one.

Add support for switching the database

Since the app uses ronin-db and [roin-db] supports configuring multiple databases, it should be possible to switch to another database as the app is running. Possibly the current database name would be stored in the session cookie or sent to Sidekiq workers which import data into the database? I'm not sure how we would tell ActiveRecord to use another database, or whether we'd simply call ActiveRecord.establish_connection again to switch to another database?

Horizontally center the menu and logo

The menu and logo is currently left-justified and doesn't look correct. They should be horizontally centered.

Note: the app uses Bulma CSS's .hero and .container CSS helper classes for the logo and menu.

Random ActiveRecord timeouts

For some reason ActiveRecord randomly times out when accessing the sqlite3 database. Not sure if we need to configure ActiveRecord to somehow avoid this?

ActiveRecord::ConnectionTimeoutError - could not obtain a connection from the pool within 5.000 seconds (waited 5.003 seconds); all pooled connections were in use:

We need to clear the ActiveRecord connection pool or obtain/release an individual connection for the app routes and the SideKiq workers.

  • App
  • SideKiq workers

Add a `/exploits` section

Add routes for listing Ronin::Exploits, loading and displaying an exploit's metadata. Will need to figure out how to execute an exploit from the backend and provide a shell-like interface on the frontend similar to ronin-exploits run's post-exploitation shell.

Add a `/payloads` section

Add routes for listing Ronin::Payloads, loading and viewing metadata about a specific payload, or building a payload.

Add systemd service files

Add systemd service files for running ronin-app. foreman export systemd can export the files. They must also depend on the redis.service service.

Change the Docker config/image to use it's own DB?

Change the Docker config/image to mount ~/.local/share/ronin-db/ as a volume. This can be done using the VOLUME keyword. This should allow users to pull down the ronin-app docker image and quickly run it with docker, and not have to use docker-compose or pass in complex options to docker run.

Add more `/db/` routes and views

Flush out the /db/ routes and views. Must provide access to all other database models (ex: OpenPort, Port, ASN, Credential, etc) with links to other routes.

  • /db/urls
  • /db/urls/:id
  • /db/url_schemes
  • /db/url_schemes/:id
  • /db/url_query_param_names
  • /db/url_query_param_names/:id
  • /db/mac_addresses
  • /db/mac_address/:id
  • /db/open_ports
  • /db/open_port/:id
  • /db/services
  • /db/service/:id
  • /db/ports
  • /db/port/:id
  • /db/oses
  • /db/oses/:id
  • /db/asns
  • /db/asn/:id
  • /db/passwords
  • /db/password/:id
  • /db/user_names
  • /db/user_name/:id
  • /db/email_addresses
  • /db/email_address/:id
  • /db/credentials
  • /db/credential/:id
  • /db/software
  • /db/software/:id
  • /db/software_vendors
  • /db/software_vendors/:id
  • /db/advisories
  • /db/advisory/:id

Add a `/masscan/import` route

Add a route for importing masscan scan files. Also add a Sidekiq worker for importing masscan scan files. The "upload" form should use a <input type="filePath"> input to only upload the file path, which will then be passed to the Sidekiq worker.

Add a `/network/dns` route

Add a /network/dns route and form for performing arbitrary DNS queries. It should use JavaScript to send another HTTP request to another route (ex: /network/dns/query), which would send the DNS query using Ronin::Support::Network::DNS::Resolver and return the response object as JSON, which would then be parsed and rendered by the JavaScript.

There should also be an Import checkbox that causes both the DNS query and response as Ronin::DB::DNSQuery and Ronin::DB::DNSRecord records.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.