Skip to content

Commit

Permalink
Added the ronin-vulns irb command (closes #68).
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jan 5, 2024
1 parent b49bdb4 commit 68c56da
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions gemspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ generated_files:
- data/completions/ronin-vulns
- man/ronin-vulns.1
- man/ronin-vulns-completion.1
- man/ronin-vulns-irb.1
- man/ronin-vulns-lfi.1
- man/ronin-vulns-rfi.1
- man/ronin-vulns-sqli.1
Expand Down
59 changes: 59 additions & 0 deletions lib/ronin/vulns/cli/commands/irb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# frozen_string_literal: true
#
# ronin-vulns - A Ruby library for blind vulnerability testing.
#
# Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# ronin-vulns 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-vulns 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-vulns. If not, see <https://www.gnu.org/licenses/>.
#

require 'ronin/vulns/cli/command'
require 'ronin/vulns/cli/ruby_shell'

module Ronin
module Vulns
class CLI
module Commands
#
# Starts an interactive Ruby shell with `ronin-vulns` loaded.
#
# ## Usage
#
# ronin-vulns irb [options]
#
# ## Options
#
# -h, --help Print help information
#
# @since 0.2.0
#
class Irb < Command

description "Starts an interactive Ruby shell with ronin-vulns loaded"

man_page 'ronin-vulns-irb.1'

#
# Runs the `ronin-vulns irb` command.
#
def run
require 'ronin/vulns'
CLI::RubyShell.start
end

end
end
end
end
end
26 changes: 26 additions & 0 deletions man/ronin-vulns-irb.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ronin-vulns-irb 1 "2023-02-01" Ronin Vulns "User Manuals"

## NAME

ronin-vulns-irb - Starts an interactive Ruby shell with ronin-vulns loaded

## SYNOPSIS

`ronin-vulns irb` [*options*]

## DESCRIPTION

Starts an interactive Ruby shell with `ronin/vulns` loaded.

## OPTIONS

`-h`, `--help`
: Print help information

## AUTHOR

Postmodern <[email protected]>

## SEE ALSO

[ronin-vulns-workers](ronin-vulns-workers.1.md) [ronin-vulns-worker](ronin-vulns-worker.1.md) [ronin-vulns-run](ronin-vulns-run.1.md) [ronin-vulns-test](ronin-vulns-test.1.md)
3 changes: 3 additions & 0 deletions man/ronin-vulns.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Runs a `ronin-vulns` *COMMAND*.
*help*
: Lists available commands or shows help about a specific command.

*irb*
: Starts an interactive Ruby shell with ronin-vulns loaded.

*lfi*
: Scans URL(s) for Local File Inclusion (LFI) vulnerabilities.

Expand Down
7 changes: 7 additions & 0 deletions spec/cli/commands/irb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'spec_helper'
require 'ronin/vulns/cli/commands/irb'
require_relative 'man_page_example'

describe Ronin::Vulns::CLI::Commands::Irb do
include_examples "man_page"
end

0 comments on commit 68c56da

Please sign in to comment.