Skip to content

Commit

Permalink
Land #17872, Ensure identify hashes helper is accessible to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 committed Apr 13, 2023
2 parents 7feeb25 + 8e2169e commit f9d5459
Show file tree
Hide file tree
Showing 31 changed files with 6 additions and 46 deletions.
4 changes: 1 addition & 3 deletions lib/msf/core/auxiliary/arista.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: binary -*-

require 'metasploit/framework/hashes'

module Msf
###
#
Expand Down Expand Up @@ -129,7 +127,7 @@ def arista_eos_config_eater(thost, tport, config)
cred[:username] = name
cred[:private_data] = hash

if framework.db.active
if framework.db.active
create_credential_and_login(cred)
end
print_good(output)
Expand Down
2 changes: 0 additions & 2 deletions lib/msf/core/auxiliary/f5.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: binary -*-

require 'metasploit/framework/hashes'

module Msf
###
#
Expand Down
2 changes: 0 additions & 2 deletions lib/msf/core/auxiliary/juniper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: binary -*-

require 'metasploit/framework/hashes'

module Msf
###
#
Expand Down
2 changes: 0 additions & 2 deletions lib/msf/core/auxiliary/vyos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: binary -*-

require 'metasploit/framework/hashes'

module Msf
###
#
Expand Down
5 changes: 4 additions & 1 deletion lib/msf_autoload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def custom_inflections
def config_paths
[
{ path: "#{__dir__}/msf/", namespace: Msf },
{ path: "#{__dir__}/rex/", namespace: Rex },
{ path: "#{__dir__}/rex/", namespace: Rex }
]
end

Expand Down Expand Up @@ -334,3 +334,6 @@ def finalize_loader(loader)
autoload :RubySMB, 'ruby_smb'

require 'rexml/document'

# XXX: Should be removed once the `lib/metasploit` folder is loaded by Zeitwerk
require 'metasploit/framework/hashes'
4 changes: 1 addition & 3 deletions modules/auxiliary/gather/ldap_hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::LDAP
Expand Down Expand Up @@ -212,7 +210,7 @@ def pillage(ldif, base_dn)
ltype.gsub!(/ /, '_')
ltype.gsub!(/,/, '.')
ltype.gsub!(/(ou=|fn=|cn=|o=|dc=|c=)/i, '')
ltype.gsub!(/[^a-z0-9._\-]+/i, '')
ltype.gsub!(/[^a-z0-9._-]+/i, '')
ltype = ltype.last(16)

ldif_filename = store_loot(
Expand Down
2 changes: 0 additions & 2 deletions modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::LDAP
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/gather/windows_secrets_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'
require 'ruby_smb/dcerpc/client'

class MetasploitModule < Msf::Auxiliary
Expand Down
2 changes: 0 additions & 2 deletions modules/auxiliary/gather/xymon_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Report
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/http/wp_abandoned_cart_sqli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
##

require 'rex/zip'
require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HTTP::Wordpress
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/http/wp_chopslider_id_sqli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/http/wp_email_sub_news_sqli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/http/wp_learnpress_sqli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/http/wp_loginizer_log_sqli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
2 changes: 0 additions & 2 deletions modules/auxiliary/server/capture/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::TcpServer
include Msf::Auxiliary::Report
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/server/capture/vnc.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'metasploit/framework/hashes'
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
Expand Down
2 changes: 0 additions & 2 deletions modules/exploits/multi/http/cockpit_cms_rce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking

Expand Down
2 changes: 0 additions & 2 deletions modules/exploits/unix/http/cacti_filter_sqli_rce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking

Expand Down
2 changes: 0 additions & 2 deletions modules/post/bsd/gather/hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Linux::Priv
Expand Down
2 changes: 0 additions & 2 deletions modules/post/linux/gather/hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Linux::Priv
Expand Down
1 change: 0 additions & 1 deletion modules/post/linux/gather/mimipenguin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
##

require 'unix_crypt'
require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::Linux::Priv
Expand Down
1 change: 0 additions & 1 deletion modules/post/linux/gather/vcenter_secrets_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
##

require 'metasploit/framework/credential_collection'
require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::Common
Expand Down
2 changes: 0 additions & 2 deletions modules/post/solaris/gather/hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Solaris::Priv
Expand Down
1 change: 0 additions & 1 deletion modules/post/windows/escalate/golden_ticket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'metasploit/framework/hashes'

class MetasploitModule < Msf::Post
include Msf::Post::Windows::NetAPI
Expand Down
1 change: 0 additions & 1 deletion spec/lib/metasploit/framework/hashes/identify_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'spec_helper'
require 'metasploit/framework/hashes'
require 'bcrypt'

=begin
Expand Down

0 comments on commit f9d5459

Please sign in to comment.