Lucene search
K

Multi Gather Run Console Resource File

🗓️ 22 Mar 2011 23:04:41Reported by Carlos Perez <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 16 Views

This module reads and executes console commands from a specified resource file on a Meterpreter session

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

class MetasploitModule < Msf::Post

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Multi Gather Run Console Resource File',
        'Description' => %q{
          This module will read console commands from a resource file and
          execute the commands in the specified Meterpreter session.
        },
        'License' => MSF_LICENSE,
        'Author' => [ 'Carlos Perez <carlos_perez[at]darkoperator.com>'],
        'Platform' => [ 'win' ],
        'SessionTypes' => [ 'meterpreter' ]
      )
    )
    register_options(
      [

        OptString.new('RESOURCE', [true, 'Full path to resource file to read commands from.', nil]),

      ]
    )
  end

  # Run Method for when run command is issued
  def run
    print_status("Running module against #{sysinfo['Computer']}")
    if !::File.exist?(datastore['RESOURCE'])
      raise 'Resource File does not exist!'
    else
      ::File.open(datastore['RESOURCE'], 'rb').each_line do |cmd|
        next if cmd.strip.empty?
        next if cmd[0, 1] == '#'

        begin
          print_status "Running command #{cmd.chomp}"
          session.console.run_single(cmd.chomp)
        rescue ::Exception => e
          print_status("Error Running Command #{cmd.chomp}: #{e.class} #{e}")
        end
      end
    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

08 Feb 2023 13:47Current
7.2High risk
Vulners AI Score7.2
16