diff --git a/lib/metasploit/framework/data_service/proxy/core.rb b/lib/metasploit/framework/data_service/proxy/core.rb index 4ead138847..296bbbe835 100644 --- a/lib/metasploit/framework/data_service/proxy/core.rb +++ b/lib/metasploit/framework/data_service/proxy/core.rb @@ -1,6 +1,4 @@ require 'open3' -require 'rex/ui' -require 'rex/logging' require 'metasploit/framework/data_service/proxy/data_proxy_auto_loader' # diff --git a/lib/metasploit/framework/login_scanner/acpp.rb b/lib/metasploit/framework/login_scanner/acpp.rb index 1f01e59d04..65445da92c 100644 --- a/lib/metasploit/framework/login_scanner/acpp.rb +++ b/lib/metasploit/framework/login_scanner/acpp.rb @@ -1,5 +1,4 @@ require 'metasploit/framework/tcp/client' -require 'rex/proto/acpp' require 'metasploit/framework/login_scanner/base' require 'metasploit/framework/login_scanner/rex_socket' diff --git a/lib/metasploit/framework/login_scanner/http.rb b/lib/metasploit/framework/login_scanner/http.rb index 7d7d3f6c5f..e64f0f3f84 100644 --- a/lib/metasploit/framework/login_scanner/http.rb +++ b/lib/metasploit/framework/login_scanner/http.rb @@ -1,4 +1,4 @@ -require 'rex/proto/http' + require 'metasploit/framework/login_scanner/base' require 'metasploit/framework/login_scanner/rex_socket' diff --git a/lib/metasploit/framework/login_scanner/mqtt.rb b/lib/metasploit/framework/login_scanner/mqtt.rb index fce6134239..36946c4d22 100644 --- a/lib/metasploit/framework/login_scanner/mqtt.rb +++ b/lib/metasploit/framework/login_scanner/mqtt.rb @@ -1,5 +1,4 @@ require 'metasploit/framework/tcp/client' -require 'rex/proto/mqtt' require 'metasploit/framework/login_scanner/base' require 'metasploit/framework/login_scanner/rex_socket' diff --git a/lib/metasploit/framework/login_scanner/vnc.rb b/lib/metasploit/framework/login_scanner/vnc.rb index e8f48e1441..d910c3d233 100644 --- a/lib/metasploit/framework/login_scanner/vnc.rb +++ b/lib/metasploit/framework/login_scanner/vnc.rb @@ -1,5 +1,4 @@ require 'metasploit/framework/tcp/client' -require 'rex/proto/rfb' require 'metasploit/framework/login_scanner/base' require 'metasploit/framework/login_scanner/rex_socket' diff --git a/lib/msf.rb b/lib/msf.rb index 1676baad03..1737b9343d 100644 --- a/lib/msf.rb +++ b/lib/msf.rb @@ -1,12 +1,8 @@ -require 'rex/proto/ntlm' require 'rex/arch' -include Rex::Arch +require 'rex/logging' -NTLM_CONST ||= ::Rex::Proto::NTLM::Constants -NTLM_CRYPT ||= ::Rex::Proto::NTLM::Crypt -NTLM_UTILS ||= ::Rex::Proto::NTLM::Utils -NTLM_BASE ||= ::Rex::Proto::NTLM::Base -NTLM_MESSAGE ||= ::Rex::Proto::NTLM::Message +include Rex::Arch +include Rex::Logging module Msf @@ -14,4 +10,11 @@ module Msf end require 'msf/core/exception' # TODO: temporary require until we can split up the exceptions file and namespace properly +require 'msf/core/constants' require 'msf_autoload' + +NTLM_CONST ||= ::Rex::Proto::NTLM::Constants +NTLM_CRYPT ||= ::Rex::Proto::NTLM::Crypt +NTLM_UTILS ||= ::Rex::Proto::NTLM::Utils +NTLM_BASE ||= ::Rex::Proto::NTLM::Base +NTLM_MESSAGE ||= ::Rex::Proto::NTLM::Message diff --git a/lib/msf/base/sessions/command_shell.rb b/lib/msf/base/sessions/command_shell.rb index 5c37fed513..dbfa5e5fc1 100644 --- a/lib/msf/base/sessions/command_shell.rb +++ b/lib/msf/base/sessions/command_shell.rb @@ -2,7 +2,6 @@ require 'shellwords' require 'rex/text/table' require "base64" -require 'rex/parser/arguments' module Msf module Sessions diff --git a/lib/msf/base/sessions/meterpreter.rb b/lib/msf/base/sessions/meterpreter.rb index 659d42694b..46c8724bfb 100644 --- a/lib/msf/base/sessions/meterpreter.rb +++ b/lib/msf/base/sessions/meterpreter.rb @@ -1,6 +1,6 @@ # -*- coding: binary -*- - -require 'rex/post/meterpreter' +require 'rex/post/meterpreter/client' +require 'rex/post/meterpreter/ui/console' module Msf module Sessions diff --git a/lib/msf/base/sessions/vncinject.rb b/lib/msf/base/sessions/vncinject.rb index 5db95ce766..c9db22e9ab 100644 --- a/lib/msf/base/sessions/vncinject.rb +++ b/lib/msf/base/sessions/vncinject.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/services/local_relay' module Msf module Sessions diff --git a/lib/msf/core/auxiliary/iax2.rb b/lib/msf/core/auxiliary/iax2.rb index 0d9ada5c87..2875a46933 100644 --- a/lib/msf/core/auxiliary/iax2.rb +++ b/lib/msf/core/auxiliary/iax2.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/iax2/client' module Msf diff --git a/lib/msf/core/auxiliary/kademlia.rb b/lib/msf/core/auxiliary/kademlia.rb index d23d07ed50..694b4da5b5 100644 --- a/lib/msf/core/auxiliary/kademlia.rb +++ b/lib/msf/core/auxiliary/kademlia.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia' module Msf diff --git a/lib/msf/core/auxiliary/mqtt.rb b/lib/msf/core/auxiliary/mqtt.rb index 7a25bdca17..a38c82bd0d 100644 --- a/lib/msf/core/auxiliary/mqtt.rb +++ b/lib/msf/core/auxiliary/mqtt.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/mqtt' module Msf module Auxiliary::MQTT diff --git a/lib/msf/core/auxiliary/natpmp.rb b/lib/msf/core/auxiliary/natpmp.rb index b3d425b589..f7092c2460 100644 --- a/lib/msf/core/auxiliary/natpmp.rb +++ b/lib/msf/core/auxiliary/natpmp.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/natpmp' module Msf diff --git a/lib/msf/core/auxiliary/nmap.rb b/lib/msf/core/auxiliary/nmap.rb index 36f015858f..5f0d41f69c 100644 --- a/lib/msf/core/auxiliary/nmap.rb +++ b/lib/msf/core/auxiliary/nmap.rb @@ -1,6 +1,4 @@ # -*- coding: binary -*- -require 'rex/parser/nmap_nokogiri' -require 'rex/parser/nmap_xml' require 'open3' module Msf diff --git a/lib/msf/core/auxiliary/ntp.rb b/lib/msf/core/auxiliary/ntp.rb index 670dd81d5c..049c6cae57 100644 --- a/lib/msf/core/auxiliary/ntp.rb +++ b/lib/msf/core/auxiliary/ntp.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/ntp' module Msf ### diff --git a/lib/msf/core/auxiliary/password_cracker.rb b/lib/msf/core/auxiliary/password_cracker.rb index da5b994857..11b8882d75 100644 --- a/lib/msf/core/auxiliary/password_cracker.rb +++ b/lib/msf/core/auxiliary/password_cracker.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'open3' require 'fileutils' -require 'rex/proto/ntlm/crypt' require 'metasploit/framework/password_crackers/cracker' require 'metasploit/framework/password_crackers/wordlist' require 'metasploit/framework/password_crackers/jtr/formatter' diff --git a/lib/msf/core/auxiliary/report.rb b/lib/msf/core/auxiliary/report.rb index 18ec0c3a5e..4f1f72eb62 100644 --- a/lib/msf/core/auxiliary/report.rb +++ b/lib/msf/core/auxiliary/report.rb @@ -1,4 +1,7 @@ # -*- coding: binary -*- + +require 'metasploit/framework/require' + module Msf ### diff --git a/lib/msf/core/db_manager/import/acunetix.rb b/lib/msf/core/db_manager/import/acunetix.rb index 2b81b0e998..94c08906e6 100644 --- a/lib/msf/core/db_manager/import/acunetix.rb +++ b/lib/msf/core/db_manager/import/acunetix.rb @@ -1,4 +1,3 @@ -require 'rex/parser/acunetix_nokogiri' module Msf::DBManager::Import::Acunetix def import_acunetix_noko_stream(args={},&block) diff --git a/lib/msf/core/db_manager/import/appscan.rb b/lib/msf/core/db_manager/import/appscan.rb index 4c18bee532..9665546f15 100644 --- a/lib/msf/core/db_manager/import/appscan.rb +++ b/lib/msf/core/db_manager/import/appscan.rb @@ -1,4 +1,3 @@ -require 'rex/parser/appscan_nokogiri' module Msf::DBManager::Import::Appscan def import_appscan_noko_stream(args={},&block) diff --git a/lib/msf/core/db_manager/import/burp_issue.rb b/lib/msf/core/db_manager/import/burp_issue.rb index 1492b8b399..2ae5558807 100644 --- a/lib/msf/core/db_manager/import/burp_issue.rb +++ b/lib/msf/core/db_manager/import/burp_issue.rb @@ -1,4 +1,3 @@ -require 'rex/parser/burp_issue_nokogiri' module Msf::DBManager::Import::BurpIssue def import_burp_issue_xml(args={}, &block) diff --git a/lib/msf/core/db_manager/import/burp_session.rb b/lib/msf/core/db_manager/import/burp_session.rb index 881132ddff..6407cbbfd5 100644 --- a/lib/msf/core/db_manager/import/burp_session.rb +++ b/lib/msf/core/db_manager/import/burp_session.rb @@ -1,4 +1,3 @@ -require 'rex/parser/burp_session_nokogiri' module Msf::DBManager::Import::BurpSession def import_burp_session_noko_stream(args={},&block) @@ -15,7 +14,6 @@ module Msf::DBManager::Import::BurpSession bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : [] wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name if Rex::Parser.nokogiri_loaded - # Rex::Parser.reload("burp_session_nokogiri.rb") parser = "Nokogiri v#{::Nokogiri::VERSION}" noko_args = args.dup noko_args[:blacklist] = bl diff --git a/lib/msf/core/db_manager/import/ci.rb b/lib/msf/core/db_manager/import/ci.rb index 1ef8623ba4..2ffe166738 100644 --- a/lib/msf/core/db_manager/import/ci.rb +++ b/lib/msf/core/db_manager/import/ci.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ci_nokogiri' module Msf::DBManager::Import::CI def import_ci_noko_stream(args, &block) diff --git a/lib/msf/core/db_manager/import/foundstone.rb b/lib/msf/core/db_manager/import/foundstone.rb index 1e1bd5df4d..89c8934c17 100644 --- a/lib/msf/core/db_manager/import/foundstone.rb +++ b/lib/msf/core/db_manager/import/foundstone.rb @@ -1,4 +1,3 @@ -require 'rex/parser/foundstone_nokogiri' module Msf::DBManager::Import::Foundstone def import_foundstone_noko_stream(args={},&block) diff --git a/lib/msf/core/db_manager/import/fusion_vm.rb b/lib/msf/core/db_manager/import/fusion_vm.rb index fd2c722693..3545d92780 100644 --- a/lib/msf/core/db_manager/import/fusion_vm.rb +++ b/lib/msf/core/db_manager/import/fusion_vm.rb @@ -1,4 +1,3 @@ -require 'rex/parser/fusionvm_nokogiri' module Msf::DBManager::Import::FusionVM def import_fusionvm_xml(args={}) diff --git a/lib/msf/core/db_manager/import/gpp.rb b/lib/msf/core/db_manager/import/gpp.rb index c810fcf2c5..a7cbdfe9fb 100644 --- a/lib/msf/core/db_manager/import/gpp.rb +++ b/lib/msf/core/db_manager/import/gpp.rb @@ -1,4 +1,3 @@ -require 'rex/parser/group_policy_preferences' module Msf::DBManager::Import::GPP def import_gpp_xml(args = {}, &block) diff --git a/lib/msf/core/db_manager/import/ip360.rb b/lib/msf/core/db_manager/import/ip360.rb index bd0814d34e..8f00ca51b5 100644 --- a/lib/msf/core/db_manager/import/ip360.rb +++ b/lib/msf/core/db_manager/import/ip360.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ip360_aspl_xml' module Msf::DBManager::Import::IP360 autoload :ASPL, 'msf/core/db_manager/import/ip360/aspl' @@ -6,4 +5,4 @@ module Msf::DBManager::Import::IP360 include Msf::DBManager::Import::IP360::ASPL include Msf::DBManager::Import::IP360::V3 -end \ No newline at end of file +end diff --git a/lib/msf/core/db_manager/import/ip360/aspl.rb b/lib/msf/core/db_manager/import/ip360/aspl.rb index 79112c58ec..a7d405db0c 100644 --- a/lib/msf/core/db_manager/import/ip360/aspl.rb +++ b/lib/msf/core/db_manager/import/ip360/aspl.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ip360_aspl_xml' module Msf::DBManager::Import::IP360::ASPL # diff --git a/lib/msf/core/db_manager/import/ip360/v3.rb b/lib/msf/core/db_manager/import/ip360/v3.rb index 0e06d664a0..51a0124f8c 100644 --- a/lib/msf/core/db_manager/import/ip360/v3.rb +++ b/lib/msf/core/db_manager/import/ip360/v3.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ip360_xml' module Msf::DBManager::Import::IP360::V3 # diff --git a/lib/msf/core/db_manager/import/mbsa.rb b/lib/msf/core/db_manager/import/mbsa.rb index 1e4d24a601..4ab591f578 100644 --- a/lib/msf/core/db_manager/import/mbsa.rb +++ b/lib/msf/core/db_manager/import/mbsa.rb @@ -1,4 +1,3 @@ -require 'rex/parser/mbsa_nokogiri' module Msf::DBManager::Import::MBSA def import_mbsa_noko_stream(args={},&block) diff --git a/lib/msf/core/db_manager/import/nessus/xml/v2.rb b/lib/msf/core/db_manager/import/nessus/xml/v2.rb index 1d21625079..f3f7812ad1 100644 --- a/lib/msf/core/db_manager/import/nessus/xml/v2.rb +++ b/lib/msf/core/db_manager/import/nessus/xml/v2.rb @@ -1,4 +1,3 @@ -require 'rex/parser/nessus_xml' module Msf::DBManager::Import::Nessus::XML::V2 def import_nessus_xml_v2(args={}, &block) diff --git a/lib/msf/core/db_manager/import/netsparker.rb b/lib/msf/core/db_manager/import/netsparker.rb index bd6336d67a..8f8860c62f 100644 --- a/lib/msf/core/db_manager/import/netsparker.rb +++ b/lib/msf/core/db_manager/import/netsparker.rb @@ -1,4 +1,3 @@ -require 'rex/parser/netsparker_xml' module Msf::DBManager::Import::Netsparker # Process NetSparker XML diff --git a/lib/msf/core/db_manager/import/nexpose/raw.rb b/lib/msf/core/db_manager/import/nexpose/raw.rb index 8d9b4f0bf6..2567189b7a 100644 --- a/lib/msf/core/db_manager/import/nexpose/raw.rb +++ b/lib/msf/core/db_manager/import/nexpose/raw.rb @@ -1,5 +1,3 @@ -require 'rex/parser/nexpose_raw_nokogiri' -require 'rex/parser/nexpose_xml' module Msf::DBManager::Import::Nexpose::Raw def import_nexpose_raw_noko_stream(args, &block) diff --git a/lib/msf/core/db_manager/import/nexpose/simple.rb b/lib/msf/core/db_manager/import/nexpose/simple.rb index 91adcd6346..b76fc68915 100644 --- a/lib/msf/core/db_manager/import/nexpose/simple.rb +++ b/lib/msf/core/db_manager/import/nexpose/simple.rb @@ -1,4 +1,3 @@ -require 'rex/parser/nexpose_simple_nokogiri' module Msf::DBManager::Import::Nexpose::Simple def import_nexpose_noko_stream(args, &block) diff --git a/lib/msf/core/db_manager/import/nmap.rb b/lib/msf/core/db_manager/import/nmap.rb index 52b29b813b..2dd4d55b73 100644 --- a/lib/msf/core/db_manager/import/nmap.rb +++ b/lib/msf/core/db_manager/import/nmap.rb @@ -1,5 +1,3 @@ -require 'rex/parser/nmap_nokogiri' -require 'rex/parser/nmap_xml' module Msf::DBManager::Import::Nmap def import_nmap_noko_stream(args, &block) diff --git a/lib/msf/core/db_manager/import/open_vas.rb b/lib/msf/core/db_manager/import/open_vas.rb index 62e77590b2..9039c8ea9b 100644 --- a/lib/msf/core/db_manager/import/open_vas.rb +++ b/lib/msf/core/db_manager/import/open_vas.rb @@ -1,4 +1,3 @@ -require 'rex/parser/openvas_nokogiri' module Msf::DBManager::Import::OpenVAS def import_openvas_noko_stream(args={}, &block) diff --git a/lib/msf/core/db_manager/import/outpost24.rb b/lib/msf/core/db_manager/import/outpost24.rb index 63722ffb1c..b62460dec9 100644 --- a/lib/msf/core/db_manager/import/outpost24.rb +++ b/lib/msf/core/db_manager/import/outpost24.rb @@ -1,4 +1,3 @@ -require 'rex/parser/outpost24_nokogiri' module Msf::DBManager::Import::Outpost24 def import_outpost24_noko_stream(args={},&block) diff --git a/lib/msf/core/db_manager/import/retina.rb b/lib/msf/core/db_manager/import/retina.rb index 7acb9ed9c9..823b66af32 100644 --- a/lib/msf/core/db_manager/import/retina.rb +++ b/lib/msf/core/db_manager/import/retina.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/parser/retina_xml' module Msf::DBManager::Import::Retina # Process Retina XML diff --git a/lib/msf/core/db_manager/import/wapiti.rb b/lib/msf/core/db_manager/import/wapiti.rb index 1f79a78253..432041e565 100644 --- a/lib/msf/core/db_manager/import/wapiti.rb +++ b/lib/msf/core/db_manager/import/wapiti.rb @@ -1,4 +1,3 @@ -require 'rex/parser/wapiti_nokogiri' module Msf::DBManager::Import::Wapiti def import_wapiti_xml(args={}, &block) diff --git a/lib/msf/core/exploit/cmd_stager.rb b/lib/msf/core/exploit/cmd_stager.rb index d24e90e739..e8032ee6a4 100644 --- a/lib/msf/core/exploit/cmd_stager.rb +++ b/lib/msf/core/exploit/cmd_stager.rb @@ -1,5 +1,6 @@ # -*- coding: binary -*- +require 'rex/exploitation' require 'rex/exploitation/cmdstager' module Msf diff --git a/lib/msf/core/exploit/dhcp_server.rb b/lib/msf/core/exploit/dhcp_server.rb index 4c149c2559..f31fd314aa 100644 --- a/lib/msf/core/exploit/dhcp_server.rb +++ b/lib/msf/core/exploit/dhcp_server.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/dhcp' module Msf diff --git a/lib/msf/core/exploit/kernel_mode.rb b/lib/msf/core/exploit/kernel_mode.rb index d1fcc9c905..ff67613da8 100644 --- a/lib/msf/core/exploit/kernel_mode.rb +++ b/lib/msf/core/exploit/kernel_mode.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- module Msf -require 'rex/payloads/win32/kernel' module Exploit::KernelMode diff --git a/lib/msf/core/exploit/remote/dcerpc.rb b/lib/msf/core/exploit/remote/dcerpc.rb index bfa058b7bc..31d872b52e 100644 --- a/lib/msf/core/exploit/remote/dcerpc.rb +++ b/lib/msf/core/exploit/remote/dcerpc.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dcerpc' require 'rex/encoder/ndr' module Msf diff --git a/lib/msf/core/exploit/remote/dns.rb b/lib/msf/core/exploit/remote/dns.rb index 546b22f9a6..552a1a5a5a 100644 --- a/lib/msf/core/exploit/remote/dns.rb +++ b/lib/msf/core/exploit/remote/dns.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dns' module Msf diff --git a/lib/msf/core/exploit/remote/dns/client.rb b/lib/msf/core/exploit/remote/dns/client.rb index 3984c0fa17..430521f788 100644 --- a/lib/msf/core/exploit/remote/dns/client.rb +++ b/lib/msf/core/exploit/remote/dns/client.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dns' module Msf diff --git a/lib/msf/core/exploit/remote/dns/common.rb b/lib/msf/core/exploit/remote/dns/common.rb index b2760c3bba..7ca348ed55 100644 --- a/lib/msf/core/exploit/remote/dns/common.rb +++ b/lib/msf/core/exploit/remote/dns/common.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dns' module Msf diff --git a/lib/msf/core/exploit/remote/dns/server.rb b/lib/msf/core/exploit/remote/dns/server.rb index 355d659d99..6f2ce29b01 100644 --- a/lib/msf/core/exploit/remote/dns/server.rb +++ b/lib/msf/core/exploit/remote/dns/server.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dns' module Msf diff --git a/lib/msf/core/exploit/remote/firefox_addon_generator.rb b/lib/msf/core/exploit/remote/firefox_addon_generator.rb index 0a2b19bf6c..4488f3729f 100644 --- a/lib/msf/core/exploit/remote/firefox_addon_generator.rb +++ b/lib/msf/core/exploit/remote/firefox_addon_generator.rb @@ -7,6 +7,8 @@ # ### +require 'rex/zip' + module Msf module Exploit::Remote::FirefoxAddonGenerator include Msf::Exploit::Remote::FirefoxPrivilegeEscalation diff --git a/lib/msf/core/exploit/remote/http/wordpress/admin.rb b/lib/msf/core/exploit/remote/http/wordpress/admin.rb index ad06abc9ed..fa221262a9 100644 --- a/lib/msf/core/exploit/remote/http/wordpress/admin.rb +++ b/lib/msf/core/exploit/remote/http/wordpress/admin.rb @@ -1,4 +1,5 @@ # -*- coding: binary -*- +require 'rex/mime/message' module Msf::Exploit::Remote::HTTP::Wordpress::Admin # Uploads a plugin using a valid admin session. diff --git a/lib/msf/core/exploit/remote/http_server.rb b/lib/msf/core/exploit/remote/http_server.rb index 453b313281..2236da521b 100644 --- a/lib/msf/core/exploit/remote/http_server.rb +++ b/lib/msf/core/exploit/remote/http_server.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/service_manager' require 'rex/exploitation/obfuscatejs' require 'rex/exploitation/encryptjs' require 'rex/exploitation/heaplib' diff --git a/lib/msf/core/exploit/remote/java/rmi/client.rb b/lib/msf/core/exploit/remote/java/rmi/client.rb index 551d2ea162..ebcb7b05ee 100644 --- a/lib/msf/core/exploit/remote/java/rmi/client.rb +++ b/lib/msf/core/exploit/remote/java/rmi/client.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/rmi' require 'rex/java/serialization' require 'stringio' module Msf diff --git a/lib/msf/core/exploit/remote/kerberos/client.rb b/lib/msf/core/exploit/remote/kerberos/client.rb index 7d5a8ccfe5..aac707187d 100644 --- a/lib/msf/core/exploit/remote/kerberos/client.rb +++ b/lib/msf/core/exploit/remote/kerberos/client.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/as_request.rb b/lib/msf/core/exploit/remote/kerberos/client/as_request.rb index 3fac948d06..95bace2bd1 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/as_request.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/as_request.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/as_response.rb b/lib/msf/core/exploit/remote/kerberos/client/as_response.rb index e5a38dfa60..54ef22680a 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/as_response.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/as_response.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/cache_credential.rb b/lib/msf/core/exploit/remote/kerberos/client/cache_credential.rb index d35e9013d4..a3c3c1daea 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/cache_credential.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/cache_credential.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/pac.rb b/lib/msf/core/exploit/remote/kerberos/client/pac.rb index 8c43424460..b8ac987c1a 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/pac.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/pac.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/tgs_request.rb b/lib/msf/core/exploit/remote/kerberos/client/tgs_request.rb index e3e0c28bac..798c1d205f 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/tgs_request.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/tgs_request.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/kerberos/client/tgs_response.rb b/lib/msf/core/exploit/remote/kerberos/client/tgs_response.rb index bc16bbc9e5..382d2501f1 100644 --- a/lib/msf/core/exploit/remote/kerberos/client/tgs_response.rb +++ b/lib/msf/core/exploit/remote/kerberos/client/tgs_response.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos' module Msf class Exploit diff --git a/lib/msf/core/exploit/remote/nuuo.rb b/lib/msf/core/exploit/remote/nuuo.rb index f669891347..0c3d0a8405 100644 --- a/lib/msf/core/exploit/remote/nuuo.rb +++ b/lib/msf/core/exploit/remote/nuuo.rb @@ -1,4 +1,3 @@ -require 'rex/proto/nuuo' ### # diff --git a/lib/msf/core/exploit/remote/sip.rb b/lib/msf/core/exploit/remote/sip.rb index 34138af7fc..9c7671fe92 100644 --- a/lib/msf/core/exploit/remote/sip.rb +++ b/lib/msf/core/exploit/remote/sip.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/sip/response' module Msf # SIP protocol support diff --git a/lib/msf/core/exploit/remote/smb/client.rb b/lib/msf/core/exploit/remote/smb/client.rb index 326ec3b4aa..4bf0209b84 100644 --- a/lib/msf/core/exploit/remote/smb/client.rb +++ b/lib/msf/core/exploit/remote/smb/client.rb @@ -1,7 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/smb' -require 'rex/proto/ntlm' -require 'rex/proto/dcerpc' require 'rex/encoder/ndr' require 'recog' diff --git a/lib/msf/core/exploit/remote/smb/client/psexec.rb b/lib/msf/core/exploit/remote/smb/client/psexec.rb index 2d462f81d7..273b05d934 100644 --- a/lib/msf/core/exploit/remote/smb/client/psexec.rb +++ b/lib/msf/core/exploit/remote/smb/client/psexec.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dcerpc/svcctl' require 'windows_error' require 'windows_error/win32' include WindowsError::Win32 diff --git a/lib/msf/core/exploit/remote/smb/client/web_exec.rb b/lib/msf/core/exploit/remote/smb/client/web_exec.rb index fd1d43b77d..cb3e96334c 100644 --- a/lib/msf/core/exploit/remote/smb/client/web_exec.rb +++ b/lib/msf/core/exploit/remote/smb/client/web_exec.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dcerpc/svcctl' require 'windows_error' require 'windows_error/win32' include WindowsError::Win32 diff --git a/lib/msf/core/exploit/remote/smb/server/share.rb b/lib/msf/core/exploit/remote/smb/server/share.rb index 8435fbbf4a..47afc3e56d 100644 --- a/lib/msf/core/exploit/remote/smb/server/share.rb +++ b/lib/msf/core/exploit/remote/smb/server/share.rb @@ -1,12 +1,7 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/smb' require 'rex/text' -require 'rex/logging' require 'rex/struct2' -require 'rex/proto/smb/constants' -require 'rex/proto/smb/utils' -require 'rex/proto/dcerpc' module Msf module Exploit::Remote::SMB::Server diff --git a/lib/msf/core/exploit/remote/sunrpc.rb b/lib/msf/core/exploit/remote/sunrpc.rb index 3d0f34a8c2..0938d7838b 100644 --- a/lib/msf/core/exploit/remote/sunrpc.rb +++ b/lib/msf/core/exploit/remote/sunrpc.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/sunrpc' module Msf diff --git a/lib/msf/core/exploit/remote/winrm.rb b/lib/msf/core/exploit/remote/winrm.rb index 31bbc729c0..38c545e694 100644 --- a/lib/msf/core/exploit/remote/winrm.rb +++ b/lib/msf/core/exploit/remote/winrm.rb @@ -1,10 +1,6 @@ # -*- coding: binary -*- require 'uri' require 'digest' -require 'rex/proto/ntlm/crypt' -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/utils' -require 'rex/proto/ntlm/exceptions' module Msf module Exploit::Remote::WinRM diff --git a/lib/msf/core/exploit/tftp_server.rb b/lib/msf/core/exploit/tftp_server.rb index 43aff8e33c..ca94d025bc 100644 --- a/lib/msf/core/exploit/tftp_server.rb +++ b/lib/msf/core/exploit/tftp_server.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/tftp' module Msf diff --git a/lib/msf/core/framework.rb b/lib/msf/core/framework.rb index d7feb88fc8..16a7b3e04c 100644 --- a/lib/msf/core/framework.rb +++ b/lib/msf/core/framework.rb @@ -13,8 +13,6 @@ require 'monitor' require 'metasploit/framework/version' require 'rex/socket/ssl' require 'metasploit/framework/thread_factory_provider' -require 'rex/job_container' -require 'rex/thread_factory' module Msf ### @@ -52,7 +50,6 @@ class Framework end require 'metasploit/framework/data_service/proxy/core' - require 'rex/json_hash_file' # # Creates an instance of the framework context. diff --git a/lib/msf/core/handler/bind_named_pipe.rb b/lib/msf/core/handler/bind_named_pipe.rb index 1caef661e6..1d303b73c2 100644 --- a/lib/msf/core/handler/bind_named_pipe.rb +++ b/lib/msf/core/handler/bind_named_pipe.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'thread' -require 'rex/proto/smb/simpleclient' # # KNOWN ISSUES diff --git a/lib/msf/core/handler/reverse_http.rb b/lib/msf/core/handler/reverse_http.rb index e718912113..cb10b5f2d4 100644 --- a/lib/msf/core/handler/reverse_http.rb +++ b/lib/msf/core/handler/reverse_http.rb @@ -1,13 +1,10 @@ # -*- coding: binary -*- require 'rex/io/stream_abstraction' require 'rex/sync/ref' -require 'rex/payloads/meterpreter/uri_checksum' -require 'rex/post/meterpreter' + require 'rex/post/meterpreter/core_ids' require 'rex/socket/x509_certificate' -require 'rex/user_agent' require 'uri' -require 'rex/service_manager' module Msf module Handler diff --git a/lib/msf/core/handler/reverse_ssh.rb b/lib/msf/core/handler/reverse_ssh.rb index 2edc081c11..ae4ad47c50 100644 --- a/lib/msf/core/handler/reverse_ssh.rb +++ b/lib/msf/core/handler/reverse_ssh.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/ssh' module Msf module Handler diff --git a/lib/msf/core/module/ui.rb b/lib/msf/core/module/ui.rb index 336bf6843d..c3e7709834 100644 --- a/lib/msf/core/module/ui.rb +++ b/lib/msf/core/module/ui.rb @@ -1,4 +1,3 @@ -require 'rex/ui/subscriber' module Msf::Module::UI autoload :Line, 'msf/core/module/ui/line' diff --git a/lib/msf/core/module/uuid.rb b/lib/msf/core/module/uuid.rb index d985122768..5b3299d3df 100644 --- a/lib/msf/core/module/uuid.rb +++ b/lib/msf/core/module/uuid.rb @@ -1,3 +1,5 @@ +require 'rex/text' + module Msf::Module::UUID # # Attributes @@ -24,4 +26,4 @@ module Msf::Module::UUID def generate_uuid self.uuid = Rex::Text.rand_text_alphanumeric(8).downcase end -end \ No newline at end of file +end diff --git a/lib/msf/core/modules/loader/directory.rb b/lib/msf/core/modules/loader/directory.rb index 0246cd9221..8fc1830130 100644 --- a/lib/msf/core/modules/loader/directory.rb +++ b/lib/msf/core/modules/loader/directory.rb @@ -1,4 +1,5 @@ # -*- coding: binary -*- +require 'rex/file' # Concerns loading Ruby modules from a directory class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base diff --git a/lib/msf/core/modules/metadata/cache.rb b/lib/msf/core/modules/metadata/cache.rb index d395fef4d5..7290f3bd5b 100644 --- a/lib/msf/core/modules/metadata/cache.rb +++ b/lib/msf/core/modules/metadata/cache.rb @@ -1,5 +1,4 @@ require 'singleton' -require 'rex/ui/text/output/stdio' # # Core service class that provides storage of module metadata as well as operations on the metadata. # Note that operations on this metadata are included as separate modules. diff --git a/lib/msf/core/opt.rb b/lib/msf/core/opt.rb index 5280876334..685c8f5ac3 100644 --- a/lib/msf/core/opt.rb +++ b/lib/msf/core/opt.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/config' module Msf # # Builtin framework options with shortcut methods diff --git a/lib/msf/core/payload.rb b/lib/msf/core/payload.rb index 55fdc250c7..49a4c43a8b 100644 --- a/lib/msf/core/payload.rb +++ b/lib/msf/core/payload.rb @@ -12,7 +12,6 @@ module Msf ### class Payload < Msf::Module - require 'rex/payloads/win32' # Platform specific includes require 'metasploit/framework/compiler/mingw' diff --git a/lib/msf/core/payload/android.rb b/lib/msf/core/payload/android.rb index 9c4b62fe5c..ec19c462bc 100644 --- a/lib/msf/core/payload/android.rb +++ b/lib/msf/core/payload/android.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/config' module Msf::Payload::Android diff --git a/lib/msf/core/payload/uuid/options.rb b/lib/msf/core/payload/uuid/options.rb index 160c187376..dde73681be 100644 --- a/lib/msf/core/payload/uuid/options.rb +++ b/lib/msf/core/payload/uuid/options.rb @@ -1,6 +1,5 @@ # -*- coding => binary -*- -require 'rex/payloads/meterpreter/uri_checksum' # # This module provides datastore option definitions and helper methods for payload modules that support UUIDs diff --git a/lib/msf/core/payload/windows/block_api.rb b/lib/msf/core/payload/windows/block_api.rb index a7391141f0..447efe139e 100644 --- a/lib/msf/core/payload/windows/block_api.rb +++ b/lib/msf/core/payload/windows/block_api.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/shuffle' module Msf diff --git a/lib/msf/core/payload/windows/encrypted_reverse_tcp.rb b/lib/msf/core/payload/windows/encrypted_reverse_tcp.rb index febd354cd3..9caab1eff0 100644 --- a/lib/msf/core/payload/windows/encrypted_reverse_tcp.rb +++ b/lib/msf/core/payload/windows/encrypted_reverse_tcp.rb @@ -2,7 +2,6 @@ require 'rex/peparsey' require 'metasploit/framework/compiler/mingw' -require 'rex/crypto/chacha20' module Msf diff --git a/lib/msf/core/payload/windows/meterpreter_loader.rb b/lib/msf/core/payload/windows/meterpreter_loader.rb index 357b1d0095..522de18b8e 100644 --- a/lib/msf/core/payload/windows/meterpreter_loader.rb +++ b/lib/msf/core/payload/windows/meterpreter_loader.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/config' module Msf diff --git a/lib/msf/core/payload/windows/reverse_win_https.rb b/lib/msf/core/payload/windows/reverse_win_https.rb index 205883b9ce..67a7deac40 100644 --- a/lib/msf/core/payload/windows/reverse_win_https.rb +++ b/lib/msf/core/payload/windows/reverse_win_https.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/uri_checksum' module Msf diff --git a/lib/msf/core/payload/windows/x64/block_api_x64.rb b/lib/msf/core/payload/windows/x64/block_api_x64.rb index 471d6a6c60..f88d8db967 100644 --- a/lib/msf/core/payload/windows/x64/block_api_x64.rb +++ b/lib/msf/core/payload/windows/x64/block_api_x64.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/shuffle' module Msf diff --git a/lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb b/lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb index 242f0466d2..0d972865fb 100644 --- a/lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb +++ b/lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/config' module Msf diff --git a/lib/msf/core/payload/windows/x64/reverse_win_http_x64.rb b/lib/msf/core/payload/windows/x64/reverse_win_http_x64.rb index 8b48c21ea8..78f1477a02 100644 --- a/lib/msf/core/payload/windows/x64/reverse_win_http_x64.rb +++ b/lib/msf/core/payload/windows/x64/reverse_win_http_x64.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/config' module Msf diff --git a/lib/msf/core/payload/windows/x64/reverse_win_https_x64.rb b/lib/msf/core/payload/windows/x64/reverse_win_https_x64.rb index 148fdeec2e..b7428db558 100644 --- a/lib/msf/core/payload/windows/x64/reverse_win_https_x64.rb +++ b/lib/msf/core/payload/windows/x64/reverse_win_https_x64.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/payloads/meterpreter/uri_checksum' module Msf diff --git a/lib/msf/core/post/windows/cli_parse.rb b/lib/msf/core/post/windows/cli_parse.rb index 16fe675e81..ffae60eb34 100644 --- a/lib/msf/core/post/windows/cli_parse.rb +++ b/lib/msf/core/post/windows/cli_parse.rb @@ -6,7 +6,6 @@ module Windows module CliParse - require 'rex/logging' require 'rex/exceptions' #Msf::Post::Windows::CliParse::ParseError diff --git a/lib/msf/core/rpc/v10/client.rb b/lib/msf/core/rpc/v10/client.rb index 7c26ff3cc3..d923c79e41 100644 --- a/lib/msf/core/rpc/v10/client.rb +++ b/lib/msf/core/rpc/v10/client.rb @@ -3,7 +3,7 @@ require 'xmlrpc/client' require 'msgpack' require 'rex' -require 'rex/proto/http' + module Msf diff --git a/lib/msf/core/rpc/v10/rpc_session.rb b/lib/msf/core/rpc/v10/rpc_session.rb index 16e08ecb57..6492fc6a98 100644 --- a/lib/msf/core/rpc/v10/rpc_session.rb +++ b/lib/msf/core/rpc/v10/rpc_session.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex' -require 'rex/ui/text/output/buffer' module Msf module RPC diff --git a/lib/msf/core/rpc/v10/service.rb b/lib/msf/core/rpc/v10/service.rb index bc60947815..d54f6ce305 100644 --- a/lib/msf/core/rpc/v10/service.rb +++ b/lib/msf/core/rpc/v10/service.rb @@ -2,7 +2,6 @@ require 'msgpack' require 'rex' -require 'rex/service_manager' module Msf module RPC diff --git a/lib/msf/core/session/interactive.rb b/lib/msf/core/session/interactive.rb index 15302297b5..15a7d52b86 100644 --- a/lib/msf/core/session/interactive.rb +++ b/lib/msf/core/session/interactive.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Msf module Session diff --git a/lib/msf/core/web_services/http_db_manager_service.rb b/lib/msf/core/web_services/http_db_manager_service.rb index e5859b72f4..61b2a53be9 100644 --- a/lib/msf/core/web_services/http_db_manager_service.rb +++ b/lib/msf/core/web_services/http_db_manager_service.rb @@ -1,6 +1,5 @@ require 'rack' require 'metasploit/framework/parsed_options/remote_db' -require 'rex/ui/text/output/stdio' class Msf::WebServices::HttpDBManagerService diff --git a/lib/msf/core/web_services/servlet_helper.rb b/lib/msf/core/web_services/servlet_helper.rb index 0d6bed20db..03ef03dfe1 100644 --- a/lib/msf/core/web_services/servlet_helper.rb +++ b/lib/msf/core/web_services/servlet_helper.rb @@ -1,6 +1,5 @@ require 'json' require 'metasploit/framework/data_service/remote/http/response_data_helper' -require 'rex/ui/text/output/stdio' module Msf::WebServices::ServletHelper include ResponseDataHelper diff --git a/lib/msf/ui/console/command_dispatcher.rb b/lib/msf/ui/console/command_dispatcher.rb index c5832b41b1..9d3ab3d07e 100644 --- a/lib/msf/ui/console/command_dispatcher.rb +++ b/lib/msf/ui/console/command_dispatcher.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/ui' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/common.rb b/lib/msf/ui/console/command_dispatcher/common.rb index 3ff132c8b7..8f226356ef 100644 --- a/lib/msf/ui/console/command_dispatcher/common.rb +++ b/lib/msf/ui/console/command_dispatcher/common.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rexml/document' -require 'rex/parser/nmap_xml' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 881a682e27..ca3c562915 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -4,7 +4,6 @@ # Rex # -require 'rex/ui/text/output/buffer/stdout' # # Project diff --git a/lib/msf/ui/console/command_dispatcher/creds.rb b/lib/msf/ui/console/command_dispatcher/creds.rb index 472593fadd..eeb227a510 100644 --- a/lib/msf/ui/console/command_dispatcher/creds.rb +++ b/lib/msf/ui/console/command_dispatcher/creds.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rexml/document' -require 'rex/parser/nmap_xml' require 'metasploit/framework/password_crackers/hashcat/formatter' require 'metasploit/framework/password_crackers/jtr/formatter' diff --git a/lib/msf/ui/console/command_dispatcher/db.rb b/lib/msf/ui/console/command_dispatcher/db.rb index e8a70465e8..cfa6cfdbd2 100644 --- a/lib/msf/ui/console/command_dispatcher/db.rb +++ b/lib/msf/ui/console/command_dispatcher/db.rb @@ -2,7 +2,6 @@ require 'json' require 'rexml/document' -require 'rex/parser/nmap_xml' require 'metasploit/framework/data_service' require 'metasploit/framework/data_service/remote/http/core' diff --git a/lib/msf/ui/console/command_dispatcher/jobs.rb b/lib/msf/ui/console/command_dispatcher/jobs.rb index bc0ae5e3f7..a6989d27de 100644 --- a/lib/msf/ui/console/command_dispatcher/jobs.rb +++ b/lib/msf/ui/console/command_dispatcher/jobs.rb @@ -5,7 +5,6 @@ # Rex # -require 'rex/ui/text/output/buffer/stdout' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/modules.rb b/lib/msf/ui/console/command_dispatcher/modules.rb index 3cd5db7869..3ed6c7de12 100644 --- a/lib/msf/ui/console/command_dispatcher/modules.rb +++ b/lib/msf/ui/console/command_dispatcher/modules.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/ui/text/output/buffer/stdout' -require 'rex/parser/arguments' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/nop.rb b/lib/msf/ui/console/command_dispatcher/nop.rb index 5270dbf64b..8628e3be8c 100644 --- a/lib/msf/ui/console/command_dispatcher/nop.rb +++ b/lib/msf/ui/console/command_dispatcher/nop.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/parser/arguments' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/payload.rb b/lib/msf/ui/console/command_dispatcher/payload.rb index 4ed905ed00..28ce549055 100644 --- a/lib/msf/ui/console/command_dispatcher/payload.rb +++ b/lib/msf/ui/console/command_dispatcher/payload.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/parser/arguments' module Msf module Ui diff --git a/lib/msf/ui/console/command_dispatcher/resource.rb b/lib/msf/ui/console/command_dispatcher/resource.rb index c2ef94a50a..5f937f199b 100644 --- a/lib/msf/ui/console/command_dispatcher/resource.rb +++ b/lib/msf/ui/console/command_dispatcher/resource.rb @@ -4,7 +4,6 @@ # Rex # -require 'rex/ui/text/output/buffer/stdout' module Msf diff --git a/lib/msf/ui/console/module_command_dispatcher.rb b/lib/msf/ui/console/module_command_dispatcher.rb index aa62a88767..0309d5edf8 100644 --- a/lib/msf/ui/console/module_command_dispatcher.rb +++ b/lib/msf/ui/console/module_command_dispatcher.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/parser/arguments' module Msf module Ui diff --git a/lib/msf/ui/web/comm.rb b/lib/msf/ui/web/comm.rb index b71f45fd77..92582797cc 100644 --- a/lib/msf/ui/web/comm.rb +++ b/lib/msf/ui/web/comm.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui/text/bidirectional_pipe' module Msf module Ui module Web diff --git a/lib/msf/ui/web/driver.rb b/lib/msf/ui/web/driver.rb index b50739e37e..5c9685fffa 100644 --- a/lib/msf/ui/web/driver.rb +++ b/lib/msf/ui/web/driver.rb @@ -1,11 +1,10 @@ # -*- coding: binary -*- -require 'rex/proto/http' + module Msf module Ui module Web -require 'rex/ui/text/bidirectional_pipe' ### diff --git a/lib/msf/ui/web/web_console.rb b/lib/msf/ui/web/web_console.rb index 5cd14764ec..cd9debb980 100644 --- a/lib/msf/ui/web/web_console.rb +++ b/lib/msf/ui/web/web_console.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui/text/bidirectional_pipe' module Msf module Ui module Web diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb index 7ca58b17cc..3f079f6dbc 100644 --- a/lib/msf/util/exe.rb +++ b/lib/msf/util/exe.rb @@ -16,7 +16,6 @@ require 'rex/pescan' require 'rex/random_identifier' require 'rex/zip' require 'rex/powershell' -require 'rex/payloads/shuffle' require 'metasm' require 'digest/sha1' # Generates a default template diff --git a/lib/msf_autoload.rb b/lib/msf_autoload.rb index 027e3c78bb..e66db601da 100644 --- a/lib/msf_autoload.rb +++ b/lib/msf_autoload.rb @@ -16,16 +16,22 @@ require 'zeitwerk' class TempInflector < Zeitwerk::Inflector def camelize(basename, abspath) - if basename == 'osx' && abspath.end_with?('lib/msf/core/payload/osx', 'lib/msf/core/payload/osx.rb') + if basename == 'osx' && abspath.end_with?("#{__dir__}/msf/core/payload/osx", "#{__dir__}/msf/core/payload/osx.rb") 'Osx' - elsif basename == 'exe' && abspath.end_with?('lib/msf/core/exe', 'lib/msf/core/exe.rb') + elsif basename == 'exe' && abspath.end_with?("#{__dir__}/msf/core/exe", "#{__dir__}/msf/core/exe.rb") 'Exe' - elsif basename == 'json' && abspath.end_with?('lib/msf/base/serializer/json.rb') + elsif basename == 'json' && abspath.end_with?("#{__dir__}/msf/base/serializer/json.rb") 'Json' - elsif basename == 'powershell' && abspath.end_with?('lib/msf/base/sessions/powershell.rb') + elsif basename == 'powershell' && abspath.end_with?("#{__dir__}/msf/base/sessions/powershell.rb") 'PowerShell' - elsif basename == 'ui' && abspath.end_with?('lib/msf/core/module/ui', 'lib/msf/core/module/ui.rb') + elsif basename == 'ui' && abspath.end_with?("#{__dir__}/msf/core/module/ui", "#{__dir__}/msf/core/module/ui.rb", "#{__dir__}/rex/post/ui", "#{__dir__}/rex/post/ui.rb", "#{__dir__}/rex/post/meterpreter/extensions/stdapi/ui.rb") 'UI' + elsif basename == 'ssh' && abspath.end_with?("#{__dir__}/rex/proto/ssh") + 'Ssh' + elsif basename == 'http' && abspath.end_with?("#{__dir__}/rex/proto/http") + 'Http' + elsif basename == 'rftransceiver' && abspath.end_with?("#{__dir__}/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb") + 'RFtransceiver' else super end @@ -34,6 +40,7 @@ end loader = Zeitwerk::Loader.new loader.push_dir("#{__dir__}/msf/", namespace: Msf) +loader.push_dir("#{__dir__}/rex/", namespace: Rex) loader.push_dir("#{__dir__}/../app/validators/") loader.ignore( @@ -45,6 +52,9 @@ loader.ignore( "#{__dir__}/msf/core/rpc/v10/constants.rb", "#{__dir__}/msf/core.rb", "#{__dir__}/msf/base.rb", + "#{__dir__}/rex/post/", + "#{__dir__}/rex/post.rb", + "#{__dir__}/rex/proto/ssh/hrr_rb_ssh.rb" ) loader.collapse( @@ -55,7 +65,8 @@ loader.collapse( "#{__dir__}/msf/core/payload/linux/x64", "#{__dir__}/msf/core/web_services/servlet", "#{__dir__}/msf/base", - "#{__dir__}/msf/ui/console/command_dispatcher/db" + "#{__dir__}/msf/ui/console/command_dispatcher/db", + "#{__dir__}/rex/parser/fs" ) loader.inflector = TempInflector.new @@ -231,6 +242,42 @@ loader.inflector.inflect( 'hwbridge' => 'HWBridge', 'vncinject_options' => 'VncInjectOptions', 'vncinject' => 'VncInject', + 'json_hash_file' => 'JSONHashFile', + 'ndr' => 'NDR', + 'ci_document' => 'CIDocument', + 'fusionvm_document' => 'FusionVMDocument', + 'group_policy_preferences' => 'GPP', + 'ip360_aspl_xml' => 'IP360ASPLXMLStreamParser', + 'ip360_xml' => 'IP360XMLStreamParser', + 'nessus_xml' => 'NessusXMLStreamParser', + 'netsparker_xml' => 'NetSparkerXMLStreamParser', + 'nexpose_xml' => 'NexposeXMLStreamParser', + 'nmap_xml' => 'NmapXMLStreamParser', + 'openvas_document' => 'OpenVASDocument', + 'retina_xml' => 'RetinaXMLStreamParser', + 'graphml' => 'GraphML', + 'apple_backup_manifestdb' => 'AppleBackupManifestDB', + 'winscp' => 'WinSCP', + 'acpp' => 'ACPP', + 'tftp' => 'TFTP', + 'ipmi' => 'IPMI', + 'channel_auth_reply' => 'Channel_Auth_Reply', + 'open_session_reply' => 'Open_Session_Reply', + 'rakp2' => 'RAKP2', + 'pjl' => 'PJL', + 'dhcp' => 'DHCP', + 'addp' => 'ADDP', + 'rfb' => 'RFB', + 'io' => 'IO', + 'ntfs' => 'NTFS', + 'bitlocker' => 'BITLOCKER', + 'adb' => 'ADB', + 'drda' => 'DRDA', + 'tlv' => 'TLV', + 'svcctl' => 'SVCCTL', + 'wdscp' => 'WDSCP', + 'appapi' => 'AppApi', + 'uds_errors' => 'UDSErrors' ) loader.setup # ready! diff --git a/lib/rex.rb b/lib/rex.rb index a6829acd40..32a6c51ea3 100644 --- a/lib/rex.rb +++ b/lib/rex.rb @@ -50,8 +50,6 @@ require 'rex/random_identifier' require 'rex/powershell' # Library for processing and creating Zip compatible archives require 'rex/zip' -# Library for processing and creating tar compatible archives (not really a gem) -require 'rex/tar' # Library for parsing offline Windows Registry files require 'rex/registry' # Library for parsing Java serialized streams @@ -70,20 +68,11 @@ require 'rex/arch' require 'rex/exploitation' # Generic classes -require 'rex/exceptions' -require 'rex/transformer' -require 'rex/random_identifier' -require 'rex/time' -require 'rex/job_container' require 'rex/file' # Thread safety and synchronization require 'rex/sync' -# Thread factory -require 'rex/thread_factory' - - # Assembly require 'rex/assembly/nasm' @@ -98,28 +87,13 @@ require 'rex/io/stream_server' # Sockets require 'rex/socket' -# Protocols -require 'rex/proto' -require 'rex/mac_oui' - -# Parsers -require 'rex/parser/arguments' -require 'rex/parser/ini' - - # Compatibility require 'rex/compat' -# SSLScan +# SSLScan require 'rex/sslscan/scanner' require 'rex/sslscan/result' -# Cryptography -require 'rex/crypto/aes256' -require 'rex/crypto/rc4' -require 'rex/crypto/chacha20' - - # Overload the Kernel.sleep() function to be thread-safe Kernel.class_eval(" def sleep(seconds=nil) diff --git a/lib/rex/crypto.rb b/lib/rex/crypto.rb new file mode 100644 index 0000000000..a94bf4fc62 --- /dev/null +++ b/lib/rex/crypto.rb @@ -0,0 +1,30 @@ +module Rex::Crypto + # Returns an encrypted string using AES256-CBC. + # + # @deprecated Access via Rex::Crypto::Aes256 + # @param iv [String] Initialization vector. + # @param key [String] Secret key. + # @return [String] The encrypted string. + def self.encrypt_aes256(iv, key, value) + Aes256.encrypt_aes256(iv, key, value) + end + + # Returns a decrypted string using AES256-CBC. + # + # @deprecated Access via Rex::Crypto::Aes256 + # @param iv [String] Initialization vector. + # @param key [String] Secret key. + # @return [String] The decrypted string. + def self.decrypt_aes256(iv, key, value) + Aes256.decrypt_aes256(iv, key, value) + end + + # Returns a decrypted or encrypted RC4 string. + # + # @deprecated Access via Rex::Crypto::Rc4 + # @param key [String] Secret key. + # @param [String] + def self.rc4(key, value) + Rc4.rc4(key, value) + end +end diff --git a/lib/rex/crypto/aes256.rb b/lib/rex/crypto/aes256.rb index 036bba7c5b..e9485efa80 100644 --- a/lib/rex/crypto/aes256.rb +++ b/lib/rex/crypto/aes256.rb @@ -2,32 +2,33 @@ module Rex module Crypto + module Aes256 + # Returns an encrypted string using AES256-CBC. + # + # @param iv [String] Initialization vector. + # @param key [String] Secret key. + # @return [String] The encrypted string. + def self.encrypt_aes256(iv, key, value) + aes = OpenSSL::Cipher::AES256.new(:CBC) + aes.encrypt + aes.iv = iv + aes.key = key + aes.update(value) + aes.final + end + + # Returns a decrypted string using AES256-CBC. + # + # @param iv [String] Initialization vector. + # @param key [String] Secret key. + # @return [String] The decrypted string. + def self.decrypt_aes256(iv, key, value) + aes = OpenSSL::Cipher::AES256.new(:CBC) + aes.decrypt + aes.iv = iv + aes.key = key + aes.update(value) + aes.final + end - # Returns an encrypted string using AES256-CBC. - # - # @param iv [String] Initialization vector. - # @param key [String] Secret key. - # @return [String] The encrypted string. - def self.encrypt_aes256(iv, key, value) - aes = OpenSSL::Cipher::AES256.new(:CBC) - aes.encrypt - aes.iv = iv - aes.key = key - aes.update(value) + aes.final end - - # Returns a decrypted string using AES256-CBC. - # - # @param iv [String] Initialization vector. - # @param key [String] Secret key. - # @return [String] The decrypted string. - def self.decrypt_aes256(iv, key, value) - aes = OpenSSL::Cipher::AES256.new(:CBC) - aes.decrypt - aes.iv = iv - aes.key = key - aes.update(value) + aes.final - end - end -end \ No newline at end of file +end diff --git a/lib/rex/crypto/rc4.rb b/lib/rex/crypto/rc4.rb index b3e3a016be..bd1817f426 100644 --- a/lib/rex/crypto/rc4.rb +++ b/lib/rex/crypto/rc4.rb @@ -4,17 +4,19 @@ require 'rc4' module Rex module Crypto + module Rc4 - # Returns a decrypted or encrypted RC4 string. - # - # @param key [String] Secret key. - # @param [String] - def self.rc4(key, value) - rc4 = RC4.new(key) + # Returns a decrypted or encrypted RC4 string. + # + # @param key [String] Secret key. + # @param [String] + def self.rc4(key, value) + rc4 = RC4.new(key) + + # This can also be used to decrypt + rc4.encrypt(value) + end - # This can also be used to decrypt - rc4.encrypt(value) end - end -end \ No newline at end of file +end diff --git a/lib/rex/exceptions.rb b/lib/rex/exceptions.rb deleted file mode 100644 index 73b085f5ee..0000000000 --- a/lib/rex/exceptions.rb +++ /dev/null @@ -1,307 +0,0 @@ -# -*- coding: binary -*- - -module Rex - -### -# -# Base mixin for all exceptions that can be thrown from inside Rex. -# -### -module Exception -end - -### -# -# This exception is raised when a timeout occurs. -# -### -class TimeoutError < Interrupt - include Exception - - def to_s - "Operation timed out." - end -end - -### -# -# This exception is raised when a method is called or a feature is used that -# is not implemented. -# -### -class NotImplementedError < ::NotImplementedError - include Exception - - def to_s - "The requested method is not implemented." - end -end - -### -# -# This exception is raised when a generalized runtime error occurs. -# -### -class RuntimeError < ::RuntimeError - include Exception -end - -### -# -# This exception is raised when an invalid argument is supplied to a method. -# -### -class ArgumentError < ::ArgumentError - include Exception - - def initialize(message = nil) - @message = message - end - - def to_s - str = 'An invalid argument was specified.' - if @message - str << " #{@message}" - end - str - end -end - -### -# -# This exception is raised when an argument that was supplied to a method -# could not be parsed correctly. -# -### -class ArgumentParseError < ::ArgumentError - include Exception - - def to_s - "The argument could not be parsed correctly." - end -end - -### -# -# This exception is raised when an argument is ambiguous. -# -### -class AmbiguousArgumentError < ::RuntimeError - include Exception - - def initialize(name = nil) - @name = name - end - - def to_s - "The name #{@name} is ambiguous." - end -end - -### -# -# This error is thrown when a stream is detected as being closed. -# -### -class StreamClosedError < ::IOError - include Exception - - def initialize(stream) - @stream = stream - end - - def stream - @stream - end - - def to_s - "Stream #{@stream} is closed." - end -end - -## -# -# Socket exceptions -# -## - -### -# -# This exception is raised when a general socket error occurs. -# -### -module SocketError - include Exception - - def to_s - "A socket error occurred." - end -end - -### -# -# This exception is raised when there is some kind of error related to -# communication with a host. -# -### -module HostCommunicationError - def initialize(addr = nil, port = nil) - self.host = addr - self.port = port - end - - # - # This method returns a printable address and optional port associated - # with the host that triggered the exception. - # - def addr_to_s - if host and port - "(#{host}:#{port})" - elsif host - "(#{host})" - else - "" - end - end - - attr_accessor :host, :port -end - - -### -# -# This is a generic exception for errors that cause a connection to fail. -# -### -class ConnectionError < ::IOError - include SocketError - include HostCommunicationError -end - -### -# -# This exception is raised when a connection attempt fails because the remote -# side refused the connection. -# -### -class ConnectionRefused < ConnectionError - def to_s - "The connection was refused by the remote host #{addr_to_s}." - end -end - -### -# -# This exception is raised when a connection attempt fails because the remote -# side is unreachable. -# -### -class HostUnreachable < ConnectionError - def to_s - "The host #{addr_to_s} was unreachable." - end -end - -### -# -# This exception is raised when a connection attempt times out. -# -### -class ConnectionTimeout < ConnectionError - def to_s - "The connection timed out #{addr_to_s}." - end -end - -### -# -# This connection error is raised when an attempt is made to connect -# to a broadcast or network address. -# -### -class InvalidDestination < ConnectionError - include SocketError - include HostCommunicationError - - def to_s - "The destination is invalid: #{addr_to_s}." - end -end - -### -# -# This exception is raised when an attempt to use an address or port that is -# already in use or onot available occurs. such as binding to a host on a -# given port that is already in use, or when a bind address is specified that -# is not available to the host. -# -### -class BindFailed < ::ArgumentError - include SocketError - include HostCommunicationError - - def to_s - "The address is already in use or unavailable: #{addr_to_s}." - end -end - -## -# -# This exception is listed for backwards compatibility. We had been -# using AddressInUse as the exception for both bind errors and connection -# errors triggered by connection attempts to broadcast and network addresses. -# The two classes above have split this into their respective sources, but -# callers may still expect the old behavior. -# -## -class AddressInUse < ConnectionError - include SocketError - include HostCommunicationError - - def to_s - "The address is already in use or unavailable: #{addr_to_s}." - end -end - - -### -# -# This exception is raised when an unsupported internet protocol is specified. -# -### -class UnsupportedProtocol < ::ArgumentError - include SocketError - - def initialize(proto = nil) - self.proto = proto - end - - def to_s - "The protocol #{proto} is not supported." - end - - attr_accessor :proto -end - - -### -# -# This exception is raised when a proxy fails to pass a connection -# -### -class ConnectionProxyError < ConnectionError - def initialize(host,port,ptype,reason) - super(host,port) - self.ptype = ptype - self.reason = reason - end - - def to_s - self.ptype + ": " + self.reason - end - - attr_accessor :ptype, :reason -end - -end - diff --git a/lib/rex/time.rb b/lib/rex/ext_time.rb similarity index 100% rename from lib/rex/time.rb rename to lib/rex/ext_time.rb diff --git a/lib/rex/job_container.rb b/lib/rex/job_container.rb index bd2c23cc63..66f82d7114 100644 --- a/lib/rex/job_container.rb +++ b/lib/rex/job_container.rb @@ -1,8 +1,6 @@ # -*- coding: binary -*- module Rex -autoload :Job, 'rex/job' - ### # # This class contains zero or more abstract jobs that can be enumerated and diff --git a/lib/rex/logging.rb b/lib/rex/logging.rb index e68f812e54..eb2fb80bac 100644 --- a/lib/rex/logging.rb +++ b/lib/rex/logging.rb @@ -1,4 +1,6 @@ # -*- coding: binary -*- +module Rex::Logging + # # Log severities @@ -62,3 +64,4 @@ LEV_2 = 2 LEV_3 = 3 require 'rex/logging/log_dispatcher' +end diff --git a/lib/rex/logging/log_dispatcher.rb b/lib/rex/logging/log_dispatcher.rb index d16a821652..f85fc86fab 100644 --- a/lib/rex/logging/log_dispatcher.rb +++ b/lib/rex/logging/log_dispatcher.rb @@ -1,8 +1,5 @@ # -*- coding: binary -*- require 'rex/sync' -require 'rex/logging' -require 'rex/logging/log_sink' -require 'rex/logging/log_sink_factory' module Rex module Logging diff --git a/lib/rex/logging/log_sink_factory.rb b/lib/rex/logging/log_sink_factory.rb index fd4d9c0672..aad2d0bf06 100644 --- a/lib/rex/logging/log_sink_factory.rb +++ b/lib/rex/logging/log_sink_factory.rb @@ -1,11 +1,5 @@ # -*- coding: binary -*- -require 'rex/logging/sinks/stream' -require 'rex/logging/sinks/flatfile' -require 'rex/logging/sinks/timestamp_colorless_flatfile' -require 'rex/logging/sinks/stderr' -require 'rex/logging/sinks/stdout' -require 'rex/logging/sinks/stdout_without_timestamps' module Rex module Logging diff --git a/lib/rex/logging/sinks/stdout_without_timestamps.rb b/lib/rex/logging/sinks/stdout_without_timestamps.rb index e0e0279fec..5501ecd9b5 100644 --- a/lib/rex/logging/sinks/stdout_without_timestamps.rb +++ b/lib/rex/logging/sinks/stdout_without_timestamps.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/logging' module Rex module Logging diff --git a/lib/rex/logging/sinks/stream.rb b/lib/rex/logging/sinks/stream.rb index 392701265d..a763cb29b3 100644 --- a/lib/rex/logging/sinks/stream.rb +++ b/lib/rex/logging/sinks/stream.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/logging' module Rex module Logging diff --git a/lib/rex/logging/sinks/timestamp_colorless_flatfile.rb b/lib/rex/logging/sinks/timestamp_colorless_flatfile.rb index 8681d696c2..50123f1ea6 100644 --- a/lib/rex/logging/sinks/timestamp_colorless_flatfile.rb +++ b/lib/rex/logging/sinks/timestamp_colorless_flatfile.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/logging' module Rex module Logging diff --git a/lib/rex/mac_oui.rb b/lib/rex/oui.rb similarity index 100% rename from lib/rex/mac_oui.rb rename to lib/rex/oui.rb diff --git a/lib/rex/parser.rb b/lib/rex/parser.rb new file mode 100644 index 0000000000..9a6a3ba58d --- /dev/null +++ b/lib/rex/parser.rb @@ -0,0 +1,4 @@ +require 'rex/parser/nokogiri_doc_mixin' +module Rex::Parser + +end diff --git a/lib/rex/parser/acunetix_nokogiri.rb b/lib/rex/parser/acunetix_document.rb similarity index 100% rename from lib/rex/parser/acunetix_nokogiri.rb rename to lib/rex/parser/acunetix_document.rb diff --git a/lib/rex/parser/appscan_nokogiri.rb b/lib/rex/parser/appscan_document.rb similarity index 100% rename from lib/rex/parser/appscan_nokogiri.rb rename to lib/rex/parser/appscan_document.rb diff --git a/lib/rex/parser/burp_issue_nokogiri.rb b/lib/rex/parser/burp_issue_document.rb similarity index 100% rename from lib/rex/parser/burp_issue_nokogiri.rb rename to lib/rex/parser/burp_issue_document.rb diff --git a/lib/rex/parser/burp_session_nokogiri.rb b/lib/rex/parser/burp_session_document.rb similarity index 100% rename from lib/rex/parser/burp_session_nokogiri.rb rename to lib/rex/parser/burp_session_document.rb diff --git a/lib/rex/parser/ci_nokogiri.rb b/lib/rex/parser/ci_document.rb similarity index 100% rename from lib/rex/parser/ci_nokogiri.rb rename to lib/rex/parser/ci_document.rb diff --git a/lib/rex/parser/foundstone_nokogiri.rb b/lib/rex/parser/foundstone_document.rb similarity index 100% rename from lib/rex/parser/foundstone_nokogiri.rb rename to lib/rex/parser/foundstone_document.rb diff --git a/lib/rex/parser/fusionvm_nokogiri.rb b/lib/rex/parser/fusionvm_document.rb similarity index 100% rename from lib/rex/parser/fusionvm_nokogiri.rb rename to lib/rex/parser/fusionvm_document.rb diff --git a/lib/rex/parser/ip360_aspl_xml.rb b/lib/rex/parser/ip360_aspl_xml.rb index a81a40b6a4..c974332a52 100644 --- a/lib/rex/parser/ip360_aspl_xml.rb +++ b/lib/rex/parser/ip360_aspl_xml.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rexml/document' -require 'rex/ui' module Rex module Parser diff --git a/lib/rex/parser/ip360_xml.rb b/lib/rex/parser/ip360_xml.rb index d5d0abf9ba..9f18b9cbac 100644 --- a/lib/rex/parser/ip360_xml.rb +++ b/lib/rex/parser/ip360_xml.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rexml/document' -require 'rex/ui' module Rex module Parser diff --git a/lib/rex/parser/mbsa_nokogiri.rb b/lib/rex/parser/mbsa_document.rb similarity index 100% rename from lib/rex/parser/mbsa_nokogiri.rb rename to lib/rex/parser/mbsa_document.rb diff --git a/lib/rex/parser/nessus_xml.rb b/lib/rex/parser/nessus_xml.rb index 615bf94df0..a54dc64d7f 100644 --- a/lib/rex/parser/nessus_xml.rb +++ b/lib/rex/parser/nessus_xml.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rexml/document' -require 'rex/ui' module Rex module Parser diff --git a/lib/rex/parser/netsarang.rb b/lib/rex/parser/net_sarang.rb similarity index 99% rename from lib/rex/parser/netsarang.rb rename to lib/rex/parser/net_sarang.rb index 477091c5ea..a777d447d0 100644 --- a/lib/rex/parser/netsarang.rb +++ b/lib/rex/parser/net_sarang.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ini' module Rex module Parser diff --git a/lib/rex/parser/nexpose_raw_nokogiri.rb b/lib/rex/parser/nexpose_raw_document.rb similarity index 100% rename from lib/rex/parser/nexpose_raw_nokogiri.rb rename to lib/rex/parser/nexpose_raw_document.rb diff --git a/lib/rex/parser/nexpose_simple_nokogiri.rb b/lib/rex/parser/nexpose_simple_document.rb similarity index 100% rename from lib/rex/parser/nexpose_simple_nokogiri.rb rename to lib/rex/parser/nexpose_simple_document.rb diff --git a/lib/rex/parser/nmap_nokogiri.rb b/lib/rex/parser/nmap_document.rb similarity index 100% rename from lib/rex/parser/nmap_nokogiri.rb rename to lib/rex/parser/nmap_document.rb diff --git a/lib/rex/parser/openvas_nokogiri.rb b/lib/rex/parser/openvas_document.rb similarity index 100% rename from lib/rex/parser/openvas_nokogiri.rb rename to lib/rex/parser/openvas_document.rb diff --git a/lib/rex/parser/outpost24_nokogiri.rb b/lib/rex/parser/outpost24_document.rb similarity index 100% rename from lib/rex/parser/outpost24_nokogiri.rb rename to lib/rex/parser/outpost24_document.rb diff --git a/lib/rex/parser/wapiti_nokogiri.rb b/lib/rex/parser/wapiti_document.rb similarity index 100% rename from lib/rex/parser/wapiti_nokogiri.rb rename to lib/rex/parser/wapiti_document.rb diff --git a/lib/rex/parser/winscp.rb b/lib/rex/parser/winscp.rb index fbfc2a0c35..be70f96693 100644 --- a/lib/rex/parser/winscp.rb +++ b/lib/rex/parser/winscp.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ini' module Rex module Parser diff --git a/lib/rex/payloads/meterpreter.rb b/lib/rex/payloads/meterpreter.rb index 59f1561a28..0444b8a87a 100644 --- a/lib/rex/payloads/meterpreter.rb +++ b/lib/rex/payloads/meterpreter.rb @@ -1,4 +1,3 @@ -require 'rex/payloads' module Rex::Payloads::Meterpreter end diff --git a/lib/rex/payloads/meterpreter/config.rb b/lib/rex/payloads/meterpreter/config.rb index 7e0a8381cf..5418e4941a 100644 --- a/lib/rex/payloads/meterpreter/config.rb +++ b/lib/rex/payloads/meterpreter/config.rb @@ -2,7 +2,6 @@ require 'rex/socket/x509_certificate' require 'rex/post/meterpreter/extension_mapper' require 'securerandom' -require 'rex/payloads/meterpreter' class Rex::Payloads::Meterpreter::Config include Msf::ReflectiveDLLLoader diff --git a/lib/rex/payloads/shuffle.rb b/lib/rex/payloads/shuffle.rb index ae270ff0d1..a97ab8142c 100644 --- a/lib/rex/payloads/shuffle.rb +++ b/lib/rex/payloads/shuffle.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/parser/graphml' require 'rex/arch' ## # This module contains a helper function for generating payloads from a shuffled diff --git a/lib/rex/payloads/win32.rb b/lib/rex/payloads/win32.rb deleted file mode 100644 index e7bf68e4f2..0000000000 --- a/lib/rex/payloads/win32.rb +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: binary -*- -require 'rex/payloads/win32/common' -require 'rex/payloads/win32/kernel' diff --git a/lib/rex/payloads/win32/kernel.rb b/lib/rex/payloads/win32/kernel.rb index bc82f08bc4..564d7b8bd1 100644 --- a/lib/rex/payloads/win32/kernel.rb +++ b/lib/rex/payloads/win32/kernel.rb @@ -3,10 +3,6 @@ module Rex module Payloads module Win32 -require 'rex/payloads/win32/kernel/common' -require 'rex/payloads/win32/kernel/recovery' -require 'rex/payloads/win32/kernel/stager' -require 'rex/payloads/win32/kernel/migration' module Kernel diff --git a/lib/rex/payloads/win32/kernel/common.rb b/lib/rex/payloads/win32/kernel/common.rb index a8016842e0..0e32f13054 100644 --- a/lib/rex/payloads/win32/kernel/common.rb +++ b/lib/rex/payloads/win32/kernel/common.rb @@ -4,7 +4,6 @@ module Payloads module Win32 module Kernel -require 'rex/payloads/win32/common' # # This class provides common methods that may be shared across more than diff --git a/lib/rex/post.rb b/lib/rex/post.rb index 26fa255fb0..01cea935a2 100644 --- a/lib/rex/post.rb +++ b/lib/rex/post.rb @@ -1,10 +1,9 @@ # -*- coding: binary -*- -# General independent containers -require 'rex/post/permission' - # Post-exploitation clients require 'rex/post/meterpreter' -# Hardware Bridge clients -require 'rex/post/hwbridge' +module Rex::Post + +end +include Rex::Post::Permission diff --git a/lib/rex/post/hwbridge/ui/console.rb b/lib/rex/post/hwbridge/ui/console.rb index 7b8fea9dad..2288dc5b71 100644 --- a/lib/rex/post/hwbridge/ui/console.rb +++ b/lib/rex/post/hwbridge/ui/console.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/ui' require 'rex/post/hwbridge' -require 'rex/logging' module Rex module Post diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher.rb index 58dc813eab..50ca467564 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/logging' module Rex module Post diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb index 4309b0e1c6..1a2b2df4b3 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'set' require 'rex/post/hwbridge' -require 'rex/parser/arguments' module Rex module Post diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb index 918515663e..a6e669ac24 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex/post/hwbridge' -require 'rex/parser/arguments' module Rex module Post diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb index 3d4e37f44f..f1e1a83eae 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/post/hwbridge' module Rex module Post diff --git a/lib/rex/post/meterpreter/channels/socket_abstraction.rb b/lib/rex/post/meterpreter/channels/socket_abstraction.rb index 3320c105e5..0ec39daafb 100644 --- a/lib/rex/post/meterpreter/channels/socket_abstraction.rb +++ b/lib/rex/post/meterpreter/channels/socket_abstraction.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -# require 'rex/io/socket_abstraction' require 'rex/post/meterpreter/channel' module Rex diff --git a/lib/rex/post/meterpreter/client.rb b/lib/rex/post/meterpreter/client.rb index 8fa7c26a9c..521992674e 100644 --- a/lib/rex/post/meterpreter/client.rb +++ b/lib/rex/post/meterpreter/client.rb @@ -3,7 +3,6 @@ require 'socket' require 'openssl' -require 'rex/script' require 'rex/post/meterpreter/extension_mapper' require 'rex/post/meterpreter/client_core' require 'rex/post/meterpreter/channel' diff --git a/lib/rex/post/meterpreter/client_core.rb b/lib/rex/post/meterpreter/client_core.rb index 589b2f8a86..4ce4570955 100644 --- a/lib/rex/post/meterpreter/client_core.rb +++ b/lib/rex/post/meterpreter/client_core.rb @@ -6,10 +6,6 @@ require 'rex/post/meterpreter/extension' require 'rex/post/meterpreter/extension_mapper' require 'rex/post/meterpreter/client' -# Used to generate a reflective DLL when migrating. This is yet another -# argument for moving the meterpreter client into the Msf namespace. -# URI uuid and checksum stuff -require 'rex/payloads/meterpreter/uri_checksum' # certificate hash checking require 'rex/socket/x509_certificate' @@ -73,6 +69,8 @@ class ClientCore < Extension c.include(::Msf::Payload::TransportConfig) # Include the appropriate reflective dll injection module for the target process architecture... + # Used to generate a reflective DLL when migrating. This is yet another + # argument for moving the meterpreter client into the Msf namespace. if opts[:arch] == ARCH_X86 c.include(::Msf::Payload::Windows::MeterpreterLoader) elsif opts[:arch] == ARCH_X64 @@ -918,6 +916,8 @@ private c.include( ::Msf::Payload::Stager ) # Include the appropriate reflective dll injection module for the target process architecture... + # Used to generate a reflective DLL when migrating. This is yet another + # argument for moving the meterpreter client into the Msf namespace. if target_process['arch'] == ARCH_X86 c.include( ::Msf::Payload::Windows::MeterpreterLoader ) elsif target_process['arch'] == ARCH_X64 diff --git a/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb b/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb index 5aeb8b62d5..ec76c2d6f9 100644 --- a/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb +++ b/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb @@ -2,7 +2,6 @@ require 'rex/post/meterpreter/extensions/sniffer/tlv' require 'rex/post/meterpreter/extensions/sniffer/command_ids' -require 'rex/proto/smb/utils' module Rex module Post diff --git a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb index 030d599de8..452f129f19 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb @@ -6,7 +6,6 @@ require 'rex/post/meterpreter/extensions/stdapi/tlv' require 'rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel' require 'rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_server_channel' require 'rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/udp_channel' -require 'rex/logging' module Rex module Post diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb index e1c545ce95..0f815684d2 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb @@ -1,5 +1,6 @@ # -*- coding: binary -*- +require 'rex/post' require 'rex/post/meterpreter/client' require 'rex/post/meterpreter/extensions/stdapi/constants' diff --git a/lib/rex/post/meterpreter/packet_dispatcher.rb b/lib/rex/post/meterpreter/packet_dispatcher.rb index eb141a7951..b5ab6d09e8 100644 --- a/lib/rex/post/meterpreter/packet_dispatcher.rb +++ b/lib/rex/post/meterpreter/packet_dispatcher.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rex/post/meterpreter/packet_response_waiter' -require 'rex/logging' require 'rex/exceptions' module Rex diff --git a/lib/rex/post/meterpreter/ui/console.rb b/lib/rex/post/meterpreter/ui/console.rb index 94ba5ceb44..3f4a23c057 100644 --- a/lib/rex/post/meterpreter/ui/console.rb +++ b/lib/rex/post/meterpreter/ui/console.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/ui' require 'rex/post/meterpreter' -require 'rex/logging' module Rex module Post diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb index 6824dc12e2..0c111df6ef 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/logging' module Rex module Post diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb index bbc8a3c175..9ec26669b9 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rex/post/meterpreter' require 'rex/post/meterpreter/extensions/android/command_ids' -require 'rex/google/geolocation' require 'date' module Rex diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb index 3f2a7038dd..abc16e33a7 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'set' require 'rex/post/meterpreter' -require 'rex/parser/arguments' require 'rex' module Rex diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb index 8ba877e4f0..99abf4784d 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rex/post/meterpreter' require 'rex/post/meterpreter/extensions/stdapi/command_ids' -require 'rex/service_manager' module Rex module Post diff --git a/lib/rex/post/permission.rb b/lib/rex/post/permission.rb index c39e3f277a..b82c34f8a0 100644 --- a/lib/rex/post/permission.rb +++ b/lib/rex/post/permission.rb @@ -1,5 +1,5 @@ # -*- coding: binary -*- - +module Rex::Post::Permission # Generic page protection flags PROT_NONE = 0 PROT_READ = (1 << 0) @@ -24,3 +24,4 @@ THREAD_READ = (1 << 0) THREAD_WRITE = (1 << 1) THREAD_EXECUTE = (1 << 2) THREAD_ALL = 0xffffffff +end diff --git a/lib/rex/proto.rb b/lib/rex/proto.rb index a4352a47d1..c3b74a7fa6 100644 --- a/lib/rex/proto.rb +++ b/lib/rex/proto.rb @@ -1,15 +1,6 @@ # -*- coding: binary -*- -require 'rex/proto/http' -require 'rex/proto/smb' -require 'rex/proto/ntlm' -require 'rex/proto/dcerpc' -require 'rex/proto/drda' -require 'rex/proto/iax2' -require 'rex/proto/kerberos' -require 'rex/proto/rmi' -require 'rex/proto/sms' -require 'rex/proto/mms' -require 'rex/proto/dns' + + module Rex module Proto diff --git a/lib/rex/proto/acpp.rb b/lib/rex/proto/acpp.rb index 2cd7b083e4..edd98e99ed 100644 --- a/lib/rex/proto/acpp.rb +++ b/lib/rex/proto/acpp.rb @@ -5,8 +5,6 @@ # so I'm calling it ACPP because that is the protocol header. # -require 'rex/proto/acpp/client' -require 'rex/proto/acpp/message' module Rex module Proto diff --git a/lib/rex/proto/adb.rb b/lib/rex/proto/adb.rb deleted file mode 100644 index 48295f85f3..0000000000 --- a/lib/rex/proto/adb.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: binary -*- -# -# Support for the ADB android debugging protocol -# - -require 'rex/proto/adb/client' -require 'rex/proto/adb/message' diff --git a/lib/rex/proto/adb/client.rb b/lib/rex/proto/adb/client.rb index 53fc1e0188..321446ee78 100644 --- a/lib/rex/proto/adb/client.rb +++ b/lib/rex/proto/adb/client.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/adb/message' module Rex module Proto diff --git a/lib/rex/proto/dcerpc.rb b/lib/rex/proto/dcerpc.rb deleted file mode 100644 index 168a3ba87b..0000000000 --- a/lib/rex/proto/dcerpc.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/dcerpc/uuid' -require 'rex/proto/dcerpc/response' -require 'rex/proto/dcerpc/client' -require 'rex/proto/dcerpc/packet' -require 'rex/proto/dcerpc/handle' -require 'rex/proto/dcerpc/ndr' diff --git a/lib/rex/proto/dcerpc/client.rb b/lib/rex/proto/dcerpc/client.rb index c46d8fdb62..d72612b287 100644 --- a/lib/rex/proto/dcerpc/client.rb +++ b/lib/rex/proto/dcerpc/client.rb @@ -4,11 +4,7 @@ module Proto module DCERPC class Client -require 'rex/proto/dcerpc/uuid' -require 'rex/proto/dcerpc/response' -require 'rex/proto/dcerpc/exceptions' require 'rex/text' -require 'rex/proto/smb/exceptions' attr_accessor :handle, :socket, :options, :last_response, :context, :no_bind, :ispipe, :smb @@ -111,8 +107,7 @@ require 'rex/proto/smb/exceptions' end def smb_connect() - require 'rex/proto/smb/simpleclient' - + if(not self.smb) if self.socket.peerport == 139 smb = Rex::Proto::SMB::SimpleClient.new(self.socket) @@ -199,7 +194,6 @@ require 'rex/proto/smb/exceptions' end def bind() - require 'rex/proto/dcerpc/packet' bind = '' context = '' if self.options['fake_multi_bind'] diff --git a/lib/rex/proto/dcerpc/handle.rb b/lib/rex/proto/dcerpc/handle.rb index a794dc6430..ee03896408 100644 --- a/lib/rex/proto/dcerpc/handle.rb +++ b/lib/rex/proto/dcerpc/handle.rb @@ -4,7 +4,6 @@ module Proto module DCERPC class Handle - require 'rex/proto/dcerpc/uuid' @@protocols = ['ncacn_ip_tcp', 'ncacn_ip_udp', 'ncacn_np', 'ncacn_http'] attr_accessor :uuid, :protocol, :address, :options diff --git a/lib/rex/proto/dcerpc/packet.rb b/lib/rex/proto/dcerpc/packet.rb index b60e8998da..cdefcb026e 100644 --- a/lib/rex/proto/dcerpc/packet.rb +++ b/lib/rex/proto/dcerpc/packet.rb @@ -4,8 +4,6 @@ module Proto module DCERPC class Packet -require 'rex/proto/dcerpc/uuid' -require 'rex/proto/dcerpc/response' require 'rex/text' UUID = Rex::Proto::DCERPC::UUID diff --git a/lib/rex/proto/dcerpc/response.rb b/lib/rex/proto/dcerpc/response.rb index 6859b71688..d0bd19423b 100644 --- a/lib/rex/proto/dcerpc/response.rb +++ b/lib/rex/proto/dcerpc/response.rb @@ -1,6 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/dcerpc/uuid' -require 'rex/proto/dcerpc/exceptions' module Rex module Proto diff --git a/lib/rex/proto/dcerpc/svcctl.rb b/lib/rex/proto/dcerpc/svcctl.rb deleted file mode 100644 index 9896c8b8de..0000000000 --- a/lib/rex/proto/dcerpc/svcctl.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/dcerpc/svcctl/packet' diff --git a/lib/rex/proto/dcerpc/svcctl/packet.rb b/lib/rex/proto/dcerpc/svcctl/client.rb similarity index 100% rename from lib/rex/proto/dcerpc/svcctl/packet.rb rename to lib/rex/proto/dcerpc/svcctl/client.rb diff --git a/lib/rex/proto/dcerpc/wdscp.rb b/lib/rex/proto/dcerpc/wdscp.rb deleted file mode 100644 index 519f2ffb90..0000000000 --- a/lib/rex/proto/dcerpc/wdscp.rb +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/dcerpc/wdscp/constants' -require 'rex/proto/dcerpc/wdscp/packet' diff --git a/lib/rex/proto/dhcp.rb b/lib/rex/proto/dhcp.rb deleted file mode 100644 index d28ae0bf8b..0000000000 --- a/lib/rex/proto/dhcp.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: binary -*- -# -# DHCP Server support written by scriptjunkie -# - -require 'rex/proto/dhcp/constants' -require 'rex/proto/dhcp/server' diff --git a/lib/rex/proto/dhcp/constants.rb b/lib/rex/proto/dhcp/constants.rb index 490009a57b..af1951c9d3 100644 --- a/lib/rex/proto/dhcp/constants.rb +++ b/lib/rex/proto/dhcp/constants.rb @@ -1,9 +1,8 @@ # -*- coding: binary -*- -require 'rex/proto/dhcp' module Rex module Proto -module DHCP +module DHCP::Constants Request = 1 Response = 2 diff --git a/lib/rex/proto/dhcp/server.rb b/lib/rex/proto/dhcp/server.rb index b3cfc2db2a..0d8df85dcc 100644 --- a/lib/rex/proto/dhcp/server.rb +++ b/lib/rex/proto/dhcp/server.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/dhcp' module Rex module Proto @@ -196,7 +195,7 @@ protected # Dispatch a packet that we received def dispatch_request(from, buf) type = buf.unpack('C').first - if (type != Request) + if (type != Constants::Request) #dlog("Unknown DHCP request type: #{type}") return end @@ -217,7 +216,7 @@ protected _filename = buf[108..235] magic = buf[236..239] - if (magic != DHCPMagic) + if (magic != Constants::DHCPMagic) #dlog("Invalid DHCP request - bad magic.") return end @@ -245,7 +244,7 @@ protected return if pxeclient == false and self.serveOnlyPXE == true # prepare response - pkt = [Response].pack('C') + pkt = [Constants::Response].pack('C') pkt << buf[1..7] #hwtype, hwlen, hops, txid pkt << "\x00\x00\x00\x00" #elapsed, flags pkt << clientip @@ -258,7 +257,7 @@ protected if self.current_ip > self.end_ip self.current_ip = self.start_ip end - self.served.merge!( buf[28..43] => [ self.current_ip, messageType == DHCPRequest ] ) + self.served.merge!( buf[28..43] => [ self.current_ip, messageType == Constants::DHCPRequest ] ) pkt << Rex::Socket.addr_iton(self.current_ip) end pkt << self.ipstring #next server ip @@ -269,8 +268,8 @@ protected pkt << magic pkt << "\x35\x01" #Option - if messageType == DHCPDiscover #DHCP Discover - send DHCP Offer - pkt << [DHCPOffer].pack('C') + if messageType == Constants::DHCPDiscover #DHCP Discover - send DHCP Offer + pkt << [Constants::DHCPOffer].pack('C') # check if already served an Ack based on hw addr (MAC address) # if serveOnce & PXE, don't reply to another PXE request # if serveOnce & ! PXE, don't reply to anything @@ -278,8 +277,8 @@ protected self.served[buf[28..43]][1] and (pxeclient == false or self.servePXE == false) return end - elsif messageType == DHCPRequest #DHCP Request - send DHCP ACK - pkt << [DHCPAck].pack('C') + elsif messageType == Constants::DHCPRequest #DHCP Request - send DHCP ACK + pkt << [Constants::DHCPAck].pack('C') # now we ignore their discovers (but we'll respond to requests in case a packet was lost) if ( self.served_over != 0 ) # NOTE: this is sufficient for low-traffic net @@ -292,45 +291,45 @@ protected end # Options! - pkt << dhcpoption(OpProxyAutodiscovery, self.proxy_auto_discovery) if self.proxy_auto_discovery - pkt << dhcpoption(OpDHCPServer, self.ipstring) - pkt << dhcpoption(OpLeaseTime, [self.leasetime].pack('N')) - pkt << dhcpoption(OpSubnetMask, self.netmaskn) - pkt << dhcpoption(OpRouter, self.router) - pkt << dhcpoption(OpDns, self.dnsserv) - pkt << dhcpoption(OpDomainName, self.domain_name) if self.domain_name + pkt << dhcpoption(Constants::OpProxyAutodiscovery, self.proxy_auto_discovery) if self.proxy_auto_discovery + pkt << dhcpoption(Constants::OpDHCPServer, self.ipstring) + pkt << dhcpoption(Constants::OpLeaseTime, [self.leasetime].pack('N')) + pkt << dhcpoption(Constants::OpSubnetMask, self.netmaskn) + pkt << dhcpoption(Constants::OpRouter, self.router) + pkt << dhcpoption(Constants::OpDns, self.dnsserv) + pkt << dhcpoption(Constants::OpDomainName, self.domain_name) if self.domain_name if self.servePXE # PXE options - pkt << dhcpoption(OpPXEMagic, PXEMagic) + pkt << dhcpoption(Constants::OpPXEMagic, Constants::PXEMagic) # We already got this one, serve localboot file if self.serveOnce == true and self.served.has_key?(buf[28..43]) and self.served[buf[28..43]][1] and pxeclient == true - pkt << dhcpoption(OpPXEConfigFile, self.pxealtconfigfile) + pkt << dhcpoption(Constants::OpPXEConfigFile, self.pxealtconfigfile) else # We are handing out an IP and our PXE attack if(self.reporter) self.reporter.call(buf[28..43],self.ipstring) end - pkt << dhcpoption(OpPXEConfigFile, self.pxeconfigfile) + pkt << dhcpoption(Constants::OpPXEConfigFile, self.pxeconfigfile) end - pkt << dhcpoption(OpPXEPathPrefix, self.pxepathprefix) - pkt << dhcpoption(OpPXERebootTime, [self.pxereboottime].pack('N')) + pkt << dhcpoption(Constants::OpPXEPathPrefix, self.pxepathprefix) + pkt << dhcpoption(Constants::OpPXERebootTime, [self.pxereboottime].pack('N')) if ( self.give_hostname == true ) send_hostname = self.served_hostname if ( self.served_over != 0 ) # NOTE : see above comments for the 'uniqueness' of this value send_hostname += self.served_over.to_s end - pkt << dhcpoption(OpHostname, send_hostname) + pkt << dhcpoption(Constants::OpHostname, send_hostname) end end - pkt << dhcpoption(OpURL, self.url) if self.url - pkt << dhcpoption(OpEnd) + pkt << dhcpoption(Constants::OpURL, self.url) if self.url + pkt << dhcpoption(Constants::OpEnd) pkt << ("\x00" * 32) #padding # And now we mark as requested - self.served[buf[28..43]][1] = true if messageType == DHCPRequest + self.served[buf[28..43]][1] = true if messageType == Constants::DHCPRequest send_packet(nil, pkt) end diff --git a/lib/rex/proto/dns.rb b/lib/rex/proto/dns.rb index 976bcd8e31..79c41e1bfe 100644 --- a/lib/rex/proto/dns.rb +++ b/lib/rex/proto/dns.rb @@ -12,6 +12,3 @@ end end end -require 'rex/proto/dns/packet' -require 'rex/proto/dns/resolver' -require 'rex/proto/dns/server' diff --git a/lib/rex/proto/dns/server.rb b/lib/rex/proto/dns/server.rb index 751fb9cfbe..ae17fab9f1 100644 --- a/lib/rex/proto/dns/server.rb +++ b/lib/rex/proto/dns/server.rb @@ -1,8 +1,6 @@ # -*- coding: binary -*- -require 'rex/io/gram_server' require 'rex/socket' -require 'rex/proto/dns' module Rex module Proto diff --git a/lib/rex/proto/drda.rb b/lib/rex/proto/drda.rb index 751b83a4d4..c0a169d814 100644 --- a/lib/rex/proto/drda.rb +++ b/lib/rex/proto/drda.rb @@ -1,6 +1,3 @@ -# -*- coding: binary -*- -require 'rex/proto/drda/constants' -require 'rex/proto/drda/packet' -require 'rex/proto/drda/utils' - - +module Rex::Proto::DRDA + include Rex::Proto::DRDA::Packet +end diff --git a/lib/rex/proto/drda/constants.rb b/lib/rex/proto/drda/constants.rb index 658eff7099..cc991eba8b 100644 --- a/lib/rex/proto/drda/constants.rb +++ b/lib/rex/proto/drda/constants.rb @@ -1,5 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/drda' + module Rex module Proto diff --git a/lib/rex/proto/drda/packet.rb b/lib/rex/proto/drda/packet.rb index a265c0de32..823f5b03e2 100644 --- a/lib/rex/proto/drda/packet.rb +++ b/lib/rex/proto/drda/packet.rb @@ -1,9 +1,9 @@ # -*- coding: binary -*- -require 'rex/proto/drda' + module Rex module Proto -module DRDA +module DRDA::Packet class Error < StandardError; end class RespError < Error; end diff --git a/lib/rex/proto/drda/utils.rb b/lib/rex/proto/drda/utils.rb index fbf3640c77..1f1fc0f0b9 100644 --- a/lib/rex/proto/drda/utils.rb +++ b/lib/rex/proto/drda/utils.rb @@ -1,5 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/drda' + module Rex module Proto diff --git a/lib/rex/proto/ftp.rb b/lib/rex/proto/ftp.rb deleted file mode 100644 index 3829328cc5..0000000000 --- a/lib/rex/proto/ftp.rb +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: binary -*- -# Adds support for the FTP protocol - -require 'rex/proto/ftp/client' diff --git a/lib/rex/proto/http.rb b/lib/rex/proto/http.rb deleted file mode 100644 index 85a4f31e3c..0000000000 --- a/lib/rex/proto/http.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/http/packet' -require 'rex/proto/http/request' -require 'rex/proto/http/response' -require 'rex/proto/http/client' -require 'rex/proto/http/server' -require 'rex/proto/http/client_request' \ No newline at end of file diff --git a/lib/rex/proto/http/client.rb b/lib/rex/proto/http/client.rb index 105b66ef03..69cbaf3f06 100644 --- a/lib/rex/proto/http/client.rb +++ b/lib/rex/proto/http/client.rb @@ -1,10 +1,9 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/http' + require 'rex/text' require 'digest' -require 'rex/proto/http/client_request' module Rex module Proto diff --git a/lib/rex/proto/http/client_request.rb b/lib/rex/proto/http/client_request.rb index f0411ed632..4722352e51 100644 --- a/lib/rex/proto/http/client_request.rb +++ b/lib/rex/proto/http/client_request.rb @@ -1,6 +1,6 @@ # -*- coding: binary -*- require 'uri' -#require 'rex/proto/http' + require 'rex/socket' require 'rex/text' diff --git a/lib/rex/proto/http/handler.rb b/lib/rex/proto/http/handler.rb index e7b2368a58..612ee89c22 100644 --- a/lib/rex/proto/http/handler.rb +++ b/lib/rex/proto/http/handler.rb @@ -10,8 +10,6 @@ module Http ### class Handler - require 'rex/proto/http/handler/erb' - require 'rex/proto/http/handler/proc' # # Initializes the handler instance as being associated with the supplied diff --git a/lib/rex/proto/http/packet.rb b/lib/rex/proto/http/packet.rb index 02698dbccc..749a1a12ff 100644 --- a/lib/rex/proto/http/packet.rb +++ b/lib/rex/proto/http/packet.rb @@ -1,5 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/http' + module Rex module Proto @@ -32,7 +32,6 @@ class Packet Completed = 3 end - require 'rex/proto/http/packet/header' # # Initializes an instance of an HTTP packet. diff --git a/lib/rex/proto/http/packet/header.rb b/lib/rex/proto/http/packet/header.rb index fd28635e06..1aa9fdcfbe 100644 --- a/lib/rex/proto/http/packet/header.rb +++ b/lib/rex/proto/http/packet/header.rb @@ -1,5 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/http' + module Rex module Proto diff --git a/lib/rex/proto/http/request.rb b/lib/rex/proto/http/request.rb index f8c55a2849..fbbd7979f4 100644 --- a/lib/rex/proto/http/request.rb +++ b/lib/rex/proto/http/request.rb @@ -1,6 +1,6 @@ # -*- coding: binary -*- require 'uri' -require 'rex/proto/http' + module Rex module Proto diff --git a/lib/rex/proto/http/response.rb b/lib/rex/proto/http/response.rb index 16fc8fd44a..45016fc9d4 100644 --- a/lib/rex/proto/http/response.rb +++ b/lib/rex/proto/http/response.rb @@ -1,7 +1,7 @@ # -*- coding: binary -*- require 'cgi' require 'uri' -require 'rex/proto/http' + require 'nokogiri' require 'rkelly' diff --git a/lib/rex/proto/http/server.rb b/lib/rex/proto/http/server.rb index 0b08f2855d..ea9b4798d6 100644 --- a/lib/rex/proto/http/server.rb +++ b/lib/rex/proto/http/server.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/http' -require 'rex/proto/http/handler' + module Rex module Proto diff --git a/lib/rex/proto/iax2.rb b/lib/rex/proto/iax2.rb deleted file mode 100644 index 47f3cd7f6f..0000000000 --- a/lib/rex/proto/iax2.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/iax2/client' diff --git a/lib/rex/proto/iax2/call.rb b/lib/rex/proto/iax2/call.rb index e03f1b5fd6..8d02bfb5de 100644 --- a/lib/rex/proto/iax2/call.rb +++ b/lib/rex/proto/iax2/call.rb @@ -45,7 +45,7 @@ class Call def wait_for(*stypes) begin - ::Timeout.timeout( IAX_DEFAULT_TIMEOUT ) do + ::Timeout.timeout( Constants::IAX_DEFAULT_TIMEOUT ) do while (res = self.queue.pop ) if stypes.include?(res[1]) return res @@ -60,11 +60,11 @@ class Call # Register with the IAX endpoint def register self.client.send_regreq(self) - res = wait_for( IAX_SUBTYPE_REGAUTH, IAX_SUBTYPE_REGREJ ) + res = wait_for( Constants::IAX_SUBTYPE_REGAUTH, Constants::IAX_SUBTYPE_REGREJ ) return if not res - if res[1] == IAX_SUBTYPE_REGREJ - reason = res[2][IAX_IE_REGREJ_CAUSE] || "Unknown Reason" + if res[1] == Constants::IAX_SUBTYPE_REGREJ + reason = res[2][Constants::IAX_IE_REGREJ_CAUSE] || "Unknown Reason" dprint("REGREJ: #{reason}") # Acknowledge the REGREJ self.client.send_ack(self) @@ -79,9 +79,9 @@ class Call return end - if res[2][IAX_IE_CHALLENGE_DATA] + if res[2][Constants::IAX_IE_CHALLENGE_DATA] self.dcall = res[0][0] - chall = res[2][IAX_IE_CHALLENGE_DATA] + chall = res[2][Constants::IAX_IE_CHALLENGE_DATA] end if chall.nil? @@ -90,17 +90,17 @@ class Call end self.client.send_regreq_chall_response(self, chall) - res = wait_for( IAX_SUBTYPE_REGACK, IAX_SUBTYPE_REGREJ ) + res = wait_for( Constants::IAX_SUBTYPE_REGACK, Constants::IAX_SUBTYPE_REGREJ ) return if not res - if res[1] == IAX_SUBTYPE_REGREJ - reason = res[2][IAX_IE_REGREJ_CAUSE] || "Unknown Reason" + if res[1] == Constants::IAX_SUBTYPE_REGREJ + reason = res[2][Constants::IAX_IE_REGREJ_CAUSE] || "Unknown Reason" dprint("REGREJ: #{reason}") return end - if res[2][IAX_IE_APPARENT_ADDR] - r_fam, r_port, r_addr = res[2][IAX_IE_APPARENT_ADDR].unpack('nnA4') + if res[2][Constants::IAX_IE_APPARENT_ADDR] + r_fam, r_port, r_addr = res[2][Constants::IAX_IE_APPARENT_ADDR].unpack('nnA4') r_addr = r_addr.unpack("C*").map{|x| x.to_s }.join(".") dprint("REGACK: Registered from address #{r_addr}:#{r_port}") end @@ -115,11 +115,11 @@ class Call def dial(number) self.client.send_new(self, number) - res = wait_for(IAX_SUBTYPE_AUTHREQ, IAX_SUBTYPE_ACCEPT) + res = wait_for(Constants::IAX_SUBTYPE_AUTHREQ, Constants::IAX_SUBTYPE_ACCEPT) return if not res # Handle authentication if its requested - if res[1] == IAX_SUBTYPE_AUTHREQ + if res[1] == Constants::IAX_SUBTYPE_AUTHREQ chall = nil # Look for IAX_AUTH_MD5 (2) as an available auth method @@ -128,9 +128,9 @@ class Call return end - if res[2][IAX_IE_CHALLENGE_DATA] + if res[2][Constants::IAX_IE_CHALLENGE_DATA] self.dcall = res[0][0] - chall = res[2][IAX_IE_CHALLENGE_DATA] + chall = res[2][Constants::IAX_IE_CHALLENGE_DATA] end if chall.nil? @@ -139,11 +139,11 @@ class Call end self.client.send_authrep_chall_response(self, chall) - res = wait_for( IAX_SUBTYPE_ACCEPT) + res = wait_for( Constants::IAX_SUBTYPE_ACCEPT) return if not res end - self.codec = res[2][IAX_IE_DESIRED_CODEC].unpack("N")[0] + self.codec = res[2][Constants::IAX_IE_DESIRED_CODEC].unpack("N")[0] self.state = :ringing self.ring_start = ::Time.now.to_i self.client.send_ack(self) @@ -188,7 +188,7 @@ class Call info = nil stype = pkt[11,1].unpack("C")[0] - info = process_elements(pkt, 12) if [IAX_TYPE_IAX, IAX_TYPE_CONTROL].include?(itype) + info = process_elements(pkt, 12) if [Constants::IAX_TYPE_IAX, Constants::IAX_TYPE_CONTROL].include?(itype) if dst_call != self.scall dprint("Incoming packet to inactive call: #{dst_call} vs #{self.scall}: #{phdr.inspect} #{stype.inspect} #{info.inspect}") @@ -208,31 +208,31 @@ class Call # NEW, HANGUP, REJECT, ACCEPT, PONG, AUTHREP, REGREL, REGACK, REGREJ, TXREL case itype - when IAX_TYPE_DTMF_BEGIN + when Constants::IAX_TYPE_DTMF_BEGIN self.dprint("DTMF BEG: #{pkt[11,1]}") self.dtmf << pkt[11,1] - when IAX_TYPE_DTMF_END + when Constants::IAX_TYPE_DTMF_END self.dprint("DTMF END: #{pkt[11,1]}") - when IAX_TYPE_CONTROL + when Constants::IAX_TYPE_CONTROL case stype - when IAX_CTRL_HANGUP + when Constants::IAX_CTRL_HANGUP dprint("HANGUP") self.client.send_ack(self) self.state = :hangup - when IAX_CTRL_RINGING + when Constants::IAX_CTRL_RINGING dprint("RINGING") self.client.send_ack(self) - when IAX_CTRL_BUSY + when Constants::IAX_CTRL_BUSY dprint("BUSY") self.busy = true self.state = :hangup self.client.send_ack(self) - when IAX_CTRL_ANSWER + when Constants::IAX_CTRL_ANSWER dprint("ANSWER") if self.state == :ringing self.state = :answered @@ -240,10 +240,10 @@ class Call end self.client.send_ack(self) - when IAX_CTRL_PROGRESS + when Constants::IAX_CTRL_PROGRESS dprint("PROGRESS") - when IAX_CTRL_PROCEED + when Constants::IAX_CTRL_PROCEED dprint("PROCEED") when 255 @@ -252,29 +252,29 @@ class Call # Acknowledge all control packets # self.client.send_ack(self) - when IAX_TYPE_IAX + when Constants::IAX_TYPE_IAX dprint( ["RECV", phdr, stype, info].inspect ) case stype - when IAX_SUBTYPE_HANGUP + when Constants::IAX_SUBTYPE_HANGUP self.state = :hangup self.client.send_ack(self) - when IAX_SUBTYPE_LAGRQ + when Constants::IAX_SUBTYPE_LAGRQ # Lagrps echo the timestamp self.client.send_lagrp(self, tstamp) - when IAX_SUBTYPE_ACK + when Constants::IAX_SUBTYPE_ACK # Nothing to do here - when IAX_SUBTYPE_PING + when Constants::IAX_SUBTYPE_PING # Pongs echo the timestamp self.client.send_pong(self, tstamp) - when IAX_SUBTYPE_PONG + when Constants::IAX_SUBTYPE_PONG self.client.send_ack(self) else dprint( ["RECV-QUEUE", phdr, stype, info].inspect ) self.queue.push( [phdr, stype, info ] ) end - when IAX_TYPE_VOICE + when Constants::IAX_TYPE_VOICE v_codec = stype if self.state == :answered handle_audio(pkt) @@ -317,15 +317,15 @@ class Call case self.codec # Convert u-law into signed PCM - when IAX_CODEC_G711_MULAW + when Constants::IAX_CODEC_G711_MULAW Rex::Proto::IAX2::Codecs::MuLaw.decode(buff) # Convert a-law into signed PCM - when IAX_CODEC_G711_ALAW + when Constants::IAX_CODEC_G711_ALAW Rex::Proto::IAX2::Codecs::ALaw.decode(buff) # Linear little-endian signed PCM is our native format - when IAX_CODEC_LINEAR_PCM + when Constants::IAX_CODEC_LINEAR_PCM buff # Unsupported codec, return empty diff --git a/lib/rex/proto/iax2/client.rb b/lib/rex/proto/iax2/client.rb index 444f181786..a8ce7f767c 100644 --- a/lib/rex/proto/iax2/client.rb +++ b/lib/rex/proto/iax2/client.rb @@ -1,7 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/iax2/constants' -require 'rex/proto/iax2/codecs' -require 'rex/proto/iax2/call' require 'rex/socket' require 'thread' @@ -129,72 +126,72 @@ class Client end def send_ack(call) - data = [ IAX_SUBTYPE_ACK ].pack('C') - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ), false ) + data = [ Constants::IAX_SUBTYPE_ACK ].pack('C') + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ), false ) end def send_pong(call, stamp) - data = [ IAX_SUBTYPE_PONG ].pack('C') - send_data( call, create_pkt( call.scall, call.dcall, stamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + data = [ Constants::IAX_SUBTYPE_PONG ].pack('C') + send_data( call, create_pkt( call.scall, call.dcall, stamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_lagrp(call, stamp) - data = [ IAX_SUBTYPE_LAGRP ].pack('C') - send_data( call, create_pkt( call.scall, call.dcall, stamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + data = [ Constants::IAX_SUBTYPE_LAGRP ].pack('C') + send_data( call, create_pkt( call.scall, call.dcall, stamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_invalid(call) - data = [ IAX_SUBTYPE_INVAL ].pack('C') - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + data = [ Constants::IAX_SUBTYPE_INVAL ].pack('C') + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_hangup(call) - data = [ IAX_SUBTYPE_HANGUP ].pack('C') - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + data = [ Constants::IAX_SUBTYPE_HANGUP ].pack('C') + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_new(call, number) - data = [ IAX_SUBTYPE_NEW ].pack('C') + data = [ Constants::IAX_SUBTYPE_NEW ].pack('C') cid = call.caller_number || self.caller_number cid = number if cid == 'SELF' - data << create_ie(IAX_IE_CALLING_NUMBER, cid ) - data << create_ie(IAX_IE_CALLING_NAME, call.caller_name || self.caller_name) - data << create_ie(IAX_IE_DESIRED_CODEC, [IAX_SUPPORTED_CODECS].pack("N") ) - data << create_ie(IAX_IE_ACTUAL_CODECS, [IAX_SUPPORTED_CODECS].pack("N") ) - data << create_ie(IAX_IE_USERNAME, self.username) if self.username - data << create_ie(IAX_IE_CALLED_NUMBER, number) - data << create_ie(IAX_IE_ORIGINAL_DID, number) + data << create_ie(Constants::IAX_IE_CALLING_NUMBER, cid ) + data << create_ie(Constants::IAX_IE_CALLING_NAME, call.caller_name || self.caller_name) + data << create_ie(Constants::IAX_IE_DESIRED_CODEC, [Constants::IAX_SUPPORTED_CODECS].pack("N") ) + data << create_ie(Constants::IAX_IE_ACTUAL_CODECS, [Constants::IAX_SUPPORTED_CODECS].pack("N") ) + data << create_ie(Constants::IAX_IE_USERNAME, self.username) if self.username + data << create_ie(Constants::IAX_IE_CALLED_NUMBER, number) + data << create_ie(Constants::IAX_IE_ORIGINAL_DID, number) - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_authrep_chall_response(call, chall) data = - [ IAX_SUBTYPE_AUTHREP ].pack('C') + - create_ie(IAX_IE_CHALLENGE_RESP, ::Digest::MD5.hexdigest( chall + self.password )) + [ Constants::IAX_SUBTYPE_AUTHREP ].pack('C') + + create_ie(Constants::IAX_IE_CHALLENGE_RESP, ::Digest::MD5.hexdigest( chall + self.password )) - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_regreq(call) - data = [ IAX_SUBTYPE_REGREQ ].pack('C') - data << create_ie(IAX_IE_USERNAME, self.username) if self.username - data << create_ie(IAX_IE_REG_REFRESH, [IAX_DEFAULT_REG_REFRESH].pack('n')) + data = [ Constants::IAX_SUBTYPE_REGREQ ].pack('C') + data << create_ie(Constants::IAX_IE_USERNAME, self.username) if self.username + data << create_ie(Constants::IAX_IE_REG_REFRESH, [Constants::IAX_DEFAULT_REG_REFRESH].pack('n')) - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def send_regreq_chall_response(call, chall) data = - [ IAX_SUBTYPE_REGREQ ].pack('C') + - create_ie(IAX_IE_USERNAME, self.username) + - create_ie(IAX_IE_CHALLENGE_RESP, ::Digest::MD5.hexdigest( chall + self.password )) + - create_ie(IAX_IE_REG_REFRESH, [IAX_DEFAULT_REG_REFRESH].pack('n')) + [ Constants::IAX_SUBTYPE_REGREQ ].pack('C') + + create_ie(Constants::IAX_IE_USERNAME, self.username) + + create_ie(Constants::IAX_IE_CHALLENGE_RESP, ::Digest::MD5.hexdigest( chall + self.password )) + + create_ie(Constants::IAX_IE_REG_REFRESH, [Constants::IAX_DEFAULT_REG_REFRESH].pack('n')) - send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, IAX_TYPE_IAX, data ) ) + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.oseq, call.iseq, Constants::IAX_TYPE_IAX, data ) ) end def create_ie(ie_type, ie_data) diff --git a/lib/rex/proto/iax2/codecs.rb b/lib/rex/proto/iax2/codecs.rb deleted file mode 100644 index dbafe4a482..0000000000 --- a/lib/rex/proto/iax2/codecs.rb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/iax2/codecs/g711' -require 'rex/proto/iax2/codecs/mulaw' -require 'rex/proto/iax2/codecs/alaw' - diff --git a/lib/rex/proto/iax2/codecs/alaw.rb b/lib/rex/proto/iax2/codecs/a_law.rb similarity index 100% rename from lib/rex/proto/iax2/codecs/alaw.rb rename to lib/rex/proto/iax2/codecs/a_law.rb diff --git a/lib/rex/proto/iax2/codecs/mulaw.rb b/lib/rex/proto/iax2/codecs/mu_law.rb similarity index 100% rename from lib/rex/proto/iax2/codecs/mulaw.rb rename to lib/rex/proto/iax2/codecs/mu_law.rb diff --git a/lib/rex/proto/iax2/constants.rb b/lib/rex/proto/iax2/constants.rb index bc12c8608d..2175dca6dd 100644 --- a/lib/rex/proto/iax2/constants.rb +++ b/lib/rex/proto/iax2/constants.rb @@ -2,6 +2,7 @@ module Rex module Proto module IAX2 +module Constants IAX2_DEFAULT_PORT = 4569 @@ -260,3 +261,4 @@ IAX_DEFAULT_TIMEOUT = 10 end end end +end diff --git a/lib/rex/proto/ipmi.rb b/lib/rex/proto/ipmi.rb index 9e208ff8c6..efdae81890 100644 --- a/lib/rex/proto/ipmi.rb +++ b/lib/rex/proto/ipmi.rb @@ -1,14 +1,10 @@ # -*- coding: binary -*- -require 'rex/proto/ipmi/utils' module Rex module Proto module IPMI - require 'rex/proto/ipmi/channel_auth_reply' - require 'rex/proto/ipmi/open_session_reply' - require 'rex/proto/ipmi/rakp2' - + # # Move these into an IPMI stack or mixin at some point # diff --git a/lib/rex/proto/kademlia.rb b/lib/rex/proto/kademlia.rb index 03dd4b3e12..9f466e8dc1 100644 --- a/lib/rex/proto/kademlia.rb +++ b/lib/rex/proto/kademlia.rb @@ -1,8 +1,12 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia/bootstrap_request' -require 'rex/proto/kademlia/bootstrap_response' -require 'rex/proto/kademlia/message' -require 'rex/proto/kademlia/ping' -require 'rex/proto/kademlia/pong' -require 'rex/proto/kademlia/util' +module Rex::Proto::Kademlia + # Decodes an on-the-wire representation of a Kademlia peer to its 16-character hex equivalent + # + # @deprecated Access via Rex::Proto::Kademlia::Util + # @param bytes [String] the on-the-wire representation of a Kademlia peer + # @return [String] the peer ID if valid, nil otherwise + def self.decode_peer_id(bytes) + Util.decode_peer_id(bytes) + end +end diff --git a/lib/rex/proto/kademlia/bootstrap_request.rb b/lib/rex/proto/kademlia/bootstrap_request.rb index 7641285aa1..e4531d8d63 100644 --- a/lib/rex/proto/kademlia/bootstrap_request.rb +++ b/lib/rex/proto/kademlia/bootstrap_request.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia/message' module Rex module Proto diff --git a/lib/rex/proto/kademlia/bootstrap_response.rb b/lib/rex/proto/kademlia/bootstrap_response.rb index f9e0b7bece..1a2549d0d7 100644 --- a/lib/rex/proto/kademlia/bootstrap_response.rb +++ b/lib/rex/proto/kademlia/bootstrap_response.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia/message' -require 'rex/proto/kademlia/util' module Rex module Proto diff --git a/lib/rex/proto/kademlia/ping.rb b/lib/rex/proto/kademlia/ping.rb index 95273b45e6..1882fcd6f6 100644 --- a/lib/rex/proto/kademlia/ping.rb +++ b/lib/rex/proto/kademlia/ping.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia/message' module Rex module Proto diff --git a/lib/rex/proto/kademlia/pong.rb b/lib/rex/proto/kademlia/pong.rb index d3ce9a1c76..477b169055 100644 --- a/lib/rex/proto/kademlia/pong.rb +++ b/lib/rex/proto/kademlia/pong.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/kademlia/message' module Rex module Proto diff --git a/lib/rex/proto/kademlia/util.rb b/lib/rex/proto/kademlia/util.rb index 0920752cfa..0367d41158 100644 --- a/lib/rex/proto/kademlia/util.rb +++ b/lib/rex/proto/kademlia/util.rb @@ -2,7 +2,7 @@ module Rex module Proto -module Kademlia +module Kademlia::Util # Decodes an on-the-wire representation of a Kademlia peer to its 16-character hex equivalent # # @param bytes [String] the on-the-wire representation of a Kademlia peer diff --git a/lib/rex/proto/kerberos.rb b/lib/rex/proto/kerberos.rb deleted file mode 100644 index 22797361b5..0000000000 --- a/lib/rex/proto/kerberos.rb +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: binary -*- - -# Kerberos 5 implementation according to RFC 1510 - -require 'openssl' -require 'rex/socket' -require 'rex/text' -require 'rex/proto/kerberos/crypto' -require 'rex/proto/kerberos/pac' -require 'rex/proto/kerberos/model' -require 'rex/proto/kerberos/client' -require 'rex/proto/kerberos/credential_cache' - diff --git a/lib/rex/proto/kerberos/credential_cache.rb b/lib/rex/proto/kerberos/credential_cache.rb index 14290f324e..6a50484303 100644 --- a/lib/rex/proto/kerberos/credential_cache.rb +++ b/lib/rex/proto/kerberos/credential_cache.rb @@ -11,9 +11,4 @@ module Rex end end -require 'rex/proto/kerberos/credential_cache/element' -require 'rex/proto/kerberos/credential_cache/key_block' -require 'rex/proto/kerberos/credential_cache/principal' -require 'rex/proto/kerberos/credential_cache/time' -require 'rex/proto/kerberos/credential_cache/credential' -require 'rex/proto/kerberos/credential_cache/cache' \ No newline at end of file +require 'rex/proto/kerberos/credential_cache/cache' diff --git a/lib/rex/proto/kerberos/crypto.rb b/lib/rex/proto/kerberos/crypto.rb index f2f3853d66..415f229205 100644 --- a/lib/rex/proto/kerberos/crypto.rb +++ b/lib/rex/proto/kerberos/crypto.rb @@ -1,6 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/kerberos/crypto/rc4_hmac' -require 'rex/proto/kerberos/crypto/rsa_md5' module Rex module Proto @@ -18,4 +16,4 @@ module Rex end end end -end \ No newline at end of file +end diff --git a/lib/rex/proto/kerberos/model.rb b/lib/rex/proto/kerberos/model.rb index f0c2261793..f7cdea70b9 100644 --- a/lib/rex/proto/kerberos/model.rb +++ b/lib/rex/proto/kerberos/model.rb @@ -113,21 +113,3 @@ module Rex end end -require 'rex/proto/kerberos/model/element' -require 'rex/proto/kerberos/model/principal_name' -require 'rex/proto/kerberos/model/encrypted_data' -require 'rex/proto/kerberos/model/checksum' -require 'rex/proto/kerberos/model/pre_auth_pac_request' -require 'rex/proto/kerberos/model/pre_auth_enc_time_stamp' -require 'rex/proto/kerberos/model/pre_auth_data' -require 'rex/proto/kerberos/model/ap_req' -require 'rex/proto/kerberos/model/krb_error' -require 'rex/proto/kerberos/model/authorization_data' -require 'rex/proto/kerberos/model/encryption_key' -require 'rex/proto/kerberos/model/authenticator' -require 'rex/proto/kerberos/model/ticket' -require 'rex/proto/kerberos/model/last_request' -require 'rex/proto/kerberos/model/kdc_request_body' -require 'rex/proto/kerberos/model/kdc_request' -require 'rex/proto/kerberos/model/enc_kdc_response' -require 'rex/proto/kerberos/model/kdc_response' diff --git a/lib/rex/proto/kerberos/pac.rb b/lib/rex/proto/kerberos/pac.rb index 98ad3cffe6..06126f2c94 100644 --- a/lib/rex/proto/kerberos/pac.rb +++ b/lib/rex/proto/kerberos/pac.rb @@ -28,9 +28,3 @@ module Rex end end -require 'rex/proto/kerberos/pac/element' -require 'rex/proto/kerberos/pac/priv_svr_checksum' -require 'rex/proto/kerberos/pac/server_checksum' -require 'rex/proto/kerberos/pac/client_info' -require 'rex/proto/kerberos/pac/logon_info' -require 'rex/proto/kerberos/pac/type' diff --git a/lib/rex/proto/mms.rb b/lib/rex/proto/mms.rb deleted file mode 100644 index c797510d36..0000000000 --- a/lib/rex/proto/mms.rb +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: binary -*- - -require 'rex/proto/mms/exception' -require 'rex/proto/mms/model' diff --git a/lib/rex/proto/mms/model.rb b/lib/rex/proto/mms/model.rb index 6bbd343146..9a0fc6ef4c 100644 --- a/lib/rex/proto/mms/model.rb +++ b/lib/rex/proto/mms/model.rb @@ -19,6 +19,3 @@ module Rex end require 'net/smtp' -require 'rex/proto/mms/model/smtp' -require 'rex/proto/mms/model/message' -require 'rex/proto/mms/client' diff --git a/lib/rex/proto/mms/model/message.rb b/lib/rex/proto/mms/model/message.rb index 2da3aa6f3b..06ab54d544 100644 --- a/lib/rex/proto/mms/model/message.rb +++ b/lib/rex/proto/mms/model/message.rb @@ -1,4 +1,5 @@ # -*- coding: binary -*- +require 'rex/mime/message' module Rex module Proto diff --git a/lib/rex/proto/mqtt.rb b/lib/rex/proto/mqtt.rb index c10e4e88cb..881187d7aa 100644 --- a/lib/rex/proto/mqtt.rb +++ b/lib/rex/proto/mqtt.rb @@ -2,7 +2,6 @@ # # Support for MQTT -require 'rex/proto/mqtt/client' module Rex module Proto diff --git a/lib/rex/proto/natpmp.rb b/lib/rex/proto/natpmp.rb index e4aab9e7cc..6351ebe200 100644 --- a/lib/rex/proto/natpmp.rb +++ b/lib/rex/proto/natpmp.rb @@ -3,5 +3,7 @@ # # @author Jon Hart -require 'rex/proto/natpmp/constants' -require 'rex/proto/natpmp/packet' +module Rex::Proto::NATPMP + include Rex::Proto::NATPMP::Constants + include Rex::Proto::NATPMP::Packet +end diff --git a/lib/rex/proto/natpmp/constants.rb b/lib/rex/proto/natpmp/constants.rb index e2b2ff4bf3..418b18d698 100644 --- a/lib/rex/proto/natpmp/constants.rb +++ b/lib/rex/proto/natpmp/constants.rb @@ -9,7 +9,7 @@ module Rex module Proto -module NATPMP +module NATPMP::Constants DefaultPort = 5351 Version = 0 TCP = 2 diff --git a/lib/rex/proto/natpmp/packet.rb b/lib/rex/proto/natpmp/packet.rb index 228b381c43..85defac6b3 100644 --- a/lib/rex/proto/natpmp/packet.rb +++ b/lib/rex/proto/natpmp/packet.rb @@ -7,7 +7,7 @@ module Rex module Proto -module NATPMP +module NATPMP::Packet # Return a NAT-PMP request to get the external address. def external_address_request diff --git a/lib/rex/proto/ntlm.rb b/lib/rex/proto/ntlm.rb deleted file mode 100644 index 4d4a52d4de..0000000000 --- a/lib/rex/proto/ntlm.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/exceptions' -require 'rex/proto/ntlm/crypt' -require 'rex/proto/ntlm/utils' -require 'rex/proto/ntlm/base' -require 'rex/proto/ntlm/message' - diff --git a/lib/rex/proto/ntlm/base.rb b/lib/rex/proto/ntlm/base.rb index 15ffe5bf1a..05f467de8b 100644 --- a/lib/rex/proto/ntlm/base.rb +++ b/lib/rex/proto/ntlm/base.rb @@ -41,7 +41,6 @@ # The third key has to begin from the 14th character of the # input string instead of 13th:) -require 'rex/proto/ntlm/constants' module Rex module Proto diff --git a/lib/rex/proto/ntlm/crypt.rb b/lib/rex/proto/ntlm/crypt.rb index 9a0e9a1c14..a228a1c9d2 100644 --- a/lib/rex/proto/ntlm/crypt.rb +++ b/lib/rex/proto/ntlm/crypt.rb @@ -44,8 +44,6 @@ # The third key has to begin from the 14th character of the # input string instead of 13th:) -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/base' module Rex module Proto diff --git a/lib/rex/proto/ntlm/message.rb b/lib/rex/proto/ntlm/message.rb index 1aaa43169a..f5c95041ec 100644 --- a/lib/rex/proto/ntlm/message.rb +++ b/lib/rex/proto/ntlm/message.rb @@ -43,9 +43,6 @@ #this module defines the message class , useful for easily handling type 1/2/3 ntlm messages -require 'rex/proto/ntlm/base' -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/crypt' module Rex diff --git a/lib/rex/proto/ntlm/utils.rb b/lib/rex/proto/ntlm/utils.rb index 8c039cc3b9..8992b1728c 100644 --- a/lib/rex/proto/ntlm/utils.rb +++ b/lib/rex/proto/ntlm/utils.rb @@ -1,7 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/crypt' -require 'rex/proto/ntlm/exceptions' module Rex::Proto::NTLM class Utils diff --git a/lib/rex/proto/ntp.rb b/lib/rex/proto/ntp.rb index 56091f7c6a..31976ceff0 100644 --- a/lib/rex/proto/ntp.rb +++ b/lib/rex/proto/ntp.rb @@ -1,3 +1,6 @@ # -*- coding: binary -*- -require 'rex/proto/ntp/constants' -require 'rex/proto/ntp/modes' + +module Rex::Proto::NTP + include Rex::Proto::NTP::Constants + include Rex::Proto::NTP::Modes +end diff --git a/lib/rex/proto/ntp/constants.rb b/lib/rex/proto/ntp/constants.rb index 1d64bdd2af..49762a34c7 100644 --- a/lib/rex/proto/ntp/constants.rb +++ b/lib/rex/proto/ntp/constants.rb @@ -1,7 +1,7 @@ # -*- coding: binary -*- module Rex module Proto -module NTP +module NTP::Constants VERSIONS = (0..7).to_a MODES = (0..7).to_a MODE_6_OPERATIONS = (0..31).to_a diff --git a/lib/rex/proto/ntp/modes.rb b/lib/rex/proto/ntp/modes.rb index 5ac068914b..a1b371b142 100644 --- a/lib/rex/proto/ntp/modes.rb +++ b/lib/rex/proto/ntp/modes.rb @@ -4,7 +4,7 @@ require 'bindata' module Rex module Proto -module NTP +module NTP::Modes # A very generic NTP message # diff --git a/lib/rex/proto/nuuo.rb b/lib/rex/proto/nuuo.rb deleted file mode 100644 index e1633b7f11..0000000000 --- a/lib/rex/proto/nuuo.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: binary -*- - -# NUUO implementation -require 'rex/proto/nuuo/client' -require 'rex/proto/nuuo/client_request' -require 'rex/proto/nuuo/constants' diff --git a/lib/rex/proto/nuuo/client.rb b/lib/rex/proto/nuuo/client.rb index de5c94f4af..8c4f883814 100644 --- a/lib/rex/proto/nuuo/client.rb +++ b/lib/rex/proto/nuuo/client.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/nuuo/client_request' -require 'rex/proto/nuuo/response' require 'rex/socket' module Rex diff --git a/lib/rex/proto/proxy/socks4a.rb b/lib/rex/proto/proxy/socks4a.rb index 0c230e4b3d..0c1d31b4e0 100644 --- a/lib/rex/proto/proxy/socks4a.rb +++ b/lib/rex/proto/proxy/socks4a.rb @@ -3,7 +3,6 @@ # sf - Sept 2010 # require 'thread' -require 'rex/logging' require 'rex/socket' module Rex diff --git a/lib/rex/proto/proxy/socks5.rb b/lib/rex/proto/proxy/socks5.rb deleted file mode 100644 index a4afbce353..0000000000 --- a/lib/rex/proto/proxy/socks5.rb +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: binary -*- -# -# sf - Sept 2010 (original socks4a code) -# zeroSteiner - March 2018 (socks 5 update) -# surefire - May 2018 (socks 5 update) -# -# references: -# - SOCKS Protocol Version 5 -# https://tools.ietf.org/html/rfc1928 -# - Username/Password Authentication for SOCKS V5 -# https://tools.ietf.org/html/rfc1929 - -require 'rex/proto/proxy/socks5/server' diff --git a/lib/rex/proto/proxy/socks5/server.rb b/lib/rex/proto/proxy/socks5/server.rb index ad7c141eeb..49c58d841a 100644 --- a/lib/rex/proto/proxy/socks5/server.rb +++ b/lib/rex/proto/proxy/socks5/server.rb @@ -1,9 +1,7 @@ # -*- coding: binary -*- require 'thread' -require 'rex/logging' require 'rex/socket' -require 'rex/proto/proxy/socks5/server_client' module Rex module Proto diff --git a/lib/rex/proto/proxy/socks5/server_client.rb b/lib/rex/proto/proxy/socks5/server_client.rb index 7e227aa74e..c296e1bca8 100644 --- a/lib/rex/proto/proxy/socks5/server_client.rb +++ b/lib/rex/proto/proxy/socks5/server_client.rb @@ -2,7 +2,6 @@ require 'bindata' require 'rex/socket' -require 'rex/proto/proxy/socks5/packet' module Rex module Proto diff --git a/lib/rex/proto/quake.rb b/lib/rex/proto/quake.rb index 77da275950..e1463cf773 100644 --- a/lib/rex/proto/quake.rb +++ b/lib/rex/proto/quake.rb @@ -1,3 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/quake/message' +module Rex::Proto::Quake + include Rex::Proto::Quake::Message +end diff --git a/lib/rex/proto/quake/message.rb b/lib/rex/proto/quake/message.rb index 9c1920ce23..a51bb46a82 100644 --- a/lib/rex/proto/quake/message.rb +++ b/lib/rex/proto/quake/message.rb @@ -7,7 +7,7 @@ module Proto # Quake 3 protocol, taken from ftp://ftp.idsoftware.com/idstuff/quake3/docs/server.txt # ## -module Quake +module Quake::Message HEADER = 0xFFFFFFFF def decode_message(message) diff --git a/lib/rex/proto/rfb.rb b/lib/rex/proto/rfb.rb index 623f780b29..62bbfbb5c4 100644 --- a/lib/rex/proto/rfb.rb +++ b/lib/rex/proto/rfb.rb @@ -8,6 +8,7 @@ # vnc_auth_none contributed by Matteo Cantoni # vnc_auth_login contributed by carstein -require 'rex/proto/rfb/constants' -require 'rex/proto/rfb/cipher' -require 'rex/proto/rfb/client' + +module Rex::Proto::RFB + include Rex::Proto::RFB::Constants +end diff --git a/lib/rex/proto/rfb/client.rb b/lib/rex/proto/rfb/client.rb index 738e3778f4..621c66fba9 100644 --- a/lib/rex/proto/rfb/client.rb +++ b/lib/rex/proto/rfb/client.rb @@ -18,13 +18,13 @@ module Proto module RFB class Client - + include Rex::Proto::RFB::Constants def initialize(sock, opts = {}) @sock = sock @opts = opts @banner = nil - @majver = MajorVersions + @majver = Constants::MajorVersions @minver = -1 @auth_types = [] end @@ -50,7 +50,7 @@ class Client if @banner =~ /RFB ([0-9]{3})\.([0-9]{3})/ maj = $1.to_i - unless MajorVersions.include?(maj) + unless Constants::MajorVersions.include?(maj) @error = "Invalid major version number: #{maj}" return false end diff --git a/lib/rex/proto/rfb/constants.rb b/lib/rex/proto/rfb/constants.rb index a6cd6cf3ce..67d3431789 100644 --- a/lib/rex/proto/rfb/constants.rb +++ b/lib/rex/proto/rfb/constants.rb @@ -14,7 +14,7 @@ module Rex module Proto -module RFB +module RFB::Constants DefaultPort = 5900 diff --git a/lib/rex/proto/rmi.rb b/lib/rex/proto/rmi.rb deleted file mode 100644 index 465faaff11..0000000000 --- a/lib/rex/proto/rmi.rb +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: binary -*- - -# JAVA RMI Wire protocol implementation -# http://docs.oracle.com/javase/7/docs/platform/rmi/spec/rmi-protocol.html - -require 'rex/proto/rmi/exception' -require 'rex/proto/rmi/decode_error' -require 'rex/proto/rmi/model' - diff --git a/lib/rex/proto/rmi/model.rb b/lib/rex/proto/rmi/model.rb index 4e48f1af44..3d3c94e2c1 100644 --- a/lib/rex/proto/rmi/model.rb +++ b/lib/rex/proto/rmi/model.rb @@ -21,16 +21,3 @@ module Rex end end end - -require 'rex/proto/rmi/model/element' -require 'rex/proto/rmi/model/output_header' -require 'rex/proto/rmi/model/protocol_ack' -require 'rex/proto/rmi/model/continuation' -require 'rex/proto/rmi/model/unique_identifier' -require 'rex/proto/rmi/model/call_data' -require 'rex/proto/rmi/model/call' -require 'rex/proto/rmi/model/return_value' -require 'rex/proto/rmi/model/return_data' -require 'rex/proto/rmi/model/dgc_ack' -require 'rex/proto/rmi/model/ping' -require 'rex/proto/rmi/model/ping_ack' \ No newline at end of file diff --git a/lib/rex/proto/sip.rb b/lib/rex/proto/sip.rb deleted file mode 100644 index 3c0098cb54..0000000000 --- a/lib/rex/proto/sip.rb +++ /dev/null @@ -1,4 +0,0 @@ -# encoding: binary - -# SIP protocol support -require 'rex/proto/sip/response' diff --git a/lib/rex/proto/smb.rb b/lib/rex/proto/smb.rb deleted file mode 100644 index e62785e05f..0000000000 --- a/lib/rex/proto/smb.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/smb/constants' -require 'rex/proto/smb/exceptions' -require 'rex/proto/smb/evasions' -require 'rex/proto/smb/crypt' -require 'rex/proto/smb/utils' -require 'rex/proto/smb/client' -require 'rex/proto/smb/simpleclient' diff --git a/lib/rex/proto/smb/client.rb b/lib/rex/proto/smb/client.rb index 36aedaa8cb..20f5de2324 100644 --- a/lib/rex/proto/smb/client.rb +++ b/lib/rex/proto/smb/client.rb @@ -8,14 +8,6 @@ class Client require 'rex/text' require 'rex/struct2' -require 'rex/proto/smb/constants' -require 'rex/proto/smb/exceptions' -require 'rex/proto/smb/evasions' -require 'rex/proto/smb/utils' -require 'rex/proto/smb/crypt' -require 'rex/proto/ntlm/crypt' -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/utils' # Some short-hand class aliases diff --git a/lib/rex/proto/smb/simpleclient.rb b/lib/rex/proto/smb/simple_client.rb similarity index 96% rename from lib/rex/proto/smb/simpleclient.rb rename to lib/rex/proto/smb/simple_client.rb index dad013416d..bb3a9c80f7 100644 --- a/lib/rex/proto/smb/simpleclient.rb +++ b/lib/rex/proto/smb/simple_client.rb @@ -7,14 +7,6 @@ class SimpleClient require 'rex/text' require 'rex/struct2' -require 'rex/proto/smb/constants' -require 'rex/proto/smb/exceptions' -require 'rex/proto/smb/evasions' -require 'rex/proto/smb/crypt' -require 'rex/proto/smb/utils' -require 'rex/proto/smb/client' -require 'rex/proto/smb/simpleclient/open_file' -require 'rex/proto/smb/simpleclient/open_pipe' require 'ruby_smb' # Some short-hand class aliases diff --git a/lib/rex/proto/smb/simpleclient/open_file.rb b/lib/rex/proto/smb/simple_client/open_file.rb similarity index 100% rename from lib/rex/proto/smb/simpleclient/open_file.rb rename to lib/rex/proto/smb/simple_client/open_file.rb diff --git a/lib/rex/proto/smb/simpleclient/open_pipe.rb b/lib/rex/proto/smb/simple_client/open_pipe.rb similarity index 100% rename from lib/rex/proto/smb/simpleclient/open_pipe.rb rename to lib/rex/proto/smb/simple_client/open_pipe.rb diff --git a/lib/rex/proto/smb/utils.rb b/lib/rex/proto/smb/utils.rb index dc1e46e5f8..f923954a94 100644 --- a/lib/rex/proto/smb/utils.rb +++ b/lib/rex/proto/smb/utils.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex/text' -require 'rex/proto/smb/constants' module Rex module Proto diff --git a/lib/rex/proto/sms.rb b/lib/rex/proto/sms.rb deleted file mode 100644 index bac7a0e9d6..0000000000 --- a/lib/rex/proto/sms.rb +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: binary -*- - -require 'rex/proto/sms/exception' -require 'rex/proto/sms/model' diff --git a/lib/rex/proto/sms/model.rb b/lib/rex/proto/sms/model.rb index d95d50a35e..3225fb7a84 100644 --- a/lib/rex/proto/sms/model.rb +++ b/lib/rex/proto/sms/model.rb @@ -27,6 +27,3 @@ module Rex end require 'net/smtp' -require 'rex/proto/sms/model/smtp' -require 'rex/proto/sms/model/message' -require 'rex/proto/sms/client' diff --git a/lib/rex/proto/sms/model/message.rb b/lib/rex/proto/sms/model/message.rb index 8110c361dc..29b5c6ca33 100644 --- a/lib/rex/proto/sms/model/message.rb +++ b/lib/rex/proto/sms/model/message.rb @@ -1,4 +1,5 @@ # -*- coding: binary -*- +require 'rex/mime/message' module Rex module Proto diff --git a/lib/rex/proto/ssh.rb b/lib/rex/proto/ssh.rb deleted file mode 100644 index 2571be6ff5..0000000000 --- a/lib/rex/proto/ssh.rb +++ /dev/null @@ -1,4 +0,0 @@ -# encoding: binary - -# SSH server support -require 'rex/proto/ssh/server' diff --git a/lib/rex/proto/ssh/server.rb b/lib/rex/proto/ssh/server.rb index 19783fa39a..d6d755d38c 100644 --- a/lib/rex/proto/ssh/server.rb +++ b/lib/rex/proto/ssh/server.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/proto/ssh/connection' module Rex module Proto diff --git a/lib/rex/proto/steam.rb b/lib/rex/proto/steam.rb index 12552c0449..60415a79f3 100644 --- a/lib/rex/proto/steam.rb +++ b/lib/rex/proto/steam.rb @@ -1,3 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/steam/message' +module Rex::Proto::Steam + include Rex::Proto::Steam::Message +end diff --git a/lib/rex/proto/steam/message.rb b/lib/rex/proto/steam/message.rb index d8677c4e66..6b191db871 100644 --- a/lib/rex/proto/steam/message.rb +++ b/lib/rex/proto/steam/message.rb @@ -7,7 +7,7 @@ module Proto # Steam protocol support, taken from https://developer.valvesoftware.com/wiki/Server_queries # ## -module Steam +module Steam::Message # The Steam header ussed when the message is fragmented. FRAGMENTED_HEADER = 0xFFFFFFFE # The Steam header ussed when the message is not fragmented. diff --git a/lib/rex/proto/sunrpc.rb b/lib/rex/proto/sunrpc.rb deleted file mode 100644 index 3475c357f5..0000000000 --- a/lib/rex/proto/sunrpc.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: binary -*- -require 'rex/proto/sunrpc/client' diff --git a/lib/rex/proto/tftp.rb b/lib/rex/proto/tftp.rb deleted file mode 100644 index 22e93f8bf7..0000000000 --- a/lib/rex/proto/tftp.rb +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: binary -*- -# -# TFTP Server implementation according to: -# -# RFC1350, RFC2347, RFC2348, RFC2349 -# -# written by jduck -# thx to scriptjunkie for pointing out option extensions -# - -require 'rex/proto/tftp/constants' -require 'rex/proto/tftp/server' -require 'rex/proto/tftp/client' diff --git a/lib/rex/proto/tftp/client.rb b/lib/rex/proto/tftp/client.rb index 7ad7761adc..227c4f32d9 100644 --- a/lib/rex/proto/tftp/client.rb +++ b/lib/rex/proto/tftp/client.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/tftp' require 'tempfile' module Rex @@ -43,7 +42,7 @@ class Client def parse_tftp_response(str) return nil unless str.length >= 4 ret = str.unpack("nnA*") - ret[2] = str[4,str.size] if ret[0] == OpData + ret[2] = str[4,str.size] if ret[0] == Constants::OpData return ret end @@ -88,20 +87,20 @@ class Client res = self.server_sock.recvfrom(65535) if res and res[0] code, type, data = parse_tftp_response(res[0]) - if code == OpAck and self.action == :upload + if code == Constants::OpAck and self.action == :upload if block_given? yield "WRQ accepted, sending the file." if type == 0 send_data(res[1], res[2]) {|msg| yield msg} else send_data(res[1], res[2]) end - elsif code == OpData and self.action == :download + elsif code == Constants::OpData and self.action == :download if block_given? recv_data(res[1], res[2], data) {|msg| yield msg} else recv_data(res[1], res[2], data) end - elsif code == OpError + elsif code == Constants::OpError yield("Aborting, got error type:%d, message:'%s'" % [type, data]) if block_given? self.status = {:error => [code, type, data]} else @@ -140,13 +139,13 @@ class Client # def rrq_packet - req = [OpRead, self.remote_file, self.mode] + req = [Constants::OpRead, self.remote_file, self.mode] packstr = "na#{self.remote_file.length+1}a#{self.mode.length+1}" req.pack(packstr) end def ack_packet(blocknum=0) - req = [OpAck, blocknum].pack("nn") + req = [Constants::OpAck, blocknum].pack("nn") end def send_read_request(&block) @@ -233,7 +232,7 @@ class Client # def wrq_packet - req = [OpWrite, self.remote_file, self.mode] + req = [Constants::OpWrite, self.remote_file, self.mode] packstr = "na#{self.remote_file.length+1}a#{self.mode.length+1}" req.pack(packstr) end @@ -304,7 +303,7 @@ class Client end data_blocks.each_with_index do |data_block,idx| loop do - req = [OpData, (idx + 1), data_block].pack("nnA*") + req = [Constants::OpData, (idx + 1), data_block].pack("nnA*") if self.server_sock.sendto(req, host, port) <= 0 send_retries += 1 if send_retries > 100 diff --git a/lib/rex/proto/tftp/constants.rb b/lib/rex/proto/tftp/constants.rb index 895f0762b3..f4d4c80fbc 100644 --- a/lib/rex/proto/tftp/constants.rb +++ b/lib/rex/proto/tftp/constants.rb @@ -1,9 +1,8 @@ # -*- coding: binary -*- -require 'rex/proto/tftp' module Rex module Proto -module TFTP +module TFTP::Constants OPCODES = %w{ Unknown RRQ WRQ DATA ACK ERROR } OpRead = 1 diff --git a/lib/rex/proto/tftp/server.rb b/lib/rex/proto/tftp/server.rb index 129be7e3c0..dca24b1ec3 100644 --- a/lib/rex/proto/tftp/server.rb +++ b/lib/rex/proto/tftp/server.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex/socket' -require 'rex/proto/tftp' module Rex module Proto @@ -109,12 +108,12 @@ class Server # Send an error packet w/the specified code and string # def send_error(from, num) - if (num < 1 or num >= ERRCODES.length) + if (num < 1 or num >= Constants::ERRCODES.length) # ignore.. return end - pkt = [OpError, num].pack('nn') - pkt << ERRCODES[num] + pkt = [Constants::OpError, num].pack('nn') + pkt << Constants::ERRCODES[num] pkt << "\x00" send_packet(from, pkt) end @@ -253,7 +252,7 @@ protected self.transfers.each do |tr| # We handle RRQ and WRQ separately # - if (tr[:type] == OpRead) + if (tr[:type] == Constants::OpRead) # Are we awaiting an ack? if (tr[:last_sent]) check_retransmission(tr) @@ -261,7 +260,7 @@ protected # No ack waiting, send next block.. chunk = tr[:file][:data].slice(tr[:offset], tr[:blksize]) if (chunk and chunk.length >= 0) - pkt = [OpData, tr[:block]].pack('nn') + pkt = [Constants::OpData, tr[:block]].pack('nn') pkt << chunk send_packet(tr[:from], pkt) @@ -282,7 +281,7 @@ protected elsif (w != nil and w[0] == self.sock) # Not waiting for data, send an ack.. #puts "[*] sending ack for block %d" % [tr[:block]] - pkt = [OpAck, tr[:block]].pack('nn') + pkt = [Constants::OpAck, tr[:block]].pack('nn') send_packet(tr[:from], pkt) tr[:last_sent] = ::Time.now @@ -319,7 +318,7 @@ protected #start = "[*] TFTP - %s:%u - %s" % [from[0], from[1], OPCODES[op]] case op - when OpRead + when Constants::OpRead # Process RRQ packets fn = TFTP::get_string(buf) mode = TFTP::get_string(buf).downcase @@ -328,10 +327,10 @@ protected if (not @shutting_down) and (file = self.find_file(fn)) if (file[:once] and file[:started]) - send_error(from, ErrFileNotFound) + send_error(from, Constants::ErrFileNotFound) else transfer = { - :type => OpRead, + :type => Constants::OpRead, :from => from, :file => file, :block => 1, @@ -348,10 +347,10 @@ protected end else #puts "[-] file not found!" - send_error(from, ErrFileNotFound) + send_error(from, Constants::ErrFileNotFound) end - when OpWrite + when Constants::OpWrite # Process WRQ packets fn = TFTP::get_string(buf) mode = TFTP::get_string(buf).downcase @@ -360,7 +359,7 @@ protected if not @shutting_down transfer = { - :type => OpWrite, + :type => Constants::OpWrite, :from => from, :file => { :name => fn, :data => '' }, :block => 0, # WRQ starts at 0 @@ -374,23 +373,23 @@ protected self.transfers << transfer else - send_error(from, ErrIllegalOperation) + send_error(from, Constants::ErrIllegalOperation) end - when OpAck + when Constants::OpAck # Process ACK packets block = buf.unpack('n')[0] #puts "%s %d" % [start, block] - tr = find_transfer(OpRead, from, block) + tr = find_transfer(Constants::OpRead, from, block) if not tr # NOTE: some clients, such as pxelinux, send an ack for block 0. # To deal with this, we simply ignore it as we start with block 1. return if block == 0 # If we didn't find it, send an error. - send_error(from, ErrUnknownTransferId) + send_error(from, Constants::ErrUnknownTransferId) else # acked! send the next block tr[:offset] += tr[:blksize] @@ -409,17 +408,17 @@ protected end end - when OpData + when Constants::OpData # Process Data packets block = buf.unpack('n')[0] data = buf.slice(2, buf.length) #puts "%s %d %d bytes" % [start, block, data.length] - tr = find_transfer(OpWrite, from, (block-1)) + tr = find_transfer(Constants::OpWrite, from, (block-1)) if not tr # If we didn't find it, send an error. - send_error(from, ErrUnknownTransferId) + send_error(from, Constants::ErrUnknownTransferId) else tr[:file][:data] << data tr[:last_size] = data.length @@ -433,7 +432,7 @@ protected else # Other packets are unsupported #puts start - send_error(from, ErrAccessViolation) + send_error(from, Constants::ErrAccessViolation) end end @@ -468,7 +467,7 @@ protected end when "tsize" - if tr[:type] == OpRead + if tr[:type] == Constants::OpRead len = tr[:file][:data].length else val = val.to_i @@ -482,7 +481,7 @@ protected return if to_ack.length < 1 # if we have anything to ack, do it - data = [OpOptAck].pack('n') + data = [Constants::OpOptAck].pack('n') to_ack.each { |el| data << el[0] << "\x00" << el[1] << "\x00" } diff --git a/lib/rex/script.rb b/lib/rex/script.rb index f81e23fe2f..e3692e9253 100644 --- a/lib/rex/script.rb +++ b/lib/rex/script.rb @@ -36,7 +36,4 @@ end end -require 'rex/script/base' -require 'rex/script/shell' -require 'rex/script/meterpreter' diff --git a/lib/rex/service.rb b/lib/rex/service.rb index 01db4f6e64..00fcfbf65b 100644 --- a/lib/rex/service.rb +++ b/lib/rex/service.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex' -require 'rex/proto' module Rex @@ -14,7 +13,6 @@ module Rex module Service include Ref - require 'rex/services/local_relay' # # Returns the hardcore, as in porno, alias for this service. This is used diff --git a/lib/rex/service_manager.rb b/lib/rex/service_manager.rb index 606a27e06b..0808fd84a7 100644 --- a/lib/rex/service_manager.rb +++ b/lib/rex/service_manager.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'singleton' require 'rex' -require 'rex/service' module Rex diff --git a/lib/rex/services/local_relay.rb b/lib/rex/services/local_relay.rb index cd886355e4..c6a4962b32 100644 --- a/lib/rex/services/local_relay.rb +++ b/lib/rex/services/local_relay.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'thread' require 'rex/socket' -require 'rex/service' module Rex module Services diff --git a/lib/rex/ui.rb b/lib/rex/ui.rb deleted file mode 100644 index aa208ca9ed..0000000000 --- a/lib/rex/ui.rb +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: binary -*- -# -# This file includes everything needed to interact with the user interface -# wrappers of the rex library. -# - -# General classes -require 'rex/ui/output' - - -# Text-based user interfaces -require 'rex/ui/text/input' -require 'rex/ui/text/shell' -require 'rex/ui/text/resource' -require 'rex/ui/text/dispatcher_shell' -require 'rex/ui/text/irb_shell' -require 'rex/ui/text/bidirectional_pipe' - -require 'rex/text/color' -require 'rex/text/table' - -# Ui subscriber -require 'rex/ui/subscriber' -require 'rex/ui/interactive' diff --git a/lib/rex/ui/output.rb b/lib/rex/ui/output.rb index 4604edafaa..9c04fb2fef 100644 --- a/lib/rex/ui/output.rb +++ b/lib/rex/ui/output.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui @@ -13,10 +12,8 @@ module Ui class Output # General output - require 'rex/ui/output/none' # Text-based output - require 'rex/ui/text/output' # # Prints an error message. diff --git a/lib/rex/ui/output/none.rb b/lib/rex/ui/output/none.rb index c9eafd2a96..9d65d0715e 100644 --- a/lib/rex/ui/output/none.rb +++ b/lib/rex/ui/output/none.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/bidirectional_pipe.rb b/lib/rex/ui/text/bidirectional_pipe.rb index 1545df8717..f18b6621eb 100644 --- a/lib/rex/ui/text/bidirectional_pipe.rb +++ b/lib/rex/ui/text/bidirectional_pipe.rb @@ -3,9 +3,6 @@ module Rex module Ui module Text -require 'rex/ui/text/output' -require 'rex/ui/text/output/buffer' -require 'rex/ui/text/input/buffer' class BidirectionalPipe < Rex::Ui::Text::Input diff --git a/lib/rex/ui/text/dispatcher_shell.rb b/lib/rex/ui/text/dispatcher_shell.rb index df8347fed8..5dd1f4ce55 100644 --- a/lib/rex/ui/text/dispatcher_shell.rb +++ b/lib/rex/ui/text/dispatcher_shell.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' require 'pp' require 'rex/text/table' require 'erb' diff --git a/lib/rex/ui/text/input.rb b/lib/rex/ui/text/input.rb index 5e0ecc15df..26e79623d2 100644 --- a/lib/rex/ui/text/input.rb +++ b/lib/rex/ui/text/input.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui @@ -14,10 +13,6 @@ module Text ### class Input - require 'rex/ui/text/input/stdio' - require 'rex/ui/text/input/readline' - require 'rex/ui/text/input/socket' - require 'rex/ui/text/input/buffer' require 'rex/text/color' include Rex::Text::Color diff --git a/lib/rex/ui/text/input/buffer.rb b/lib/rex/ui/text/input/buffer.rb index ae462edfd2..104c578059 100644 --- a/lib/rex/ui/text/input/buffer.rb +++ b/lib/rex/ui/text/input/buffer.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/input/readline.rb b/lib/rex/ui/text/input/readline.rb index 2b8406900b..531de48c60 100644 --- a/lib/rex/ui/text/input/readline.rb +++ b/lib/rex/ui/text/input/readline.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/input/socket.rb b/lib/rex/ui/text/input/socket.rb index 37541bae28..cc3de241b6 100644 --- a/lib/rex/ui/text/input/socket.rb +++ b/lib/rex/ui/text/input/socket.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/input/stdio.rb b/lib/rex/ui/text/input/stdio.rb index 0282859aa2..f36597c10e 100644 --- a/lib/rex/ui/text/input/stdio.rb +++ b/lib/rex/ui/text/input/stdio.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/output.rb b/lib/rex/ui/text/output.rb index c811a3eb1c..ef8f8fd030 100644 --- a/lib/rex/ui/text/output.rb +++ b/lib/rex/ui/text/output.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui @@ -13,11 +12,6 @@ module Text ### class Output < Rex::Ui::Output - require 'rex/ui/text/output/stdio' - require 'rex/ui/text/output/socket' - require 'rex/ui/text/output/buffer' - require 'rex/ui/text/output/file' - require 'rex/ui/text/output/tee' require 'rex/text/color' include Rex::Text::Color diff --git a/lib/rex/ui/text/output/buffer.rb b/lib/rex/ui/text/output/buffer.rb index f52083965e..1305026d62 100644 --- a/lib/rex/ui/text/output/buffer.rb +++ b/lib/rex/ui/text/output/buffer.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/output/buffer/stdout.rb b/lib/rex/ui/text/output/buffer/stdout.rb index c8a7a5357a..fa6a6b3369 100644 --- a/lib/rex/ui/text/output/buffer/stdout.rb +++ b/lib/rex/ui/text/output/buffer/stdout.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- # make sure the classes are defined before opening it to define submodule -require 'rex/ui/text/output' -require 'rex/ui/text/output/buffer' module Rex module Ui @@ -23,4 +21,4 @@ module Rex end end end -end \ No newline at end of file +end diff --git a/lib/rex/ui/text/output/file.rb b/lib/rex/ui/text/output/file.rb index ad0ed6bb12..6bec607d9a 100644 --- a/lib/rex/ui/text/output/file.rb +++ b/lib/rex/ui/text/output/file.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/output/socket.rb b/lib/rex/ui/text/output/socket.rb index d98fded39f..0016d9bb60 100644 --- a/lib/rex/ui/text/output/socket.rb +++ b/lib/rex/ui/text/output/socket.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/output/stdio.rb b/lib/rex/ui/text/output/stdio.rb index 8ca76dd72c..085c912a60 100644 --- a/lib/rex/ui/text/output/stdio.rb +++ b/lib/rex/ui/text/output/stdio.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' begin require 'windows_console_color_support' diff --git a/lib/rex/ui/text/output/tee.rb b/lib/rex/ui/text/output/tee.rb index ca6b9e4afe..ebfbb4034a 100644 --- a/lib/rex/ui/text/output/tee.rb +++ b/lib/rex/ui/text/output/tee.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' module Rex module Ui diff --git a/lib/rex/ui/text/resource.rb b/lib/rex/ui/text/resource.rb index c3b8599d12..f6567dd9e6 100644 --- a/lib/rex/ui/text/resource.rb +++ b/lib/rex/ui/text/resource.rb @@ -1,5 +1,4 @@ # -*- coding: binary -*- -require 'rex/ui' require 'erb' module Rex @@ -76,4 +75,4 @@ end end end -end \ No newline at end of file +end diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index dfc00ee92f..c7dc1491d4 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'rex/text/color' -require 'rex/ui' module Rex module Ui diff --git a/lib/robots.rb b/lib/robots.rb index 7959c5428a..ba69f6ff6c 100644 --- a/lib/robots.rb +++ b/lib/robots.rb @@ -26,7 +26,6 @@ require "open-uri" require "uri" require "timeout" -require 'rex/logging/log_dispatcher' # https://github.com/fizx/robots class Robots diff --git a/modules/auxiliary/admin/tftp/tftp_transfer_util.rb b/modules/auxiliary/admin/tftp/tftp_transfer_util.rb index 8cf3c1f0ad..256e32c010 100644 --- a/modules/auxiliary/admin/tftp/tftp_transfer_util.rb +++ b/modules/auxiliary/admin/tftp/tftp_transfer_util.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' class MetasploitModule < Msf::Auxiliary include Rex::Proto::TFTP diff --git a/modules/auxiliary/dos/samba/read_nttrans_ea_list.rb b/modules/auxiliary/dos/samba/read_nttrans_ea_list.rb index d05de43e66..faf6498c99 100644 --- a/modules/auxiliary/dos/samba/read_nttrans_ea_list.rb +++ b/modules/auxiliary/dos/samba/read_nttrans_ea_list.rb @@ -4,7 +4,6 @@ ## require 'rex/struct2' -require 'rex/proto/smb' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DCERPC diff --git a/modules/auxiliary/dos/scada/d20_tftp_overflow.rb b/modules/auxiliary/dos/scada/d20_tftp_overflow.rb index c4292566bb..ebc0c4ce08 100644 --- a/modules/auxiliary/dos/scada/d20_tftp_overflow.rb +++ b/modules/auxiliary/dos/scada/d20_tftp_overflow.rb @@ -13,8 +13,6 @@ ## -require 'rex/ui/text/shell' -require 'rex/proto/tftp' class MetasploitModule < Msf::Auxiliary include Rex::Ui::Text diff --git a/modules/auxiliary/fuzzers/ntp/ntp_protocol_fuzzer.rb b/modules/auxiliary/fuzzers/ntp/ntp_protocol_fuzzer.rb index b9bf75753f..f0c40d9266 100644 --- a/modules/auxiliary/fuzzers/ntp/ntp_protocol_fuzzer.rb +++ b/modules/auxiliary/fuzzers/ntp/ntp_protocol_fuzzer.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntp' require 'securerandom' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/gather/apple_safari_ftp_url_cookie_theft.rb b/modules/auxiliary/gather/apple_safari_ftp_url_cookie_theft.rb index 2710e1ff6c..9e634ac68a 100644 --- a/modules/auxiliary/gather/apple_safari_ftp_url_cookie_theft.rb +++ b/modules/auxiliary/gather/apple_safari_ftp_url_cookie_theft.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/service_manager' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::FtpServer diff --git a/modules/auxiliary/gather/censys_search.rb b/modules/auxiliary/gather/censys_search.rb index 10fa3e9736..1b9c5cea4b 100644 --- a/modules/auxiliary/gather/censys_search.rb +++ b/modules/auxiliary/gather/censys_search.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/gather/d20pass.rb b/modules/auxiliary/gather/d20pass.rb index 7836ab4b30..26c64d9bc0 100644 --- a/modules/auxiliary/gather/d20pass.rb +++ b/modules/auxiliary/gather/d20pass.rb @@ -8,8 +8,6 @@ # parses the usernames and passwords from it. ## -require 'rex/ui/text/shell' -require 'rex/proto/tftp' class MetasploitModule < Msf::Auxiliary include Rex::Ui::Text diff --git a/modules/auxiliary/gather/konica_minolta_pwd_extract.rb b/modules/auxiliary/gather/konica_minolta_pwd_extract.rb index 46452f2507..3b286261b4 100644 --- a/modules/auxiliary/gather/konica_minolta_pwd_extract.rb +++ b/modules/auxiliary/gather/konica_minolta_pwd_extract.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/gather/windows_deployment_services_shares.rb b/modules/auxiliary/gather/windows_deployment_services_shares.rb index e65e19a7f3..82329f4e38 100644 --- a/modules/auxiliary/gather/windows_deployment_services_shares.rb +++ b/modules/auxiliary/gather/windows_deployment_services_shares.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/dcerpc' -require 'rex/parser/unattend' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::SMB::Client diff --git a/modules/auxiliary/gather/xerox_workcentre_5xxx_ldap.rb b/modules/auxiliary/gather/xerox_workcentre_5xxx_ldap.rb index 131af91a76..ad7a55615f 100644 --- a/modules/auxiliary/gather/xerox_workcentre_5xxx_ldap.rb +++ b/modules/auxiliary/gather/xerox_workcentre_5xxx_ldap.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/gather/zoomeye_search.rb b/modules/auxiliary/gather/zoomeye_search.rb index 653fb5a828..0063600dc3 100644 --- a/modules/auxiliary/gather/zoomeye_search.rb +++ b/modules/auxiliary/gather/zoomeye_search.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/parser/unattend.rb b/modules/auxiliary/parser/unattend.rb index 8cb512d229..226abc7eb2 100644 --- a/modules/auxiliary/parser/unattend.rb +++ b/modules/auxiliary/parser/unattend.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/unattend' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/acpp/login.rb b/modules/auxiliary/scanner/acpp/login.rb index ed10519230..706bce7833 100644 --- a/modules/auxiliary/scanner/acpp/login.rb +++ b/modules/auxiliary/scanner/acpp/login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/acpp' require 'metasploit/framework/credential_collection' require 'metasploit/framework/login_scanner/acpp' diff --git a/modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb b/modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb index f44d239622..7c177f26f3 100644 --- a/modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb +++ b/modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb @@ -3,9 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/dcerpc' -require 'rex/proto/dcerpc/wdscp' -require 'rex/parser/unattend' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DCERPC diff --git a/modules/auxiliary/scanner/http/backup_file.rb b/modules/auxiliary/scanner/http/backup_file.rb index 6383acdadd..8a85ce3966 100644 --- a/modules/auxiliary/scanner/http/backup_file.rb +++ b/modules/auxiliary/scanner/http/backup_file.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/blind_sql_query.rb b/modules/auxiliary/scanner/http/blind_sql_query.rb index 05ee44c36e..f226bccdf3 100644 --- a/modules/auxiliary/scanner/http/blind_sql_query.rb +++ b/modules/auxiliary/scanner/http/blind_sql_query.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + diff --git a/modules/auxiliary/scanner/http/cisco_asa_asdm.rb b/modules/auxiliary/scanner/http/cisco_asa_asdm.rb index daf9b5905e..c4250c78e2 100644 --- a/modules/auxiliary/scanner/http/cisco_asa_asdm.rb +++ b/modules/auxiliary/scanner/http/cisco_asa_asdm.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/cisco_device_manager.rb b/modules/auxiliary/scanner/http/cisco_device_manager.rb index 3e5d43ef02..3c59ae1e31 100644 --- a/modules/auxiliary/scanner/http/cisco_device_manager.rb +++ b/modules/auxiliary/scanner/http/cisco_device_manager.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/cisco_ios_auth_bypass.rb b/modules/auxiliary/scanner/http/cisco_ios_auth_bypass.rb index 0025976c56..094584823b 100644 --- a/modules/auxiliary/scanner/http/cisco_ios_auth_bypass.rb +++ b/modules/auxiliary/scanner/http/cisco_ios_auth_bypass.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/cisco_ironport_enum.rb b/modules/auxiliary/scanner/http/cisco_ironport_enum.rb index 42c7391dc7..2821c625fd 100644 --- a/modules/auxiliary/scanner/http/cisco_ironport_enum.rb +++ b/modules/auxiliary/scanner/http/cisco_ironport_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/cisco_ssl_vpn.rb b/modules/auxiliary/scanner/http/cisco_ssl_vpn.rb index c5d4fc8cd3..9cc315b060 100644 --- a/modules/auxiliary/scanner/http/cisco_ssl_vpn.rb +++ b/modules/auxiliary/scanner/http/cisco_ssl_vpn.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/copy_of_file.rb b/modules/auxiliary/scanner/http/copy_of_file.rb index 3dedbef6fa..938527b62c 100644 --- a/modules/auxiliary/scanner/http/copy_of_file.rb +++ b/modules/auxiliary/scanner/http/copy_of_file.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/crawler.rb b/modules/auxiliary/scanner/http/crawler.rb index b024ea4e23..7d7b4a1634 100644 --- a/modules/auxiliary/scanner/http/crawler.rb +++ b/modules/auxiliary/scanner/http/crawler.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::HttpCrawler diff --git a/modules/auxiliary/scanner/http/dir_listing.rb b/modules/auxiliary/scanner/http/dir_listing.rb index 681cbbe5af..a2fae05590 100644 --- a/modules/auxiliary/scanner/http/dir_listing.rb +++ b/modules/auxiliary/scanner/http/dir_listing.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/dir_scanner.rb b/modules/auxiliary/scanner/http/dir_scanner.rb index 554d3e52b8..fd06849c72 100644 --- a/modules/auxiliary/scanner/http/dir_scanner.rb +++ b/modules/auxiliary/scanner/http/dir_scanner.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + require 'thread' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/dir_webdav_unicode_bypass.rb b/modules/auxiliary/scanner/http/dir_webdav_unicode_bypass.rb index ca445829d1..3130aec7d6 100644 --- a/modules/auxiliary/scanner/http/dir_webdav_unicode_bypass.rb +++ b/modules/auxiliary/scanner/http/dir_webdav_unicode_bypass.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/error_sql_injection.rb b/modules/auxiliary/scanner/http/error_sql_injection.rb index dc6e5b270f..b86cf8a342 100644 --- a/modules/auxiliary/scanner/http/error_sql_injection.rb +++ b/modules/auxiliary/scanner/http/error_sql_injection.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/exchange_web_server_pushsubscription.rb b/modules/auxiliary/scanner/http/exchange_web_server_pushsubscription.rb index 2573315f22..51a67eb47e 100644 --- a/modules/auxiliary/scanner/http/exchange_web_server_pushsubscription.rb +++ b/modules/auxiliary/scanner/http/exchange_web_server_pushsubscription.rb @@ -3,8 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/file_same_name_dir.rb b/modules/auxiliary/scanner/http/file_same_name_dir.rb index 4929f9c3e2..583e0b74e6 100644 --- a/modules/auxiliary/scanner/http/file_same_name_dir.rb +++ b/modules/auxiliary/scanner/http/file_same_name_dir.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/files_dir.rb b/modules/auxiliary/scanner/http/files_dir.rb index 91e6b5498b..affb6e2b6a 100644 --- a/modules/auxiliary/scanner/http/files_dir.rb +++ b/modules/auxiliary/scanner/http/files_dir.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/gitlab_user_enum.rb b/modules/auxiliary/scanner/http/gitlab_user_enum.rb index 3ff84d8b66..6546a280db 100644 --- a/modules/auxiliary/scanner/http/gitlab_user_enum.rb +++ b/modules/auxiliary/scanner/http/gitlab_user_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + require 'json' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/http_login.rb b/modules/auxiliary/scanner/http/http_login.rb index ac751926d7..942843eddd 100644 --- a/modules/auxiliary/scanner/http/http_login.rb +++ b/modules/auxiliary/scanner/http/http_login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' require 'metasploit/framework/credential_collection' require 'metasploit/framework/login_scanner/http' diff --git a/modules/auxiliary/scanner/http/http_version.rb b/modules/auxiliary/scanner/http/http_version.rb index d331ecd688..5c52bfd6e0 100644 --- a/modules/auxiliary/scanner/http/http_version.rb +++ b/modules/auxiliary/scanner/http/http_version.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/infovista_enum.rb b/modules/auxiliary/scanner/http/infovista_enum.rb index 1440edaac9..eb7b1abf6c 100644 --- a/modules/auxiliary/scanner/http/infovista_enum.rb +++ b/modules/auxiliary/scanner/http/infovista_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/intel_amt_digest_bypass.rb b/modules/auxiliary/scanner/http/intel_amt_digest_bypass.rb index a05aa8174a..8c744c8372 100644 --- a/modules/auxiliary/scanner/http/intel_amt_digest_bypass.rb +++ b/modules/auxiliary/scanner/http/intel_amt_digest_bypass.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/jboss_vulnscan.rb b/modules/auxiliary/scanner/http/jboss_vulnscan.rb index e7d50ae949..ef70507caf 100644 --- a/modules/auxiliary/scanner/http/jboss_vulnscan.rb +++ b/modules/auxiliary/scanner/http/jboss_vulnscan.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/jenkins_command.rb b/modules/auxiliary/scanner/http/jenkins_command.rb index 33c7f26720..fc53f9f2fb 100644 --- a/modules/auxiliary/scanner/http/jenkins_command.rb +++ b/modules/auxiliary/scanner/http/jenkins_command.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + require 'cgi' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/jenkins_enum.rb b/modules/auxiliary/scanner/http/jenkins_enum.rb index 2eaa0a1ac9..6913b32d47 100644 --- a/modules/auxiliary/scanner/http/jenkins_enum.rb +++ b/modules/auxiliary/scanner/http/jenkins_enum.rb @@ -7,7 +7,7 @@ # Some of this code was taken from the "jboss_vulnscan" module by: Tyler Krpata ## -require 'rex/proto/http' + require 'rexml/document' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/lucky_punch.rb b/modules/auxiliary/scanner/http/lucky_punch.rb index a7d15f28e0..009a238dc6 100644 --- a/modules/auxiliary/scanner/http/lucky_punch.rb +++ b/modules/auxiliary/scanner/http/lucky_punch.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/ms09_020_webdav_unicode_bypass.rb b/modules/auxiliary/scanner/http/ms09_020_webdav_unicode_bypass.rb index 41b7e500ee..be7c7aad5f 100644 --- a/modules/auxiliary/scanner/http/ms09_020_webdav_unicode_bypass.rb +++ b/modules/auxiliary/scanner/http/ms09_020_webdav_unicode_bypass.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/ms15_034_http_sys_memory_dump.rb b/modules/auxiliary/scanner/http/ms15_034_http_sys_memory_dump.rb index 55316c7b24..0e110152ff 100644 --- a/modules/auxiliary/scanner/http/ms15_034_http_sys_memory_dump.rb +++ b/modules/auxiliary/scanner/http/ms15_034_http_sys_memory_dump.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/owa_ews_login.rb b/modules/auxiliary/scanner/http/owa_ews_login.rb index 382210c03e..b9b8d58bee 100644 --- a/modules/auxiliary/scanner/http/owa_ews_login.rb +++ b/modules/auxiliary/scanner/http/owa_ews_login.rb @@ -3,8 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' -require 'rex/proto/http' + require 'metasploit/framework/credential_collection' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/owa_login.rb b/modules/auxiliary/scanner/http/owa_login.rb index 76e87408b9..a9346988f2 100644 --- a/modules/auxiliary/scanner/http/owa_login.rb +++ b/modules/auxiliary/scanner/http/owa_login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/http/prev_dir_same_name_file.rb b/modules/auxiliary/scanner/http/prev_dir_same_name_file.rb index 2d41f81632..8cbad9c16c 100644 --- a/modules/auxiliary/scanner/http/prev_dir_same_name_file.rb +++ b/modules/auxiliary/scanner/http/prev_dir_same_name_file.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/rails_mass_assignment.rb b/modules/auxiliary/scanner/http/rails_mass_assignment.rb index 02a377dfae..4c1400ad20 100644 --- a/modules/auxiliary/scanner/http/rails_mass_assignment.rb +++ b/modules/auxiliary/scanner/http/rails_mass_assignment.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + require 'uri' class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/replace_ext.rb b/modules/auxiliary/scanner/http/replace_ext.rb index fde8d193d8..1689251b43 100644 --- a/modules/auxiliary/scanner/http/replace_ext.rb +++ b/modules/auxiliary/scanner/http/replace_ext.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + require 'pathname' diff --git a/modules/auxiliary/scanner/http/sentry_cdu_enum.rb b/modules/auxiliary/scanner/http/sentry_cdu_enum.rb index 3cc8c98fd1..dd31808309 100644 --- a/modules/auxiliary/scanner/http/sentry_cdu_enum.rb +++ b/modules/auxiliary/scanner/http/sentry_cdu_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/sevone_enum.rb b/modules/auxiliary/scanner/http/sevone_enum.rb index 5e95c34f70..bbfd7a3dc1 100644 --- a/modules/auxiliary/scanner/http/sevone_enum.rb +++ b/modules/auxiliary/scanner/http/sevone_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/squiz_matrix_user_enum.rb b/modules/auxiliary/scanner/http/squiz_matrix_user_enum.rb index 465730fe70..ee954d4802 100644 --- a/modules/auxiliary/scanner/http/squiz_matrix_user_enum.rb +++ b/modules/auxiliary/scanner/http/squiz_matrix_user_enum.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/ssl_version.rb b/modules/auxiliary/scanner/http/ssl_version.rb index e4d2be094c..7ac70e7db8 100644 --- a/modules/auxiliary/scanner/http/ssl_version.rb +++ b/modules/auxiliary/scanner/http/ssl_version.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary diff --git a/modules/auxiliary/scanner/http/vhost_scanner.rb b/modules/auxiliary/scanner/http/vhost_scanner.rb index 1fcf8ff79d..c7a01bc4f0 100644 --- a/modules/auxiliary/scanner/http/vhost_scanner.rb +++ b/modules/auxiliary/scanner/http/vhost_scanner.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + # # May I reuse some methods? # diff --git a/modules/auxiliary/scanner/http/web_vulndb.rb b/modules/auxiliary/scanner/http/web_vulndb.rb index 4802eff3bd..8a87026a0b 100644 --- a/modules/auxiliary/scanner/http/web_vulndb.rb +++ b/modules/auxiliary/scanner/http/web_vulndb.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/http/xpath.rb b/modules/auxiliary/scanner/http/xpath.rb index 21d1224b82..bc7277403a 100644 --- a/modules/auxiliary/scanner/http/xpath.rb +++ b/modules/auxiliary/scanner/http/xpath.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient diff --git a/modules/auxiliary/scanner/ipmi/ipmi_cipher_zero.rb b/modules/auxiliary/scanner/ipmi/ipmi_cipher_zero.rb index a4889ca854..7af4d1fed5 100644 --- a/modules/auxiliary/scanner/ipmi/ipmi_cipher_zero.rb +++ b/modules/auxiliary/scanner/ipmi/ipmi_cipher_zero.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ipmi' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb b/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb index 82a860b9cc..5f20a31ad0 100644 --- a/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb +++ b/modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ipmi' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/ipmi/ipmi_version.rb b/modules/auxiliary/scanner/ipmi/ipmi_version.rb index 19a2362a77..78b93139bb 100644 --- a/modules/auxiliary/scanner/ipmi/ipmi_version.rb +++ b/modules/auxiliary/scanner/ipmi/ipmi_version.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ipmi' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/quake/server_info.rb b/modules/auxiliary/scanner/quake/server_info.rb index 373bd87a61..262f1cc8fc 100644 --- a/modules/auxiliary/scanner/quake/server_info.rb +++ b/modules/auxiliary/scanner/quake/server_info.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/quake' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/scada/digi_addp_reboot.rb b/modules/auxiliary/scanner/scada/digi_addp_reboot.rb index 24c8f01202..83839d60d9 100644 --- a/modules/auxiliary/scanner/scada/digi_addp_reboot.rb +++ b/modules/auxiliary/scanner/scada/digi_addp_reboot.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/addp' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/scada/digi_addp_version.rb b/modules/auxiliary/scanner/scada/digi_addp_version.rb index a07fdf1ebb..7ca0bb5110 100644 --- a/modules/auxiliary/scanner/scada/digi_addp_version.rb +++ b/modules/auxiliary/scanner/scada/digi_addp_version.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/addp' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/smb/smb_enum_gpp.rb b/modules/auxiliary/scanner/smb/smb_enum_gpp.rb index b26c554bdb..a2956a6320 100644 --- a/modules/auxiliary/scanner/smb/smb_enum_gpp.rb +++ b/modules/auxiliary/scanner/smb/smb_enum_gpp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/group_policy_preferences' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::SMB::Client::Authenticated diff --git a/modules/auxiliary/scanner/steam/server_info.rb b/modules/auxiliary/scanner/steam/server_info.rb index 406569f1d5..4dc417a829 100644 --- a/modules/auxiliary/scanner/steam/server_info.rb +++ b/modules/auxiliary/scanner/steam/server_info.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/steam' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/scanner/vmware/vmware_enum_permissions.rb b/modules/auxiliary/scanner/vmware/vmware_enum_permissions.rb index 07cbf53d68..b52b77fd27 100644 --- a/modules/auxiliary/scanner/vmware/vmware_enum_permissions.rb +++ b/modules/auxiliary/scanner/vmware/vmware_enum_permissions.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::VIMSoap diff --git a/modules/auxiliary/scanner/vmware/vmware_enum_sessions.rb b/modules/auxiliary/scanner/vmware/vmware_enum_sessions.rb index aa94d4046a..62f5146e1d 100644 --- a/modules/auxiliary/scanner/vmware/vmware_enum_sessions.rb +++ b/modules/auxiliary/scanner/vmware/vmware_enum_sessions.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::VIMSoap diff --git a/modules/auxiliary/scanner/vmware/vmware_enum_users.rb b/modules/auxiliary/scanner/vmware/vmware_enum_users.rb index 1d19021d3f..775dadbcad 100644 --- a/modules/auxiliary/scanner/vmware/vmware_enum_users.rb +++ b/modules/auxiliary/scanner/vmware/vmware_enum_users.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::VIMSoap diff --git a/modules/auxiliary/scanner/vmware/vmware_http_login.rb b/modules/auxiliary/scanner/vmware/vmware_http_login.rb index 44a5ec1e98..e97f801184 100644 --- a/modules/auxiliary/scanner/vmware/vmware_http_login.rb +++ b/modules/auxiliary/scanner/vmware/vmware_http_login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::VIMSoap diff --git a/modules/auxiliary/scanner/vnc/ard_root_pw.rb b/modules/auxiliary/scanner/vnc/ard_root_pw.rb index fa1e1f289b..fc1e5ea8d1 100644 --- a/modules/auxiliary/scanner/vnc/ard_root_pw.rb +++ b/modules/auxiliary/scanner/vnc/ard_root_pw.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/rfb' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::Tcp diff --git a/modules/auxiliary/scanner/vnc/vnc_login.rb b/modules/auxiliary/scanner/vnc/vnc_login.rb index 731e82ab29..3a53fdbf00 100644 --- a/modules/auxiliary/scanner/vnc/vnc_login.rb +++ b/modules/auxiliary/scanner/vnc/vnc_login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/rfb' require 'metasploit/framework/credential_collection' require 'metasploit/framework/login_scanner/vnc' diff --git a/modules/auxiliary/scanner/vnc/vnc_none_auth.rb b/modules/auxiliary/scanner/vnc/vnc_none_auth.rb index 233ffb254b..cbce3e1e60 100644 --- a/modules/auxiliary/scanner/vnc/vnc_none_auth.rb +++ b/modules/auxiliary/scanner/vnc/vnc_none_auth.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/rfb' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::Tcp diff --git a/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb b/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb index 9de0744f26..6f4e124a6b 100644 --- a/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb +++ b/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::WinRM diff --git a/modules/auxiliary/scanner/winrm/winrm_cmd.rb b/modules/auxiliary/scanner/winrm/winrm_cmd.rb index 60f4f95858..d0dd513183 100644 --- a/modules/auxiliary/scanner/winrm/winrm_cmd.rb +++ b/modules/auxiliary/scanner/winrm/winrm_cmd.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' diff --git a/modules/auxiliary/scanner/winrm/winrm_login.rb b/modules/auxiliary/scanner/winrm/winrm_login.rb index d5209499be..65eca9279b 100644 --- a/modules/auxiliary/scanner/winrm/winrm_login.rb +++ b/modules/auxiliary/scanner/winrm/winrm_login.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' require 'metasploit/framework/credential_collection' require 'metasploit/framework/login_scanner' require 'metasploit/framework/login_scanner/winrm' diff --git a/modules/auxiliary/scanner/winrm/winrm_wql.rb b/modules/auxiliary/scanner/winrm/winrm_wql.rb index c39787f6f4..43f64228e4 100644 --- a/modules/auxiliary/scanner/winrm/winrm_wql.rb +++ b/modules/auxiliary/scanner/winrm/winrm_wql.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/message' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::WinRM diff --git a/modules/auxiliary/server/capture/http_ntlm.rb b/modules/auxiliary/server/capture/http_ntlm.rb index 9631e582c0..78333607db 100644 --- a/modules/auxiliary/server/capture/http_ntlm.rb +++ b/modules/auxiliary/server/capture/http_ntlm.rb @@ -3,9 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/message' -require 'rex/proto/ntlm/crypt' NTLM_CONST = Rex::Proto::NTLM::Constants NTLM_CRYPT = Rex::Proto::NTLM::Crypt diff --git a/modules/auxiliary/server/capture/mssql.rb b/modules/auxiliary/server/capture/mssql.rb index 03dfe4f2a9..13304f90a0 100644 --- a/modules/auxiliary/server/capture/mssql.rb +++ b/modules/auxiliary/server/capture/mssql.rb @@ -3,9 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/message' -require 'rex/proto/ntlm/crypt' NTLM_CONST = Rex::Proto::NTLM::Constants NTLM_CRYPT = Rex::Proto::NTLM::Crypt diff --git a/modules/auxiliary/server/dhclient_bash_env.rb b/modules/auxiliary/server/dhclient_bash_env.rb index 3346183cca..7a081f7e5a 100644 --- a/modules/auxiliary/server/dhclient_bash_env.rb +++ b/modules/auxiliary/server/dhclient_bash_env.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/dhcp' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DHCPServer diff --git a/modules/auxiliary/server/dhcp.rb b/modules/auxiliary/server/dhcp.rb index 895914e9ce..ab4343a308 100644 --- a/modules/auxiliary/server/dhcp.rb +++ b/modules/auxiliary/server/dhcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/dhcp' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DHCPServer diff --git a/modules/auxiliary/server/http_ntlmrelay.rb b/modules/auxiliary/server/http_ntlmrelay.rb index b36ad454e2..abcee4e5b8 100644 --- a/modules/auxiliary/server/http_ntlmrelay.rb +++ b/modules/auxiliary/server/http_ntlmrelay.rb @@ -3,9 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/ntlm/constants' -require 'rex/proto/ntlm/message' -require 'rex/proto/ntlm/crypt' require 'rex/exceptions' diff --git a/modules/auxiliary/server/pxeexploit.rb b/modules/auxiliary/server/pxeexploit.rb index 895a40dfb2..bfcbbc41c5 100644 --- a/modules/auxiliary/server/pxeexploit.rb +++ b/modules/auxiliary/server/pxeexploit.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' -require 'rex/proto/dhcp' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::TFTPServer diff --git a/modules/auxiliary/server/socks_proxy.rb b/modules/auxiliary/server/socks_proxy.rb index b088017c0b..2476751aed 100644 --- a/modules/auxiliary/server/socks_proxy.rb +++ b/modules/auxiliary/server/socks_proxy.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/proxy/socks4a' -require 'rex/proto/proxy/socks5' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Report diff --git a/modules/auxiliary/server/tftp.rb b/modules/auxiliary/server/tftp.rb index 87b5a6b4e1..574a994e2f 100644 --- a/modules/auxiliary/server/tftp.rb +++ b/modules/auxiliary/server/tftp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' require 'tmpdir' class MetasploitModule < Msf::Auxiliary diff --git a/modules/exploits/android/adb/adb_server_exec.rb b/modules/exploits/android/adb/adb_server_exec.rb index 8137161549..4a8202a1ca 100644 --- a/modules/exploits/android/adb/adb_server_exec.rb +++ b/modules/exploits/android/adb/adb_server_exec.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/adb' - class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/linux/http/linksys_wrt160nv2_apply_exec.rb b/modules/exploits/linux/http/linksys_wrt160nv2_apply_exec.rb index 308fc5f54b..4ea26b0b13 100644 --- a/modules/exploits/linux/http/linksys_wrt160nv2_apply_exec.rb +++ b/modules/exploits/linux/http/linksys_wrt160nv2_apply_exec.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/multi/fileformat/archive_tar_arb_file_write.rb b/modules/exploits/multi/fileformat/archive_tar_arb_file_write.rb index e714daea88..558e95bad1 100644 --- a/modules/exploits/multi/fileformat/archive_tar_arb_file_write.rb +++ b/modules/exploits/multi/fileformat/archive_tar_arb_file_write.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/tar' - class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/multi/http/jboss_seam_upload_exec.rb b/modules/exploits/multi/http/jboss_seam_upload_exec.rb index d849c1b738..5f1369a49e 100644 --- a/modules/exploits/multi/http/jboss_seam_upload_exec.rb +++ b/modules/exploits/multi/http/jboss_seam_upload_exec.rb @@ -3,7 +3,7 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/http' + class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking diff --git a/modules/exploits/multi/vnc/vnc_keyboard_exec.rb b/modules/exploits/multi/vnc/vnc_keyboard_exec.rb index 45d5accc91..582de5bac1 100644 --- a/modules/exploits/multi/vnc/vnc_keyboard_exec.rb +++ b/modules/exploits/multi/vnc/vnc_keyboard_exec.rb @@ -2,8 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - -require 'rex/proto/rfb' +require 'rex/exploitation' class MetasploitModule < Msf::Exploit::Remote Rank = GreatRanking diff --git a/modules/exploits/osx/browser/safari_file_policy.rb b/modules/exploits/osx/browser/safari_file_policy.rb index e927261e49..c729ac4419 100644 --- a/modules/exploits/osx/browser/safari_file_policy.rb +++ b/modules/exploits/osx/browser/safari_file_policy.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/service_manager' class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking diff --git a/modules/exploits/unix/dhcp/bash_environment.rb b/modules/exploits/unix/dhcp/bash_environment.rb index 70875926b9..e18d382a78 100644 --- a/modules/exploits/unix/dhcp/bash_environment.rb +++ b/modules/exploits/unix/dhcp/bash_environment.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/dhcp' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/windows/antivirus/ams_hndlrsvc.rb b/modules/exploits/windows/antivirus/ams_hndlrsvc.rb index a855e2c4d9..39745544e8 100644 --- a/modules/exploits/windows/antivirus/ams_hndlrsvc.rb +++ b/modules/exploits/windows/antivirus/ams_hndlrsvc.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' class MetasploitModule < Msf::Exploit::Remote diff --git a/modules/exploits/windows/iis/ms01_026_dbldecode.rb b/modules/exploits/windows/iis/ms01_026_dbldecode.rb index beeac2782f..89f32bba5e 100644 --- a/modules/exploits/windows/iis/ms01_026_dbldecode.rb +++ b/modules/exploits/windows/iis/ms01_026_dbldecode.rb @@ -2,8 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - -require 'rex/proto/tftp' +require 'rex/exploitation' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/windows/iis/msadc.rb b/modules/exploits/windows/iis/msadc.rb index 590ec9a789..42e943c366 100644 --- a/modules/exploits/windows/iis/msadc.rb +++ b/modules/exploits/windows/iis/msadc.rb @@ -2,8 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - -require 'rex/proto/tftp' +require 'rex/exploitation' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/windows/local/pxeexploit.rb b/modules/exploits/windows/local/pxeexploit.rb index 6c7d411f58..b00225f1f2 100644 --- a/modules/exploits/windows/local/pxeexploit.rb +++ b/modules/exploits/windows/local/pxeexploit.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' -require 'rex/proto/dhcp' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/windows/tftp/distinct_tftp_traversal.rb b/modules/exploits/windows/tftp/distinct_tftp_traversal.rb index 4eb71e1e32..e1650c6539 100644 --- a/modules/exploits/windows/tftp/distinct_tftp_traversal.rb +++ b/modules/exploits/windows/tftp/distinct_tftp_traversal.rb @@ -2,7 +2,6 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/exploits/windows/tftp/netdecision_tftp_traversal.rb b/modules/exploits/windows/tftp/netdecision_tftp_traversal.rb index 14e53b0de9..770f38de2d 100644 --- a/modules/exploits/windows/tftp/netdecision_tftp_traversal.rb +++ b/modules/exploits/windows/tftp/netdecision_tftp_traversal.rb @@ -2,7 +2,6 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/tftp' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking diff --git a/modules/payloads/singles/android/meterpreter_reverse_http.rb b/modules/payloads/singles/android/meterpreter_reverse_http.rb index 4f7f87b9ab..f58874f0d6 100644 --- a/modules/payloads/singles/android/meterpreter_reverse_http.rb +++ b/modules/payloads/singles/android/meterpreter_reverse_http.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/android/meterpreter_reverse_https.rb b/modules/payloads/singles/android/meterpreter_reverse_https.rb index cfb9e36636..a01dc714e5 100644 --- a/modules/payloads/singles/android/meterpreter_reverse_https.rb +++ b/modules/payloads/singles/android/meterpreter_reverse_https.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/android/meterpreter_reverse_tcp.rb b/modules/payloads/singles/android/meterpreter_reverse_tcp.rb index 9ebab6325e..11c935a80a 100644 --- a/modules/payloads/singles/android/meterpreter_reverse_tcp.rb +++ b/modules/payloads/singles/android/meterpreter_reverse_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb b/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb index b28f719e9a..1504afa850 100644 --- a/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb +++ b/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb @@ -2,6 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## +require 'rex/powershell' module MetasploitModule diff --git a/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb b/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb index 893aaa34e5..db0217d5c4 100644 --- a/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb +++ b/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb @@ -2,6 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## +require 'rex/powershell' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_bind_named_pipe.rb b/modules/payloads/singles/windows/meterpreter_bind_named_pipe.rb index 93d7c8cbac..e77f55dcc6 100644 --- a/modules/payloads/singles/windows/meterpreter_bind_named_pipe.rb +++ b/modules/payloads/singles/windows/meterpreter_bind_named_pipe.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_bind_tcp.rb b/modules/payloads/singles/windows/meterpreter_bind_tcp.rb index 8368f1006e..7f40d57e1b 100644 --- a/modules/payloads/singles/windows/meterpreter_bind_tcp.rb +++ b/modules/payloads/singles/windows/meterpreter_bind_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_reverse_http.rb b/modules/payloads/singles/windows/meterpreter_reverse_http.rb index fa1941ce63..fe5cb29da5 100644 --- a/modules/payloads/singles/windows/meterpreter_reverse_http.rb +++ b/modules/payloads/singles/windows/meterpreter_reverse_http.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_reverse_https.rb b/modules/payloads/singles/windows/meterpreter_reverse_https.rb index aa5d1d0eb9..004a6df111 100644 --- a/modules/payloads/singles/windows/meterpreter_reverse_https.rb +++ b/modules/payloads/singles/windows/meterpreter_reverse_https.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_reverse_ipv6_tcp.rb b/modules/payloads/singles/windows/meterpreter_reverse_ipv6_tcp.rb index c9a6f610a5..33d48bb226 100644 --- a/modules/payloads/singles/windows/meterpreter_reverse_ipv6_tcp.rb +++ b/modules/payloads/singles/windows/meterpreter_reverse_ipv6_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/meterpreter_reverse_tcp.rb b/modules/payloads/singles/windows/meterpreter_reverse_tcp.rb index fe13360801..6f6c484cf6 100644 --- a/modules/payloads/singles/windows/meterpreter_reverse_tcp.rb +++ b/modules/payloads/singles/windows/meterpreter_reverse_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/powershell_bind_tcp.rb b/modules/payloads/singles/windows/powershell_bind_tcp.rb index ab9f4f9e9f..6d5cd67078 100644 --- a/modules/payloads/singles/windows/powershell_bind_tcp.rb +++ b/modules/payloads/singles/windows/powershell_bind_tcp.rb @@ -2,7 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - +require 'rex/powershell' ### # diff --git a/modules/payloads/singles/windows/powershell_reverse_tcp.rb b/modules/payloads/singles/windows/powershell_reverse_tcp.rb index 8f7ee0a3a2..ad147a95ef 100644 --- a/modules/payloads/singles/windows/powershell_reverse_tcp.rb +++ b/modules/payloads/singles/windows/powershell_reverse_tcp.rb @@ -2,7 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - +require 'rex/powershell' ### # diff --git a/modules/payloads/singles/windows/x64/meterpreter_bind_named_pipe.rb b/modules/payloads/singles/windows/x64/meterpreter_bind_named_pipe.rb index 932aeb6880..5fd706a648 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_bind_named_pipe.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_bind_named_pipe.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/meterpreter_bind_tcp.rb b/modules/payloads/singles/windows/x64/meterpreter_bind_tcp.rb index 4ceef416c2..cdff132d57 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_bind_tcp.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_bind_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/meterpreter_reverse_http.rb b/modules/payloads/singles/windows/x64/meterpreter_reverse_http.rb index 959607f5c6..191f8b6326 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_reverse_http.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_reverse_http.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/meterpreter_reverse_https.rb b/modules/payloads/singles/windows/x64/meterpreter_reverse_https.rb index 45691e0fd8..3bc6091704 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_reverse_https.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_reverse_https.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/meterpreter_reverse_ipv6_tcp.rb b/modules/payloads/singles/windows/x64/meterpreter_reverse_ipv6_tcp.rb index 74fb1a1532..551c80fc07 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_reverse_ipv6_tcp.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_reverse_ipv6_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/meterpreter_reverse_tcp.rb b/modules/payloads/singles/windows/x64/meterpreter_reverse_tcp.rb index 67b68b9ce1..adbc5e24ca 100644 --- a/modules/payloads/singles/windows/x64/meterpreter_reverse_tcp.rb +++ b/modules/payloads/singles/windows/x64/meterpreter_reverse_tcp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/payloads/meterpreter/config' module MetasploitModule diff --git a/modules/payloads/singles/windows/x64/powershell_bind_tcp.rb b/modules/payloads/singles/windows/x64/powershell_bind_tcp.rb index 24df89358b..3b102c4a70 100644 --- a/modules/payloads/singles/windows/x64/powershell_bind_tcp.rb +++ b/modules/payloads/singles/windows/x64/powershell_bind_tcp.rb @@ -2,7 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - +require 'rex/powershell' ### # diff --git a/modules/payloads/singles/windows/x64/powershell_reverse_tcp.rb b/modules/payloads/singles/windows/x64/powershell_reverse_tcp.rb index c154f4540b..2bc6bb3a86 100644 --- a/modules/payloads/singles/windows/x64/powershell_reverse_tcp.rb +++ b/modules/payloads/singles/windows/x64/powershell_reverse_tcp.rb @@ -2,7 +2,7 @@ # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## - +require 'rex/powershell' ### # diff --git a/modules/post/multi/gather/apple_ios_backup.rb b/modules/post/multi/gather/apple_ios_backup.rb index a178bb3073..19360f664e 100644 --- a/modules/post/multi/gather/apple_ios_backup.rb +++ b/modules/post/multi/gather/apple_ios_backup.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/apple_backup_manifestdb' class MetasploitModule < Msf::Post include Msf::Post::File diff --git a/modules/post/multi/gather/wlan_geolocate.rb b/modules/post/multi/gather/wlan_geolocate.rb index 2a7e8474ba..d1f7c36c99 100644 --- a/modules/post/multi/gather/wlan_geolocate.rb +++ b/modules/post/multi/gather/wlan_geolocate.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/google/geolocation' class MetasploitModule < Msf::Post diff --git a/modules/post/windows/gather/bitlocker_fvek.rb b/modules/post/windows/gather/bitlocker_fvek.rb index 2287ca0aaa..c9583027de 100644 --- a/modules/post/windows/gather/bitlocker_fvek.rb +++ b/modules/post/windows/gather/bitlocker_fvek.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/fs/bitlocker' class MetasploitModule < Msf::Post include Msf::Post::Windows::Priv diff --git a/modules/post/windows/gather/credentials/avira_password.rb b/modules/post/windows/gather/credentials/avira_password.rb index ec3d34915a..c8b67a61a4 100644 --- a/modules/post/windows/gather/credentials/avira_password.rb +++ b/modules/post/windows/gather/credentials/avira_password.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/flashfxp.rb b/modules/post/windows/gather/credentials/flashfxp.rb index b561824b88..92c02af5e5 100644 --- a/modules/post/windows/gather/credentials/flashfxp.rb +++ b/modules/post/windows/gather/credentials/flashfxp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/gpp.rb b/modules/post/windows/gather/credentials/gpp.rb index 693e34dd65..5cecd225c4 100644 --- a/modules/post/windows/gather/credentials/gpp.rb +++ b/modules/post/windows/gather/credentials/gpp.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/group_policy_preferences' class MetasploitModule < Msf::Post include Msf::Auxiliary::Report diff --git a/modules/post/windows/gather/credentials/total_commander.rb b/modules/post/windows/gather/credentials/total_commander.rb index b355d647ce..5d6828b7f0 100644 --- a/modules/post/windows/gather/credentials/total_commander.rb +++ b/modules/post/windows/gather/credentials/total_commander.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/trillian.rb b/modules/post/windows/gather/credentials/trillian.rb index c3da22d68b..316ee6eb0c 100644 --- a/modules/post/windows/gather/credentials/trillian.rb +++ b/modules/post/windows/gather/credentials/trillian.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/vnc.rb b/modules/post/windows/gather/credentials/vnc.rb index 0192daae56..b4c2cc0b4f 100644 --- a/modules/post/windows/gather/credentials/vnc.rb +++ b/modules/post/windows/gather/credentials/vnc.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/proto/rfb' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/winscp.rb b/modules/post/windows/gather/credentials/winscp.rb index 2e5af45f16..80c3224b72 100644 --- a/modules/post/windows/gather/credentials/winscp.rb +++ b/modules/post/windows/gather/credentials/winscp.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' -require 'rex/parser/winscp' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/wsftp_client.rb b/modules/post/windows/gather/credentials/wsftp_client.rb index 0daa2484cb..bf9a9729dd 100644 --- a/modules/post/windows/gather/credentials/wsftp_client.rb +++ b/modules/post/windows/gather/credentials/wsftp_client.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/ini' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry diff --git a/modules/post/windows/gather/credentials/xshell_xftp_password.rb b/modules/post/windows/gather/credentials/xshell_xftp_password.rb index a1a883abab..c752e3896d 100644 --- a/modules/post/windows/gather/credentials/xshell_xftp_password.rb +++ b/modules/post/windows/gather/credentials/xshell_xftp_password.rb @@ -3,8 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/netsarang' - class MetasploitModule < Msf::Post include Msf::Post::Windows::UserProfiles include Msf::Post::File diff --git a/modules/post/windows/gather/enum_unattend.rb b/modules/post/windows/gather/enum_unattend.rb index 7280a205c4..09c863397f 100644 --- a/modules/post/windows/gather/enum_unattend.rb +++ b/modules/post/windows/gather/enum_unattend.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/unattend' require 'rexml/document' class MetasploitModule < Msf::Post diff --git a/modules/post/windows/gather/file_from_raw_ntfs.rb b/modules/post/windows/gather/file_from_raw_ntfs.rb index 56e613dabf..0c4fe8ad2b 100644 --- a/modules/post/windows/gather/file_from_raw_ntfs.rb +++ b/modules/post/windows/gather/file_from_raw_ntfs.rb @@ -3,7 +3,6 @@ # Current source: https://github.com/rapid7/metasploit-framework ## -require 'rex/parser/fs/ntfs' class MetasploitModule < Msf::Post include Msf::Post::Windows::Priv diff --git a/plugins/nessus.rb b/plugins/nessus.rb index 8b640f7369..e6b6b3adb9 100644 --- a/plugins/nessus.rb +++ b/plugins/nessus.rb @@ -1,6 +1,5 @@ # $Id$ $Revision$ require 'nessus_rest' -require 'rex/parser/nessus_xml' module Msf diff --git a/scripts/meterpreter/getvncpw.rb b/scripts/meterpreter/getvncpw.rb index 513a51b2c7..33cea8d69a 100644 --- a/scripts/meterpreter/getvncpw.rb +++ b/scripts/meterpreter/getvncpw.rb @@ -17,7 +17,6 @@ # 1.0 - 9/24/9 - Initial release #---------------------------------------------------------------- -require 'rex/proto/rfb/cipher' session = client diff --git a/spec/lib/msf/core/encoded_payload_spec.rb b/spec/lib/msf/core/encoded_payload_spec.rb index 559b6a3ee6..a0ee4886ff 100644 --- a/spec/lib/msf/core/encoded_payload_spec.rb +++ b/spec/lib/msf/core/encoded_payload_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'msf/core/encoded_payload' RSpec.describe Msf::EncodedPayload do include_context 'Msf::Simple::Framework#modules loading' diff --git a/spec/lib/msf/core/exploit/http/joomla/base_spec.rb b/spec/lib/msf/core/exploit/http/joomla/base_spec.rb index 5000ed60b1..192f20d2bb 100644 --- a/spec/lib/msf/core/exploit/http/joomla/base_spec.rb +++ b/spec/lib/msf/core/exploit/http/joomla/base_spec.rb @@ -1,4 +1,3 @@ -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Joomla::Base do diff --git a/spec/lib/msf/core/exploit/http/joomla/version_spec.rb b/spec/lib/msf/core/exploit/http/joomla/version_spec.rb index e10d70a149..cdd3f1f1bd 100644 --- a/spec/lib/msf/core/exploit/http/joomla/version_spec.rb +++ b/spec/lib/msf/core/exploit/http/joomla/version_spec.rb @@ -1,4 +1,3 @@ -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Joomla::Version do subject do diff --git a/spec/lib/msf/core/exploit/http/typo3_spec.rb b/spec/lib/msf/core/exploit/http/typo3_spec.rb index cc046bcf84..b099cec511 100644 --- a/spec/lib/msf/core/exploit/http/typo3_spec.rb +++ b/spec/lib/msf/core/exploit/http/typo3_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Typo3 do subject do diff --git a/spec/lib/msf/core/exploit/http/wordpress/base_spec.rb b/spec/lib/msf/core/exploit/http/wordpress/base_spec.rb index c05dc71ad1..7d65a668d1 100644 --- a/spec/lib/msf/core/exploit/http/wordpress/base_spec.rb +++ b/spec/lib/msf/core/exploit/http/wordpress/base_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Wordpress::Base do subject do diff --git a/spec/lib/msf/core/exploit/http/wordpress/login_spec.rb b/spec/lib/msf/core/exploit/http/wordpress/login_spec.rb index d3286c82ea..214f9fc136 100644 --- a/spec/lib/msf/core/exploit/http/wordpress/login_spec.rb +++ b/spec/lib/msf/core/exploit/http/wordpress/login_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Wordpress::Login do subject do diff --git a/spec/lib/msf/core/exploit/http/wordpress/version_spec.rb b/spec/lib/msf/core/exploit/http/wordpress/version_spec.rb index ae6d46dcae..1324022c84 100644 --- a/spec/lib/msf/core/exploit/http/wordpress/version_spec.rb +++ b/spec/lib/msf/core/exploit/http/wordpress/version_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/http/response' RSpec.describe Msf::Exploit::Remote::HTTP::Wordpress::Version do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/as_request_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/as_request_spec.rb index da50c62ed2..f1ba7047f9 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/as_request_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/as_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::AsRequest do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/as_response_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/as_response_spec.rb index 6e7faeb6db..cf2457fb6e 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/as_response_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/as_response_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::AsResponse do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/base_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/base_spec.rb index aa80d7bd2b..6cd12cbb0d 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/base_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/base_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::Base do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/cache_credential_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/cache_credential_spec.rb index a2f3e63f59..fb21813b61 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/cache_credential_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/cache_credential_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::CacheCredential do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/pac_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/pac_spec.rb index cf5d906654..4ae3d86ab6 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/pac_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/pac_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::Pac do subject do diff --git a/spec/lib/msf/core/exploit/kerberos/client/tgs_request_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/tgs_request_spec.rb index 2c792f74df..5d0b276227 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/tgs_request_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/tgs_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::TgsRequest do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/kerberos/client/tgs_response_spec.rb b/spec/lib/msf/core/exploit/kerberos/client/tgs_response_spec.rb index 30f5be3156..6336ddb0a5 100644 --- a/spec/lib/msf/core/exploit/kerberos/client/tgs_response_spec.rb +++ b/spec/lib/msf/core/exploit/kerberos/client/tgs_response_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Msf::Exploit::Remote::Kerberos::Client::TgsResponse do subject do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/builder_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/builder_spec.rb index e9e76b0f5b..ff5d844b6f 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/builder_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/builder_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Builder do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection/builder_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection/builder_spec.rb index 2b2881732a..e0b8e7c524 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection/builder_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection/builder_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' require 'stringio' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Jmx::Connection::Builder do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection_spec.rb index fae4079037..8ad8824c18 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/connection_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Jmx::Connection do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/builder_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/builder_spec.rb index b530bf6912..efbcc0c35c 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/builder_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/builder_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' require 'stringio' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Jmx::Server::Builder do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/parser_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/parser_spec.rb index 6caf128bca..1951689264 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/parser_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server/parser_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Jmx::Server::Parser do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server_spec.rb index 0c571c9d15..1972d6f521 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/jmx/server_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Jmx::Server do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/builder_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/builder_spec.rb index 09946e6c2e..a8551c9b7a 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/builder_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/builder_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe ::Msf::Exploit::Remote::Java::Rmi::Client::Registry::Builder do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/parser_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/parser_spec.rb index feb14d97dd..66c777ae0b 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/parser_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry/parser_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Registry::Parser do subject(:mod) do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry_spec.rb index 2a9cc3026c..c3bb9eb265 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client/registry_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client/registry_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client::Registry do diff --git a/spec/lib/msf/core/exploit/remote/java/rmi/client_spec.rb b/spec/lib/msf/core/exploit/remote/java/rmi/client_spec.rb index b4e0d6b0ae..d9a9b0ac02 100644 --- a/spec/lib/msf/core/exploit/remote/java/rmi/client_spec.rb +++ b/spec/lib/msf/core/exploit/remote/java/rmi/client_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'rex/java/serialization' -require 'rex/proto/rmi' RSpec.describe Msf::Exploit::Remote::Java::Rmi::Client do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/negotiate_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/negotiate_spec.rb index d39e5b333f..30dc81a2ab 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/negotiate_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/negotiate_spec.rb @@ -2,7 +2,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/nt_create_andx_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/nt_create_andx_spec.rb index 86a09150fe..b0b46de57b 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/nt_create_andx_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/nt_create_andx_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/read_andx_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/read_andx_spec.rb index 2c33ecceb3..e7ca343ec8 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/read_andx_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/read_andx_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/session_setup_andx_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/session_setup_andx_spec.rb index e14dfe35eb..d2d5540f45 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/session_setup_andx_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/session_setup_andx_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/find_first2_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/find_first2_spec.rb index f51b99d8ab..c7eb9a1305 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/find_first2_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/find_first2_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_file_information_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_file_information_spec.rb index 610283a2b9..9368d0ab8e 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_file_information_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_file_information_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_path_information_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_path_information_spec.rb index 5d06666917..47cdab0f4e 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_path_information_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/trans2/query_path_information_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/command/trans2_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/command/trans2_spec.rb index 08b61d67cf..9298c35026 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/command/trans2_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/command/trans2_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/information_level/find_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/information_level/find_spec.rb index a4cbbd6819..f367ee9502 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/information_level/find_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/information_level/find_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/msf/core/exploit/smb/server/share/information_level/query_spec.rb b/spec/lib/msf/core/exploit/smb/server/share/information_level/query_spec.rb index 34521ce654..02aae72776 100644 --- a/spec/lib/msf/core/exploit/smb/server/share/information_level/query_spec.rb +++ b/spec/lib/msf/core/exploit/smb/server/share/information_level/query_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/smb/constants' RSpec.describe Msf::Exploit::Remote::SMB::Server::Share do diff --git a/spec/lib/net/dns/names/names_spec.rb b/spec/lib/net/dns/names/names_spec.rb index 78ef0994d5..7846616e73 100644 --- a/spec/lib/net/dns/names/names_spec.rb +++ b/spec/lib/net/dns/names/names_spec.rb @@ -1,3 +1,4 @@ +require 'net/dns' RSpec.describe Net::DNS::Names do subject do @@ -125,4 +126,4 @@ RSpec.describe Net::DNS::Names do end end end -end \ No newline at end of file +end diff --git a/spec/lib/rex/mac_oui_spec.rb b/spec/lib/rex/mac_oui_spec.rb index 744470527f..a34174387f 100644 --- a/spec/lib/rex/mac_oui_spec.rb +++ b/spec/lib/rex/mac_oui_spec.rb @@ -1,8 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/mac_oui' - RSpec.describe Rex::Oui do describe ".lookup_oui_fullname" do subject(:oui_fullname) { described_class.lookup_oui_fullname(mac) } diff --git a/spec/lib/rex/parser/fs/bitlocker_spec.rb b/spec/lib/rex/parser/fs/bitlocker_spec.rb index b7bb507eb9..8db7b8ee39 100644 --- a/spec/lib/rex/parser/fs/bitlocker_spec.rb +++ b/spec/lib/rex/parser/fs/bitlocker_spec.rb @@ -1,4 +1,3 @@ -require 'rex/parser/fs/bitlocker' volume_header = [%( eb58902d4656452d46532d00020800000000000000f800003f00ff008000010000000000e01f0000 diff --git a/spec/lib/rex/parser/group_policy_preferences_spec.rb b/spec/lib/rex/parser/group_policy_preferences_spec.rb index f0f1718974..838dcdfc75 100644 --- a/spec/lib/rex/parser/group_policy_preferences_spec.rb +++ b/spec/lib/rex/parser/group_policy_preferences_spec.rb @@ -1,5 +1,4 @@ # encoding: binary -require 'rex/parser/group_policy_preferences' xml_group = ' diff --git a/spec/lib/rex/parser/ini_spec.rb b/spec/lib/rex/parser/ini_spec.rb index a1ecba7b15..67bcd3b32c 100644 --- a/spec/lib/rex/parser/ini_spec.rb +++ b/spec/lib/rex/parser/ini_spec.rb @@ -1,4 +1,3 @@ -require 'rex/parser/ini' RSpec.describe Rex::Parser::Ini do let(:ini_contents) { < false Fabrikam.com Password1 MyUserName %MACHINENAME% ') diff --git a/spec/lib/rex/parser/winscp_spec.rb b/spec/lib/rex/parser/winscp_spec.rb index 7aff5ed1b6..3458c57496 100644 --- a/spec/lib/rex/parser/winscp_spec.rb +++ b/spec/lib/rex/parser/winscp_spec.rb @@ -1,4 +1,3 @@ -require 'rex/parser/winscp' INI_SECURITY = "[Configuration\\Security]\nUseMasterPassword=1\nMasterPasswordVerifier=\n" diff --git a/spec/lib/rex/payloads/meterpreter/uri_checksum_spec.rb b/spec/lib/rex/payloads/meterpreter/uri_checksum_spec.rb index f5fedf83c1..b4fca092c0 100644 --- a/spec/lib/rex/payloads/meterpreter/uri_checksum_spec.rb +++ b/spec/lib/rex/payloads/meterpreter/uri_checksum_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'rex/payloads/meterpreter/uri_checksum' RSpec.describe Rex::Payloads::Meterpreter::UriChecksum do class DummyClass diff --git a/spec/lib/rex/post/meterpreter/extensions/stdapi/ui_spec.rb b/spec/lib/rex/post/meterpreter/extensions/stdapi/ui_spec.rb index 2a09834221..78e0a0b048 100644 --- a/spec/lib/rex/post/meterpreter/extensions/stdapi/ui_spec.rb +++ b/spec/lib/rex/post/meterpreter/extensions/stdapi/ui_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -require 'rex/post/meterpreter' + require 'rex/post/meterpreter/extensions/stdapi/ui' RSpec.describe Rex::Post::Meterpreter::Extensions::Stdapi::UI do diff --git a/spec/lib/rex/post/meterpreter_spec.rb b/spec/lib/rex/post/meterpreter_spec.rb index a3967a885d..9162ab1d3a 100644 --- a/spec/lib/rex/post/meterpreter_spec.rb +++ b/spec/lib/rex/post/meterpreter_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -require 'rex/post/meterpreter' +require 'metasploit-payloads' RSpec.describe MetasploitPayloads do it 'is available' do diff --git a/spec/lib/rex/proto/acpp/message_spec.rb b/spec/lib/rex/proto/acpp/message_spec.rb index b1860a7bc9..9515b5bd5a 100644 --- a/spec/lib/rex/proto/acpp/message_spec.rb +++ b/spec/lib/rex/proto/acpp/message_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/acpp' RSpec.describe Rex::Proto::ACPP::Message do diff --git a/spec/lib/rex/proto/http/client_request_spec.rb b/spec/lib/rex/proto/http/client_request_spec.rb index 082056803d..57454b1cf0 100644 --- a/spec/lib/rex/proto/http/client_request_spec.rb +++ b/spec/lib/rex/proto/http/client_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/http/client_request' RSpec.shared_context "with no evasions" do diff --git a/spec/lib/rex/proto/http/client_spec.rb b/spec/lib/rex/proto/http/client_spec.rb index e3d1a60c15..41d6a7a68c 100644 --- a/spec/lib/rex/proto/http/client_spec.rb +++ b/spec/lib/rex/proto/http/client_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/http/client' # Note: Some of these tests require a failed # connection to 127.0.0.1:1. If you have some crazy local diff --git a/spec/lib/rex/proto/http/packet/header_spec.rb b/spec/lib/rex/proto/http/packet/header_spec.rb index 62610db6e8..368b67b9a0 100644 --- a/spec/lib/rex/proto/http/packet/header_spec.rb +++ b/spec/lib/rex/proto/http/packet/header_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' -require 'rex/proto/http/packet/header' RSpec.describe Rex::Proto::Http::Packet::Header do diff --git a/spec/lib/rex/proto/http/packet_spec.rb b/spec/lib/rex/proto/http/packet_spec.rb index fb3ebede91..f052f753b9 100644 --- a/spec/lib/rex/proto/http/packet_spec.rb +++ b/spec/lib/rex/proto/http/packet_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' -require 'rex/proto/http/packet' RSpec.describe Rex::Proto::Http::Packet do it_behaves_like "hash with insensitive keys" diff --git a/spec/lib/rex/proto/http/response_spec.rb b/spec/lib/rex/proto/http/response_spec.rb index 2fc0869dbf..a65bbde91b 100644 --- a/spec/lib/rex/proto/http/response_spec.rb +++ b/spec/lib/rex/proto/http/response_spec.rb @@ -1,4 +1,3 @@ -require 'rex/proto/http/response' require 'nokogiri' RSpec.describe Rex::Proto::Http::Response do diff --git a/spec/lib/rex/proto/kademlia/bootstrap_request_spec.rb b/spec/lib/rex/proto/kademlia/bootstrap_request_spec.rb index 8153550cea..9ebb5039c1 100644 --- a/spec/lib/rex/proto/kademlia/bootstrap_request_spec.rb +++ b/spec/lib/rex/proto/kademlia/bootstrap_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/kademlia/bootstrap_request' RSpec.describe Rex::Proto::Kademlia::BootstrapRequest do subject(:bootstrap) do diff --git a/spec/lib/rex/proto/kademlia/bootstrap_response_spec.rb b/spec/lib/rex/proto/kademlia/bootstrap_response_spec.rb index 87a1dd0881..f8e416ce51 100644 --- a/spec/lib/rex/proto/kademlia/bootstrap_response_spec.rb +++ b/spec/lib/rex/proto/kademlia/bootstrap_response_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/kademlia/bootstrap_response' RSpec.describe Rex::Proto::Kademlia::BootstrapResponse do describe '#from_data' do diff --git a/spec/lib/rex/proto/kademlia/message_spec.rb b/spec/lib/rex/proto/kademlia/message_spec.rb index ad03c15e65..52683e0472 100644 --- a/spec/lib/rex/proto/kademlia/message_spec.rb +++ b/spec/lib/rex/proto/kademlia/message_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/kademlia/message' RSpec.describe Rex::Proto::Kademlia::Message do diff --git a/spec/lib/rex/proto/kademlia/ping_spec.rb b/spec/lib/rex/proto/kademlia/ping_spec.rb index 7c9ffd432c..c692f57075 100644 --- a/spec/lib/rex/proto/kademlia/ping_spec.rb +++ b/spec/lib/rex/proto/kademlia/ping_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/kademlia/ping' RSpec.describe Rex::Proto::Kademlia::Ping do subject(:ping) do diff --git a/spec/lib/rex/proto/kademlia/pong_spec.rb b/spec/lib/rex/proto/kademlia/pong_spec.rb index fff0b1dcc6..b7075ca9c0 100644 --- a/spec/lib/rex/proto/kademlia/pong_spec.rb +++ b/spec/lib/rex/proto/kademlia/pong_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/kademlia/pong' RSpec.describe Rex::Proto::Kademlia::Pong do let(:port) { 12345 } diff --git a/spec/lib/rex/proto/kademlia/util_spec.rb b/spec/lib/rex/proto/kademlia/util_spec.rb index e81f0896bb..e8490adc3a 100644 --- a/spec/lib/rex/proto/kademlia/util_spec.rb +++ b/spec/lib/rex/proto/kademlia/util_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- # require 'spec_helper' -require 'rex/proto/kademlia/util' RSpec.describe Rex::Proto::Kademlia do diff --git a/spec/lib/rex/proto/kerberos/client_spec.rb b/spec/lib/rex/proto/kerberos/client_spec.rb index b4b3c17654..7fced2d01d 100644 --- a/spec/lib/rex/proto/kerberos/client_spec.rb +++ b/spec/lib/rex/proto/kerberos/client_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/kerberos' class MyStringIO < StringIO def put(data) diff --git a/spec/lib/rex/proto/kerberos/credential_cache/cache_spec.rb b/spec/lib/rex/proto/kerberos/credential_cache/cache_spec.rb index 0844fb0dee..900cb88783 100644 --- a/spec/lib/rex/proto/kerberos/credential_cache/cache_spec.rb +++ b/spec/lib/rex/proto/kerberos/credential_cache/cache_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::CredentialCache::Cache do diff --git a/spec/lib/rex/proto/kerberos/credential_cache/credential_spec.rb b/spec/lib/rex/proto/kerberos/credential_cache/credential_spec.rb index 682d9f297f..e815e647b2 100644 --- a/spec/lib/rex/proto/kerberos/credential_cache/credential_spec.rb +++ b/spec/lib/rex/proto/kerberos/credential_cache/credential_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::CredentialCache::Credential do diff --git a/spec/lib/rex/proto/kerberos/credential_cache/key_block.rb b/spec/lib/rex/proto/kerberos/credential_cache/key_block.rb index 651810a206..9decababe2 100644 --- a/spec/lib/rex/proto/kerberos/credential_cache/key_block.rb +++ b/spec/lib/rex/proto/kerberos/credential_cache/key_block.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::CredentialCache::KeyBlock do @@ -24,4 +23,4 @@ RSpec.describe Rex::Proto::Kerberos::CredentialCache::KeyBlock do expect(key_block.encode).to eq(sample) end end -end \ No newline at end of file +end diff --git a/spec/lib/rex/proto/kerberos/credential_cache/principal_spec.rb b/spec/lib/rex/proto/kerberos/credential_cache/principal_spec.rb index 653c2601e1..9aa5fa6b82 100644 --- a/spec/lib/rex/proto/kerberos/credential_cache/principal_spec.rb +++ b/spec/lib/rex/proto/kerberos/credential_cache/principal_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::CredentialCache::Principal do @@ -25,4 +24,4 @@ RSpec.describe Rex::Proto::Kerberos::CredentialCache::Principal do expect(principal.encode).to eq(sample) end end -end \ No newline at end of file +end diff --git a/spec/lib/rex/proto/kerberos/credential_cache/time_spec.rb b/spec/lib/rex/proto/kerberos/credential_cache/time_spec.rb index 2f419c3591..7a0a4de0be 100644 --- a/spec/lib/rex/proto/kerberos/credential_cache/time_spec.rb +++ b/spec/lib/rex/proto/kerberos/credential_cache/time_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::CredentialCache::Time do @@ -24,4 +23,4 @@ RSpec.describe Rex::Proto::Kerberos::CredentialCache::Time do expect(time.encode).to eq(sample) end end -end \ No newline at end of file +end diff --git a/spec/lib/rex/proto/kerberos/model/ap_req_spec.rb b/spec/lib/rex/proto/kerberos/model/ap_req_spec.rb index 9c9f547882..0d7d70b0d1 100644 --- a/spec/lib/rex/proto/kerberos/model/ap_req_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/ap_req_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::ApReq do diff --git a/spec/lib/rex/proto/kerberos/model/authenticator_spec.rb b/spec/lib/rex/proto/kerberos/model/authenticator_spec.rb index f341672f27..d972c796c4 100644 --- a/spec/lib/rex/proto/kerberos/model/authenticator_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/authenticator_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::Authenticator do diff --git a/spec/lib/rex/proto/kerberos/model/authorization_data_spec.rb b/spec/lib/rex/proto/kerberos/model/authorization_data_spec.rb index 67b24aad1e..7613c976ed 100644 --- a/spec/lib/rex/proto/kerberos/model/authorization_data_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/authorization_data_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::AuthorizationData do diff --git a/spec/lib/rex/proto/kerberos/model/checksum_spec.rb b/spec/lib/rex/proto/kerberos/model/checksum_spec.rb index 310fb4c785..2f63df1a92 100644 --- a/spec/lib/rex/proto/kerberos/model/checksum_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/checksum_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::Checksum do diff --git a/spec/lib/rex/proto/kerberos/model/enc_kdc_response_spec.rb b/spec/lib/rex/proto/kerberos/model/enc_kdc_response_spec.rb index 2166aa1c1f..c5300ae01e 100644 --- a/spec/lib/rex/proto/kerberos/model/enc_kdc_response_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/enc_kdc_response_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::EncKdcResponse do diff --git a/spec/lib/rex/proto/kerberos/model/encrypted_data_spec.rb b/spec/lib/rex/proto/kerberos/model/encrypted_data_spec.rb index cdbc0d5b00..213ac8d329 100644 --- a/spec/lib/rex/proto/kerberos/model/encrypted_data_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/encrypted_data_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' require 'openssl' require 'rex/text' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::EncryptedData do diff --git a/spec/lib/rex/proto/kerberos/model/kdc_request_body_spec.rb b/spec/lib/rex/proto/kerberos/model/kdc_request_body_spec.rb index 93715575f5..e1943edf1a 100644 --- a/spec/lib/rex/proto/kerberos/model/kdc_request_body_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/kdc_request_body_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::KdcRequestBody do diff --git a/spec/lib/rex/proto/kerberos/model/kdc_request_spec.rb b/spec/lib/rex/proto/kerberos/model/kdc_request_spec.rb index c27e55e614..4bfd092a93 100644 --- a/spec/lib/rex/proto/kerberos/model/kdc_request_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/kdc_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::KdcRequest do diff --git a/spec/lib/rex/proto/kerberos/model/kdc_response_spec.rb b/spec/lib/rex/proto/kerberos/model/kdc_response_spec.rb index 4e04a81c5a..c7c70b6811 100644 --- a/spec/lib/rex/proto/kerberos/model/kdc_response_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/kdc_response_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::KdcResponse do diff --git a/spec/lib/rex/proto/kerberos/model/krb_error_spec.rb b/spec/lib/rex/proto/kerberos/model/krb_error_spec.rb index c73fb9b6bf..6f28ce1dbc 100644 --- a/spec/lib/rex/proto/kerberos/model/krb_error_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/krb_error_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::KrbError do diff --git a/spec/lib/rex/proto/kerberos/model/pre_auth_data_spec.rb b/spec/lib/rex/proto/kerberos/model/pre_auth_data_spec.rb index 475413453e..3e3433f906 100644 --- a/spec/lib/rex/proto/kerberos/model/pre_auth_data_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/pre_auth_data_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::PreAuthData do diff --git a/spec/lib/rex/proto/kerberos/model/pre_auth_enc_time_stamp_spec.rb b/spec/lib/rex/proto/kerberos/model/pre_auth_enc_time_stamp_spec.rb index e0289c6471..30579262af 100644 --- a/spec/lib/rex/proto/kerberos/model/pre_auth_enc_time_stamp_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/pre_auth_enc_time_stamp_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::PreAuthEncTimeStamp do diff --git a/spec/lib/rex/proto/kerberos/model/pre_auth_pac_request_spec.rb b/spec/lib/rex/proto/kerberos/model/pre_auth_pac_request_spec.rb index 062a287755..94c4766b67 100644 --- a/spec/lib/rex/proto/kerberos/model/pre_auth_pac_request_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/pre_auth_pac_request_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::PreAuthPacRequest do diff --git a/spec/lib/rex/proto/kerberos/model/principal_name_spec.rb b/spec/lib/rex/proto/kerberos/model/principal_name_spec.rb index 31c32aa30a..4ec46713a8 100644 --- a/spec/lib/rex/proto/kerberos/model/principal_name_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/principal_name_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::PrincipalName do diff --git a/spec/lib/rex/proto/kerberos/model/ticket_spec.rb b/spec/lib/rex/proto/kerberos/model/ticket_spec.rb index 769dff4f3a..6d2ac4d892 100644 --- a/spec/lib/rex/proto/kerberos/model/ticket_spec.rb +++ b/spec/lib/rex/proto/kerberos/model/ticket_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Model::Ticket do diff --git a/spec/lib/rex/proto/kerberos/pac/client_info_spec.rb b/spec/lib/rex/proto/kerberos/pac/client_info_spec.rb index 2f3155b0c0..10244df38a 100644 --- a/spec/lib/rex/proto/kerberos/pac/client_info_spec.rb +++ b/spec/lib/rex/proto/kerberos/pac/client_info_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Pac::ClientInfo do diff --git a/spec/lib/rex/proto/kerberos/pac/logon_info_spec.rb b/spec/lib/rex/proto/kerberos/pac/logon_info_spec.rb index 26a6388462..7749824faf 100644 --- a/spec/lib/rex/proto/kerberos/pac/logon_info_spec.rb +++ b/spec/lib/rex/proto/kerberos/pac/logon_info_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Pac::LogonInfo do diff --git a/spec/lib/rex/proto/kerberos/pac/priv_srv_checksum_spec.rb b/spec/lib/rex/proto/kerberos/pac/priv_srv_checksum_spec.rb index 2071710266..0bb5522ba6 100644 --- a/spec/lib/rex/proto/kerberos/pac/priv_srv_checksum_spec.rb +++ b/spec/lib/rex/proto/kerberos/pac/priv_srv_checksum_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Pac::PrivSvrChecksum do diff --git a/spec/lib/rex/proto/kerberos/pac/server_checksum_spec.rb b/spec/lib/rex/proto/kerberos/pac/server_checksum_spec.rb index 7e8f6a144d..b6aaca3b5d 100644 --- a/spec/lib/rex/proto/kerberos/pac/server_checksum_spec.rb +++ b/spec/lib/rex/proto/kerberos/pac/server_checksum_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Pac::ServerChecksum do diff --git a/spec/lib/rex/proto/kerberos/pac/type_spec.rb b/spec/lib/rex/proto/kerberos/pac/type_spec.rb index 0f235952d1..b44aedc731 100644 --- a/spec/lib/rex/proto/kerberos/pac/type_spec.rb +++ b/spec/lib/rex/proto/kerberos/pac/type_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/proto/kerberos' RSpec.describe Rex::Proto::Kerberos::Pac::Type do diff --git a/spec/lib/rex/proto/mms/client_spec.rb b/spec/lib/rex/proto/mms/client_spec.rb index 256c66775f..faefcdb5af 100644 --- a/spec/lib/rex/proto/mms/client_spec.rb +++ b/spec/lib/rex/proto/mms/client_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/mms/model' RSpec.describe Rex::Proto::Mms::Client do diff --git a/spec/lib/rex/proto/mms/model/message_spec.rb b/spec/lib/rex/proto/mms/model/message_spec.rb index 61afbac436..3c45030bac 100644 --- a/spec/lib/rex/proto/mms/model/message_spec.rb +++ b/spec/lib/rex/proto/mms/model/message_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'rex/proto/mms/model' RSpec.describe Rex::Proto::Mms::Model::Message do diff --git a/spec/lib/rex/proto/mms/model/smtp_spec.rb b/spec/lib/rex/proto/mms/model/smtp_spec.rb index adcc06bb5b..520468efd9 100644 --- a/spec/lib/rex/proto/mms/model/smtp_spec.rb +++ b/spec/lib/rex/proto/mms/model/smtp_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/mms/model' RSpec.describe Rex::Proto::Mms::Model::Smtp do diff --git a/spec/lib/rex/proto/natpmp/packet_spec.rb b/spec/lib/rex/proto/natpmp/packet_spec.rb index fe9229ad8b..1692825569 100644 --- a/spec/lib/rex/proto/natpmp/packet_spec.rb +++ b/spec/lib/rex/proto/natpmp/packet_spec.rb @@ -1,7 +1,6 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/natpmp/packet' RSpec.describe Rex::Proto::NATPMP do subject do mod = Module.new diff --git a/spec/lib/rex/proto/ntp/modes_spec.rb b/spec/lib/rex/proto/ntp/modes_spec.rb index 73c9efdbb7..2e03a399fb 100644 --- a/spec/lib/rex/proto/ntp/modes_spec.rb +++ b/spec/lib/rex/proto/ntp/modes_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- # -require 'rex/proto/ntp/modes' RSpec.describe "Rex::Proto::NTP mode message handling" do before do diff --git a/spec/lib/rex/proto/nuuo/client_request_spec.rb b/spec/lib/rex/proto/nuuo/client_request_spec.rb index 9d27676054..d470a733b3 100644 --- a/spec/lib/rex/proto/nuuo/client_request_spec.rb +++ b/spec/lib/rex/proto/nuuo/client_request_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/nuuo/client_request' RSpec.describe Rex::Proto::Nuuo::ClientRequest do subject(:client_request) { diff --git a/spec/lib/rex/proto/nuuo/client_spec.rb b/spec/lib/rex/proto/nuuo/client_spec.rb index 9f0e4005ca..c7a5366eb9 100644 --- a/spec/lib/rex/proto/nuuo/client_spec.rb +++ b/spec/lib/rex/proto/nuuo/client_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/nuuo/client' RSpec.describe Rex::Proto::Nuuo::Client do subject(:client) { diff --git a/spec/lib/rex/proto/nuuo/response_spec.rb b/spec/lib/rex/proto/nuuo/response_spec.rb index 9f93563e73..1e2111f54b 100644 --- a/spec/lib/rex/proto/nuuo/response_spec.rb +++ b/spec/lib/rex/proto/nuuo/response_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/nuuo/response' RSpec.describe Rex::Proto::Nuuo::Response do subject(:response) {described_class.new} diff --git a/spec/lib/rex/proto/pjl/client_spec.rb b/spec/lib/rex/proto/pjl/client_spec.rb index 188a7af7a5..512185dcaa 100644 --- a/spec/lib/rex/proto/pjl/client_spec.rb +++ b/spec/lib/rex/proto/pjl/client_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' require 'msfenv' -require 'rex/proto/pjl' RSpec.describe Rex::Proto::PJL::Client do context "methods" do diff --git a/spec/lib/rex/proto/proxy/socks5/packet_spec.rb b/spec/lib/rex/proto/proxy/socks5/packet_spec.rb index 237960b4e4..7ec6d63845 100644 --- a/spec/lib/rex/proto/proxy/socks5/packet_spec.rb +++ b/spec/lib/rex/proto/proxy/socks5/packet_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/proxy/socks5/packet' RSpec.describe Rex::Proto::Proxy::Socks5::Packet do Socks5 = Rex::Proto::Proxy::Socks5 diff --git a/spec/lib/rex/proto/proxy/socks5/server_spec.rb b/spec/lib/rex/proto/proxy/socks5/server_spec.rb index 0b5409b40c..1cee5d5b95 100644 --- a/spec/lib/rex/proto/proxy/socks5/server_spec.rb +++ b/spec/lib/rex/proto/proxy/socks5/server_spec.rb @@ -1,5 +1,4 @@ # -*- coding:binary -*- -require 'rex/proto/proxy/socks5' RSpec.describe Rex::Proto::Proxy::Socks5::Server do diff --git a/spec/lib/rex/proto/quake/message_spec.rb b/spec/lib/rex/proto/quake/message_spec.rb index e7a37c919c..b07090eef5 100644 --- a/spec/lib/rex/proto/quake/message_spec.rb +++ b/spec/lib/rex/proto/quake/message_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/quake/message' RSpec.describe Rex::Proto::Quake do subject do diff --git a/spec/lib/rex/proto/rmi/model/call_data_spec.rb b/spec/lib/rex/proto/rmi/model/call_data_spec.rb index d9a7158a5f..84e098e23f 100644 --- a/spec/lib/rex/proto/rmi/model/call_data_spec.rb +++ b/spec/lib/rex/proto/rmi/model/call_data_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' require 'rex/java' RSpec.describe Rex::Proto::Rmi::Model::CallData do diff --git a/spec/lib/rex/proto/rmi/model/call_spec.rb b/spec/lib/rex/proto/rmi/model/call_spec.rb index b588eacc47..ca9ec4b67a 100644 --- a/spec/lib/rex/proto/rmi/model/call_spec.rb +++ b/spec/lib/rex/proto/rmi/model/call_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' require 'rex/java' RSpec.describe Rex::Proto::Rmi::Model::Call do diff --git a/spec/lib/rex/proto/rmi/model/continuation_spec.rb b/spec/lib/rex/proto/rmi/model/continuation_spec.rb index 128f2c6f91..f07ff442c8 100644 --- a/spec/lib/rex/proto/rmi/model/continuation_spec.rb +++ b/spec/lib/rex/proto/rmi/model/continuation_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::Continuation do diff --git a/spec/lib/rex/proto/rmi/model/dgc_ack_spec.rb b/spec/lib/rex/proto/rmi/model/dgc_ack_spec.rb index fbf0115b3e..bd70695361 100644 --- a/spec/lib/rex/proto/rmi/model/dgc_ack_spec.rb +++ b/spec/lib/rex/proto/rmi/model/dgc_ack_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::DgcAck do diff --git a/spec/lib/rex/proto/rmi/model/output_header_spec.rb b/spec/lib/rex/proto/rmi/model/output_header_spec.rb index f00a6e3a1d..076410366a 100644 --- a/spec/lib/rex/proto/rmi/model/output_header_spec.rb +++ b/spec/lib/rex/proto/rmi/model/output_header_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::OutputHeader do diff --git a/spec/lib/rex/proto/rmi/model/ping_ack_spec.rb b/spec/lib/rex/proto/rmi/model/ping_ack_spec.rb index 80ba8e80a5..4c5c8d36a9 100644 --- a/spec/lib/rex/proto/rmi/model/ping_ack_spec.rb +++ b/spec/lib/rex/proto/rmi/model/ping_ack_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::PingAck do diff --git a/spec/lib/rex/proto/rmi/model/ping_spec.rb b/spec/lib/rex/proto/rmi/model/ping_spec.rb index 62ee1c5aed..f645ab1b2f 100644 --- a/spec/lib/rex/proto/rmi/model/ping_spec.rb +++ b/spec/lib/rex/proto/rmi/model/ping_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::Ping do diff --git a/spec/lib/rex/proto/rmi/model/protocol_ack_spec.rb b/spec/lib/rex/proto/rmi/model/protocol_ack_spec.rb index a1c244e087..f11f65e551 100644 --- a/spec/lib/rex/proto/rmi/model/protocol_ack_spec.rb +++ b/spec/lib/rex/proto/rmi/model/protocol_ack_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' RSpec.describe Rex::Proto::Rmi::Model::ProtocolAck do diff --git a/spec/lib/rex/proto/rmi/model/return_data_spec.rb b/spec/lib/rex/proto/rmi/model/return_data_spec.rb index 9c2b4e0491..8c4f0c4fbc 100644 --- a/spec/lib/rex/proto/rmi/model/return_data_spec.rb +++ b/spec/lib/rex/proto/rmi/model/return_data_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' require 'rex/java' RSpec.describe Rex::Proto::Rmi::Model::ReturnData do diff --git a/spec/lib/rex/proto/rmi/model/return_value_spec.rb b/spec/lib/rex/proto/rmi/model/return_value_spec.rb index 29c54bf89d..2de0b08ca2 100644 --- a/spec/lib/rex/proto/rmi/model/return_value_spec.rb +++ b/spec/lib/rex/proto/rmi/model/return_value_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' require 'rex/java' RSpec.describe Rex::Proto::Rmi::Model::ReturnValue do diff --git a/spec/lib/rex/proto/rmi/model/unique_identifier_spec.rb b/spec/lib/rex/proto/rmi/model/unique_identifier_spec.rb index 21f3252d45..edadcd86e5 100644 --- a/spec/lib/rex/proto/rmi/model/unique_identifier_spec.rb +++ b/spec/lib/rex/proto/rmi/model/unique_identifier_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'stringio' -require 'rex/proto/rmi' require 'rex/java' RSpec.describe Rex::Proto::Rmi::Model::UniqueIdentifier do diff --git a/spec/lib/rex/proto/sip/response_spec.rb b/spec/lib/rex/proto/sip/response_spec.rb index c614a9488d..3a63a58e96 100644 --- a/spec/lib/rex/proto/sip/response_spec.rb +++ b/spec/lib/rex/proto/sip/response_spec.rb @@ -1,7 +1,5 @@ # -*- coding: binary -*- -require 'rex/proto/sip/response' - RSpec.describe 'Rex::Proto::SIP::Response parsing' do describe 'Parses vaild responses correctly' do specify do diff --git a/spec/lib/rex/proto/sms/client_spec.rb b/spec/lib/rex/proto/sms/client_spec.rb index 8ba71b0ed9..a1b12660d2 100644 --- a/spec/lib/rex/proto/sms/client_spec.rb +++ b/spec/lib/rex/proto/sms/client_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/sms/model' RSpec.describe Rex::Proto::Sms::Client do diff --git a/spec/lib/rex/proto/sms/model/message_spec.rb b/spec/lib/rex/proto/sms/model/message_spec.rb index c5ded81907..ca083b1e52 100644 --- a/spec/lib/rex/proto/sms/model/message_spec.rb +++ b/spec/lib/rex/proto/sms/model/message_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'rex/proto/sms/model' RSpec.describe Rex::Proto::Sms::Model::Message do diff --git a/spec/lib/rex/proto/sms/model/smtp_spec.rb b/spec/lib/rex/proto/sms/model/smtp_spec.rb index 48b7a2b9bb..436f693502 100644 --- a/spec/lib/rex/proto/sms/model/smtp_spec.rb +++ b/spec/lib/rex/proto/sms/model/smtp_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/sms/model' RSpec.describe Rex::Proto::Sms::Model::Smtp do diff --git a/spec/lib/rex/proto/steam/message_spec.rb b/spec/lib/rex/proto/steam/message_spec.rb index 83bf29f146..4837f081a8 100644 --- a/spec/lib/rex/proto/steam/message_spec.rb +++ b/spec/lib/rex/proto/steam/message_spec.rb @@ -1,6 +1,5 @@ # -*- coding: binary -*- require 'spec_helper' -require 'rex/proto/steam/message' RSpec.describe Rex::Proto::Steam do subject(:steam) do diff --git a/spec/lib/rex/time_spec.rb b/spec/lib/rex/time_spec.rb index f592f105b9..2b6894e8ff 100644 --- a/spec/lib/rex/time_spec.rb +++ b/spec/lib/rex/time_spec.rb @@ -1,7 +1,6 @@ # -*- coding:binary -*- require 'spec_helper' -require 'rex/time' RSpec.describe Rex::ExtTime do diff --git a/spec/tools/md5_lookup_spec.rb b/spec/tools/md5_lookup_spec.rb index 79117ad7c2..ad0afe6901 100644 --- a/spec/tools/md5_lookup_spec.rb +++ b/spec/tools/md5_lookup_spec.rb @@ -1,7 +1,6 @@ load Metasploit::Framework.root.join('tools/password/md5_lookup.rb').to_path require 'spec_helper' -require 'rex/proto/http/response' require 'stringio' RSpec.describe Md5LookupUtility do diff --git a/tools/exploit/metasm_shell.rb b/tools/exploit/metasm_shell.rb index 784717c1ef..b4281b8581 100755 --- a/tools/exploit/metasm_shell.rb +++ b/tools/exploit/metasm_shell.rb @@ -31,7 +31,6 @@ require 'msfenv' $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] require 'rex' -require 'rex/ui' require 'metasm' #PowerPC, seems broken for now in metasm diff --git a/tools/exploit/nasm_shell.rb b/tools/exploit/nasm_shell.rb index 010a0298aa..7187ef0a76 100755 --- a/tools/exploit/nasm_shell.rb +++ b/tools/exploit/nasm_shell.rb @@ -21,7 +21,6 @@ $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] require 'msfenv' require 'rex' -require 'rex/ui' # Check to make sure nasm is installed and reachable through the user's PATH. begin diff --git a/tools/exploit/psexec.rb b/tools/exploit/psexec.rb index 20413fbe68..5766f28dc5 100755 --- a/tools/exploit/psexec.rb +++ b/tools/exploit/psexec.rb @@ -23,11 +23,7 @@ $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] require 'rex' -require 'rex/proto/smb' -require 'rex/proto/ntlm' -require 'rex/proto/dcerpc' require 'rex/encoder/ndr' -require 'rex/proto/smb/simpleclient' def print_error(msg) diff --git a/tools/password/lm2ntcrack.rb b/tools/password/lm2ntcrack.rb index 0a1cb60c8e..01a2e0663c 100755 --- a/tools/password/lm2ntcrack.rb +++ b/tools/password/lm2ntcrack.rb @@ -22,7 +22,6 @@ require 'msfenv' $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] require 'rex' -require 'rex/proto/ntlm/crypt' CRYPT = Rex::Proto::NTLM::Crypt diff --git a/tools/password/winscp_decrypt.rb b/tools/password/winscp_decrypt.rb index 5ef07b2999..34c1544e23 100755 --- a/tools/password/winscp_decrypt.rb +++ b/tools/password/winscp_decrypt.rb @@ -6,7 +6,6 @@ ## $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'rex/parser/winscp' exit unless ARGV.count == 1 diff --git a/tools/recon/google_geolocate_bssid.rb b/tools/recon/google_geolocate_bssid.rb index 80efae0a42..22a21e76c2 100755 --- a/tools/recon/google_geolocate_bssid.rb +++ b/tools/recon/google_geolocate_bssid.rb @@ -15,7 +15,6 @@ while File.symlink?(msfbase) end $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..','lib'))) -require 'rex/google/geolocation' require 'optparse' if ARGV.length < 2