UPDATE: tests with copywrite

This commit is contained in:
Jake Webster
2026-01-30 15:38:03 +10:00
parent cbb95576b9
commit 68d19a3221
31 changed files with 179 additions and 10 deletions

View File

@@ -225,6 +225,11 @@ GEM
rexml (~> 3.2, >= 3.2.5) rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 4.0) rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0) websocket (~> 1.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4) simplecov_json_formatter (0.1.4)
sinatra (4.2.1) sinatra (4.2.1)
logger (>= 1.6.0) logger (>= 1.6.0)

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Extension do RSpec.describe BeEF::Extension do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Extensions' do RSpec.describe 'BeEF Extensions' do
it 'loaded successfully' do it 'loaded successfully' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Filters do RSpec.describe BeEF::Filters do
describe '.is_non_empty_string?' do describe '.is_non_empty_string?' do
it 'nil' do it 'nil' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Filters do RSpec.describe BeEF::Filters do
describe '.is_valid_browsername?' do describe '.is_valid_browsername?' do
it 'validates browser names' do it 'validates browser names' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Filters do RSpec.describe BeEF::Filters do
describe '.is_valid_path_info?' do describe '.is_valid_path_info?' do
it 'validates path info' do it 'validates path info' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Filters do RSpec.describe BeEF::Filters do
describe '.is_valid_hostname?' do describe '.is_valid_hostname?' do
it 'validates hostnames correctly' do it 'validates hostnames correctly' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Filters do RSpec.describe BeEF::Filters do
describe '.is_valid_pagetitle?' do describe '.is_valid_pagetitle?' do
it 'validates page titles' do it 'validates page titles' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Command do RSpec.describe BeEF::Core::Command do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.configure do |config| RSpec.configure do |config|
end end

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::GeoIp do RSpec.describe BeEF::Core::GeoIp do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }
let(:geoip) { described_class.instance } let(:geoip) { described_class.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Handlers::BrowserDetails do RSpec.describe BeEF::Core::Handlers::BrowserDetails do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }
let(:session_id) { 'test_session_123' } let(:session_id) { 'test_session_123' }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Handlers::Commands do RSpec.describe BeEF::Core::Handlers::Commands do
let(:mock_request) do let(:mock_request) do
double('request', double('request',

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Handlers::HookedBrowsers do RSpec.describe BeEF::Core::Handlers::HookedBrowsers do
# Test the confirm_browser_user_agent logic directly # Test the confirm_browser_user_agent logic directly
describe 'confirm_browser_user_agent logic' do describe 'confirm_browser_user_agent logic' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF BrowserDetails' do RSpec.describe 'BeEF BrowserDetails' do
before(:all) do before(:all) do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::Execution do RSpec.describe BeEF::Core::Models::Execution do
describe '.create' do describe '.create' do
let(:rule) do let(:rule) do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::LegacyBrowserUserAgents do RSpec.describe BeEF::Core::Models::LegacyBrowserUserAgents do
describe '.user_agents' do describe '.user_agents' do
it 'returns an array' do it 'returns an array' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::OptionCache do RSpec.describe BeEF::Core::Models::OptionCache do
describe '.first_or_create' do describe '.first_or_create' do
it 'creates a new option cache with a name' do it 'creates a new option cache with a name' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::Result do RSpec.describe BeEF::Core::Models::Result do
describe 'associations' do describe 'associations' do
it 'has_one command' do it 'has_one command' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::Rule do RSpec.describe BeEF::Core::Models::Rule do
describe 'associations' do describe 'associations' do
it 'has_many executions' do it 'has_many executions' do

View File

@@ -1,10 +0,0 @@
RSpec.describe BeEF::Core::NetworkStack::RegisterHttpHandler do
describe '.mount_handler' do
let(:mock_server) { double('server', mount: true) }
it 'mounts dynamic reconstruction handler' do
expect(mock_server).to receive(:mount).with('/dh', anything)
described_class.mount_handler(mock_server)
end
end
end

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::NetworkStack::Handlers::AssetHandler do RSpec.describe BeEF::Core::NetworkStack::Handlers::AssetHandler do
let(:handler) { described_class.instance } let(:handler) { described_class.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Dynamic Reconsturction' do RSpec.describe 'BeEF Dynamic Reconsturction' do
before(:all) do before(:all) do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::NetworkStack::Handlers::Raw do RSpec.describe BeEF::Core::NetworkStack::Handlers::Raw do
describe '#initialize' do describe '#initialize' do
it 'initializes with status, header, and body' do it 'initializes with status, header, and body' do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Redirector' do RSpec.describe 'BeEF Redirector' do
before(:all) do before(:all) do

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Router::Router do RSpec.describe BeEF::Core::Router::Router do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Server do RSpec.describe BeEF::Core::Server do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }
let(:server) { described_class.instance } let(:server) { described_class.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Module do RSpec.describe BeEF::Module do
let(:config) { BeEF::Core::Configuration.instance } let(:config) { BeEF::Core::Configuration.instance }

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Modules' do RSpec.describe 'BeEF Modules' do
it 'loaded successfully' do it 'loaded successfully' do
config = BeEF::Core::Configuration.instance config = BeEF::Core::Configuration.instance

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Filesystem' do RSpec.describe 'BeEF Filesystem' do
def file_test(file) def file_test(file)
expect(File.file?(file)).to be(true) expect(File.file?(file)).to be(true)

View File

@@ -1,3 +1,9 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe 'BeEF Security Checks' do RSpec.describe 'BeEF Security Checks' do
it 'dangerous eval usage' do it 'dangerous eval usage' do
Dir['**/*.rb'].each do |path| Dir['**/*.rb'].each do |path|