Skip to content

Commit

Permalink
Added Ronin::Exploits::AuthBypass (closes #144).
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Aug 6, 2024
1 parent 92837f6 commit 8dd3447
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ research and development.
* [SEH Overflows][docs-seh-overflow]
* [Heap Overflows][docs-heap-overflow]
* [Use After Free (UAF)][docs-use-after-free]
* [Auth Bypass][docs-auth-bypass]
* [Command Injection][docs-command-injection]
* [Open Redirect][docs-open-redirect]
* [Local File Inclusions (LFI)][docs-lfi]
Expand All @@ -55,6 +56,7 @@ research and development.
[docs-seh-overflow]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/SEHOverflow.html
[docs-heap-overflow]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/HeapOverflow.html
[docs-use-after-free]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/UseAfterFree.html
[docs-auth-bypass]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/AuthBypass.html
[docs-command-injection]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/CommandInjection.html
[docs-open-redirect]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/OpenRedirect.html
[docs-lfi]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/LFI.html
Expand Down
51 changes: 51 additions & 0 deletions lib/ronin/exploits/auth_bypass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# frozen_string_literal: true
#
# ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
# payload crafting functionality.
#
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# ronin-exploits 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-exploits 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-exploits. If not, see <https://www.gnu.org/licenses/>.
#

require 'ronin/exploits/exploit'

module Ronin
module Exploits
#
# Represents an authentication bypass exploit.
#
# @api public
#
# @since 1.2.0
#
class AuthBypass < Exploit

#
# Returns the type or kind of exploit.
#
# @return [Symbol]
#
# @note
# This is used internally to map an exploit class to a printable type.
#
# @api private
#
def self.exploit_type
:auth_bypass
end

end
end
end
3 changes: 3 additions & 0 deletions lib/ronin/exploits/cli/commands/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def print_shouts(exploit)
EXPLOIT_TYPES = {
exploit: 'Custom',

# generic exploits
auth_bypass: 'Auth Bypass',

# memory corruption exploits
memory_corruption: 'Memory Corruption',
stack_overflow: 'Stack Overflow',
Expand Down
14 changes: 14 additions & 0 deletions spec/auth_bypass_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'
require 'ronin/exploits/auth_bypass'

describe Ronin::Exploits::AuthBypass do
it "must inherit from Ronin::Exploits::Exploit" do
expect(described_class).to be < Ronin::Exploits::Exploit
end

describe ".exploit_type" do
subject { described_class }

it { expect(subject.exploit_type).to eq(:auth_bypass) }
end
end

0 comments on commit 8dd3447

Please sign in to comment.