Add a compat req and fix railgun mixin references

This commit is contained in:
Spencer McIntyre 2021-05-04 09:29:23 -04:00
parent fdf6f20e44
commit 50c013bcbb
3 changed files with 17 additions and 3 deletions

View File

@ -13,7 +13,7 @@ module WMIC
def initialize(info = {}) def initialize(info = {})
super(update_info( super(update_info(
info, info,
'Compat' => { 'Meterpreter' => { 'Commands' => %w{ stdapi_railgun_api* stdapi_sys_process_* } } } 'Compat' => { 'Meterpreter' => { 'Commands' => %w{ extapi_clipboard_[gs]et_data stdapi_railgun_api* stdapi_sys_process_* } } }
)) ))
register_options([ register_options([

View File

@ -8,7 +8,6 @@ class MetasploitModule < Msf::Post
include Msf::ModuleTest::PostTest include Msf::ModuleTest::PostTest
include Msf::Post::File include Msf::Post::File
include Msf::Post::Windows::FileInfo include Msf::Post::Windows::FileInfo
include Msf::Post::Windows::Railgun
def initialize(info={}) def initialize(info={})
super( update_info( info, super( update_info( info,

View File

@ -13,7 +13,6 @@ require 'module_test'
class MetasploitModule < Msf::Post class MetasploitModule < Msf::Post
include Msf::ModuleTest::PostTest include Msf::ModuleTest::PostTest
include Msf::Post::Windows::Railgun
def initialize(info={}) def initialize(info={})
super( update_info( info, super( update_info( info,
@ -34,6 +33,22 @@ class MetasploitModule < Msf::Post
end end
#
# Return an array of windows constants names matching +winconst+
#
def select_const_names(winconst, filter_regex=nil)
session.railgun.constant_manager.select_const_names(winconst, filter_regex)
end
#
# Returns an array of windows error code names for a given windows error code matching +err_code+
#
def lookup_error (err_code, filter_regex=nil)
select_const_names(err_code, /^ERROR_/).select do |name|
name =~ filter_regex
end
end
def test_static def test_static
it "should return a constant name given a const and a filter" do it "should return a constant name given a const and a filter" do