From 405b2493d9e0643f523bda0b1a3f501ec34a060f Mon Sep 17 00:00:00 2001 From: Postmodern Date: Tue, 6 Aug 2024 10:23:03 -0700 Subject: [PATCH] Switched to using `require_relative` for loading local files (closes #87). --- lib/ronin/vulns/cli.rb | 3 ++- lib/ronin/vulns/cli/command.rb | 3 ++- lib/ronin/vulns/cli/commands/command_injection.rb | 4 ++-- lib/ronin/vulns/cli/commands/completion.rb | 3 ++- lib/ronin/vulns/cli/commands/irb.rb | 4 ++-- lib/ronin/vulns/cli/commands/lfi.rb | 4 ++-- lib/ronin/vulns/cli/commands/open_redirect.rb | 4 ++-- lib/ronin/vulns/cli/commands/reflected_xss.rb | 4 ++-- lib/ronin/vulns/cli/commands/rfi.rb | 4 ++-- lib/ronin/vulns/cli/commands/scan.rb | 4 ++-- lib/ronin/vulns/cli/commands/sqli.rb | 4 ++-- lib/ronin/vulns/cli/commands/ssti.rb | 4 ++-- lib/ronin/vulns/cli/importable.rb | 5 +++-- lib/ronin/vulns/cli/web_vuln_command.rb | 6 +++--- lib/ronin/vulns/command_injection.rb | 2 +- lib/ronin/vulns/lfi.rb | 5 +++-- lib/ronin/vulns/lfi/test_file.rb | 2 +- lib/ronin/vulns/open_redirect.rb | 2 +- lib/ronin/vulns/reflected_xss.rb | 6 +++--- lib/ronin/vulns/reflected_xss/context.rb | 2 +- lib/ronin/vulns/reflected_xss/test_string.rb | 2 +- lib/ronin/vulns/rfi.rb | 4 ++-- lib/ronin/vulns/sqli.rb | 4 ++-- lib/ronin/vulns/sqli/error_pattern.rb | 2 +- lib/ronin/vulns/ssti.rb | 4 ++-- lib/ronin/vulns/ssti/test_expression.rb | 2 +- lib/ronin/vulns/url_scanner.rb | 14 +++++++------- lib/ronin/vulns/web_vuln.rb | 6 +++--- lib/ronin/vulns/web_vuln/http_request.rb | 3 ++- 29 files changed, 61 insertions(+), 55 deletions(-) diff --git a/lib/ronin/vulns/cli.rb b/lib/ronin/vulns/cli.rb index c7cbf3a..d4e9f3e 100644 --- a/lib/ronin/vulns/cli.rb +++ b/lib/ronin/vulns/cli.rb @@ -18,13 +18,14 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/version' require 'ronin/core/cli/help/banner' require 'command_kit/commands' require 'command_kit/commands/auto_load' require 'command_kit/options/version' +require_relative 'version' + module Ronin module Vulns # diff --git a/lib/ronin/vulns/cli/command.rb b/lib/ronin/vulns/cli/command.rb index 18937b3..4adee47 100644 --- a/lib/ronin/vulns/cli/command.rb +++ b/lib/ronin/vulns/cli/command.rb @@ -18,9 +18,10 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/root' require 'ronin/core/cli/command' +require_relative '../root' + module Ronin module Vulns class CLI diff --git a/lib/ronin/vulns/cli/commands/command_injection.rb b/lib/ronin/vulns/cli/commands/command_injection.rb index 0dd21a5..958b525 100644 --- a/lib/ronin/vulns/cli/commands/command_injection.rb +++ b/lib/ronin/vulns/cli/commands/command_injection.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/command_injection' +require_relative '../web_vuln_command' +require_relative '../../command_injection' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/completion.rb b/lib/ronin/vulns/cli/commands/completion.rb index 8a89d56..f706bfe 100644 --- a/lib/ronin/vulns/cli/commands/completion.rb +++ b/lib/ronin/vulns/cli/commands/completion.rb @@ -18,9 +18,10 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/root' require 'ronin/core/cli/completion_command' +require_relative '../../root' + module Ronin module Vulns class CLI diff --git a/lib/ronin/vulns/cli/commands/irb.rb b/lib/ronin/vulns/cli/commands/irb.rb index c264c46..1961df2 100644 --- a/lib/ronin/vulns/cli/commands/irb.rb +++ b/lib/ronin/vulns/cli/commands/irb.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/command' -require 'ronin/vulns/cli/ruby_shell' +require_relative '../command' +require_relative '../ruby_shell' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/lfi.rb b/lib/ronin/vulns/cli/commands/lfi.rb index cdc8d02..addfba3 100644 --- a/lib/ronin/vulns/cli/commands/lfi.rb +++ b/lib/ronin/vulns/cli/commands/lfi.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/lfi' +require_relative '../web_vuln_command' +require_relative '../../lfi' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/open_redirect.rb b/lib/ronin/vulns/cli/commands/open_redirect.rb index 93d9497..6732eeb 100644 --- a/lib/ronin/vulns/cli/commands/open_redirect.rb +++ b/lib/ronin/vulns/cli/commands/open_redirect.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/open_redirect' +require_relative '../web_vuln_command' +require_relative '../../open_redirect' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/reflected_xss.rb b/lib/ronin/vulns/cli/commands/reflected_xss.rb index c610188..9bfad6d 100644 --- a/lib/ronin/vulns/cli/commands/reflected_xss.rb +++ b/lib/ronin/vulns/cli/commands/reflected_xss.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/reflected_xss' +require_relative '../web_vuln_command' +require_relative '../../reflected_xss' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/rfi.rb b/lib/ronin/vulns/cli/commands/rfi.rb index 37455a0..d30d829 100644 --- a/lib/ronin/vulns/cli/commands/rfi.rb +++ b/lib/ronin/vulns/cli/commands/rfi.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/rfi' +require_relative '../web_vuln_command' +require_relative '../../rfi' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/scan.rb b/lib/ronin/vulns/cli/commands/scan.rb index a5f7d84..3ae1c05 100644 --- a/lib/ronin/vulns/cli/commands/scan.rb +++ b/lib/ronin/vulns/cli/commands/scan.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/url_scanner' +require_relative '../web_vuln_command' +require_relative '../../url_scanner' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/sqli.rb b/lib/ronin/vulns/cli/commands/sqli.rb index cc7123a..e4884ae 100644 --- a/lib/ronin/vulns/cli/commands/sqli.rb +++ b/lib/ronin/vulns/cli/commands/sqli.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/sqli' +require_relative '../web_vuln_command' +require_relative '../../sqli' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/commands/ssti.rb b/lib/ronin/vulns/cli/commands/ssti.rb index 28a857e..c681401 100644 --- a/lib/ronin/vulns/cli/commands/ssti.rb +++ b/lib/ronin/vulns/cli/commands/ssti.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/web_vuln_command' -require 'ronin/vulns/ssti' +require_relative '../web_vuln_command' +require_relative '../../ssti' module Ronin module Vulns diff --git a/lib/ronin/vulns/cli/importable.rb b/lib/ronin/vulns/cli/importable.rb index 2f1e099..e99c75e 100644 --- a/lib/ronin/vulns/cli/importable.rb +++ b/lib/ronin/vulns/cli/importable.rb @@ -18,8 +18,9 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/importer' -require 'ronin/vulns/cli/printing' +require_relative 'printing' +require_relative '../importer' + require 'ronin/db/cli/database_options' require 'ronin/db/cli/printing' diff --git a/lib/ronin/vulns/cli/web_vuln_command.rb b/lib/ronin/vulns/cli/web_vuln_command.rb index e337e24..8687ae5 100644 --- a/lib/ronin/vulns/cli/web_vuln_command.rb +++ b/lib/ronin/vulns/cli/web_vuln_command.rb @@ -18,9 +18,9 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/cli/command' -require 'ronin/vulns/cli/importable' -require 'ronin/vulns/cli/printing' +require_relative 'command' +require_relative 'importable' +require_relative 'printing' require 'ronin/support/network/http/cookie' require 'ronin/support/network/http/user_agents' diff --git a/lib/ronin/vulns/command_injection.rb b/lib/ronin/vulns/command_injection.rb index 3d958ca..de53d9e 100644 --- a/lib/ronin/vulns/command_injection.rb +++ b/lib/ronin/vulns/command_injection.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative 'web_vuln' require 'time' diff --git a/lib/ronin/vulns/lfi.rb b/lib/ronin/vulns/lfi.rb index 8ba7ca8..5321b7f 100644 --- a/lib/ronin/vulns/lfi.rb +++ b/lib/ronin/vulns/lfi.rb @@ -18,12 +18,13 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' -require 'ronin/vulns/lfi/test_file' +require_relative 'web_vuln' +require_relative 'lfi/test_file' require 'ronin/support/text/patterns' require 'ronin/support/crypto' require 'ronin/support/compression' + require 'uri/query_params' require 'base64' diff --git a/lib/ronin/vulns/lfi/test_file.rb b/lib/ronin/vulns/lfi/test_file.rb index 840dc23..2e0246a 100644 --- a/lib/ronin/vulns/lfi/test_file.rb +++ b/lib/ronin/vulns/lfi/test_file.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative '../web_vuln' module Ronin module Vulns diff --git a/lib/ronin/vulns/open_redirect.rb b/lib/ronin/vulns/open_redirect.rb index 17497af..6e0849c 100644 --- a/lib/ronin/vulns/open_redirect.rb +++ b/lib/ronin/vulns/open_redirect.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative 'web_vuln' require 'chars' require 'cgi' diff --git a/lib/ronin/vulns/reflected_xss.rb b/lib/ronin/vulns/reflected_xss.rb index 7540ffc..ff17da8 100644 --- a/lib/ronin/vulns/reflected_xss.rb +++ b/lib/ronin/vulns/reflected_xss.rb @@ -18,9 +18,9 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' -require 'ronin/vulns/reflected_xss/test_string' -require 'ronin/vulns/reflected_xss/context' +require_relative 'web_vuln' +require_relative 'reflected_xss/test_string' +require_relative 'reflected_xss/context' require 'set' diff --git a/lib/ronin/vulns/reflected_xss/context.rb b/lib/ronin/vulns/reflected_xss/context.rb index 7042bd3..2d61402 100644 --- a/lib/ronin/vulns/reflected_xss/context.rb +++ b/lib/ronin/vulns/reflected_xss/context.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative '../web_vuln' module Ronin module Vulns diff --git a/lib/ronin/vulns/reflected_xss/test_string.rb b/lib/ronin/vulns/reflected_xss/test_string.rb index df50a95..ce2b059 100644 --- a/lib/ronin/vulns/reflected_xss/test_string.rb +++ b/lib/ronin/vulns/reflected_xss/test_string.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative '../web_vuln' module Ronin module Vulns diff --git a/lib/ronin/vulns/rfi.rb b/lib/ronin/vulns/rfi.rb index 49583f6..8a08c4c 100644 --- a/lib/ronin/vulns/rfi.rb +++ b/lib/ronin/vulns/rfi.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' -require 'ronin/vulns/version' +require_relative 'web_vuln' +require_relative 'version' require 'ronin/support/network/http' require 'uri/query_params' diff --git a/lib/ronin/vulns/sqli.rb b/lib/ronin/vulns/sqli.rb index 22375c5..6c591b0 100644 --- a/lib/ronin/vulns/sqli.rb +++ b/lib/ronin/vulns/sqli.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' -require 'ronin/vulns/sqli/error_pattern' +require_relative 'web_vuln' +require_relative 'sqli/error_pattern' require 'time' diff --git a/lib/ronin/vulns/sqli/error_pattern.rb b/lib/ronin/vulns/sqli/error_pattern.rb index 81bb73d..5928c6d 100644 --- a/lib/ronin/vulns/sqli/error_pattern.rb +++ b/lib/ronin/vulns/sqli/error_pattern.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative '../web_vuln' module Ronin module Vulns diff --git a/lib/ronin/vulns/ssti.rb b/lib/ronin/vulns/ssti.rb index e11f393..6e55d16 100644 --- a/lib/ronin/vulns/ssti.rb +++ b/lib/ronin/vulns/ssti.rb @@ -18,8 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' -require 'ronin/vulns/ssti/test_expression' +require_relative 'web_vuln' +require_relative 'ssti/test_expression' module Ronin module Vulns diff --git a/lib/ronin/vulns/ssti/test_expression.rb b/lib/ronin/vulns/ssti/test_expression.rb index 8e19998..1944a96 100644 --- a/lib/ronin/vulns/ssti/test_expression.rb +++ b/lib/ronin/vulns/ssti/test_expression.rb @@ -18,7 +18,7 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/web_vuln' +require_relative '../web_vuln' module Ronin module Vulns diff --git a/lib/ronin/vulns/url_scanner.rb b/lib/ronin/vulns/url_scanner.rb index 217ec28..7c2c23f 100644 --- a/lib/ronin/vulns/url_scanner.rb +++ b/lib/ronin/vulns/url_scanner.rb @@ -18,13 +18,13 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/lfi' -require 'ronin/vulns/rfi' -require 'ronin/vulns/sqli' -require 'ronin/vulns/ssti' -require 'ronin/vulns/reflected_xss' -require 'ronin/vulns/open_redirect' -require 'ronin/vulns/command_injection' +require_relative 'lfi' +require_relative 'rfi' +require_relative 'sqli' +require_relative 'ssti' +require_relative 'reflected_xss' +require_relative 'open_redirect' +require_relative 'command_injection' module Ronin module Vulns diff --git a/lib/ronin/vulns/web_vuln.rb b/lib/ronin/vulns/web_vuln.rb index c0533b3..334c8b0 100644 --- a/lib/ronin/vulns/web_vuln.rb +++ b/lib/ronin/vulns/web_vuln.rb @@ -18,10 +18,10 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/vuln' -require 'ronin/vulns/web_vuln/http_request' -require 'ronin/support/network/http' +require_relative 'vuln' +require_relative 'web_vuln/http_request' +require 'ronin/support/network/http' require 'chars' module Ronin diff --git a/lib/ronin/vulns/web_vuln/http_request.rb b/lib/ronin/vulns/web_vuln/http_request.rb index 978597f..b97c870 100644 --- a/lib/ronin/vulns/web_vuln/http_request.rb +++ b/lib/ronin/vulns/web_vuln/http_request.rb @@ -18,7 +18,8 @@ # along with ronin-vulns. If not, see . # -require 'ronin/vulns/vuln' +require_relative '../vuln' + require 'ronin/support/network/http/cookie' require 'ronin/support/network/http/user_agents'