msftidy run
This commit is contained in:
parent
9cbd759eab
commit
70b463b257
|
@ -71,7 +71,7 @@ class Socket
|
|||
res = create_tcp_client_channel( params )
|
||||
end
|
||||
elsif( params.udp? )
|
||||
res = create_udp_channel( params )
|
||||
res = create_udp_channel( params )
|
||||
end
|
||||
|
||||
return res
|
||||
|
|
|
@ -43,7 +43,7 @@ class Stdapi < Extension
|
|||
# can be directly referenced
|
||||
client.register_extension_aliases(
|
||||
[
|
||||
{
|
||||
{
|
||||
'name' => 'fs',
|
||||
'ext' => ObjectAliases.new(
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ class Stdapi < Extension
|
|||
'config' => Rex::Post::Meterpreter::Extensions::Stdapi::Net::Config.new(client),
|
||||
'socket' => Rex::Post::Meterpreter::Extensions::Stdapi::Net::Socket.new(client)
|
||||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
'name' => 'railgun',
|
||||
'ext' => Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Railgun.new(client)
|
||||
|
@ -146,4 +146,4 @@ class Stdapi < Extension
|
|||
end
|
||||
end
|
||||
|
||||
end; end; end; end; end
|
||||
end; end; end; end; end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Sys
|
|||
|
||||
###
|
||||
#
|
||||
# This class provides access to the Windows event log on the remote
|
||||
# This class provides access to the Windows event log on the remote
|
||||
# machine.
|
||||
#
|
||||
###
|
||||
|
@ -52,7 +52,7 @@ class EventLog
|
|||
attr_accessor :handle # :nodoc:
|
||||
attr_accessor :client # :nodoc:
|
||||
|
||||
public
|
||||
public
|
||||
|
||||
#
|
||||
# Initializes an instance of the eventlog manipulator.
|
||||
|
@ -182,7 +182,7 @@ class EventLog
|
|||
response = client.send_request(request, nil)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
# Instance method
|
||||
def close
|
||||
self.class.close(self.client, self.handle)
|
||||
|
|
|
@ -15,15 +15,15 @@ module EventLogSubsystem
|
|||
###
|
||||
class EventRecord
|
||||
|
||||
attr_reader :num, :generated, :written, :eventid,
|
||||
:type, :category, :strings, :data
|
||||
attr_reader :num, :generated, :written, :eventid
|
||||
attr_reader :type, :category, :strings, :data
|
||||
|
||||
protected
|
||||
|
||||
attr_writer :num, :generated, :written, :eventid,
|
||||
:type, :category, :strings, :data
|
||||
attr_writer :num, :generated, :written, :eventid
|
||||
attr_writer :type, :category, :strings, :data
|
||||
|
||||
public
|
||||
public
|
||||
|
||||
def initialize(recnum, timegen, timewri, id, type, cat, strs, data)
|
||||
self.num = recnum
|
||||
|
@ -38,4 +38,4 @@ class EventRecord
|
|||
|
||||
end
|
||||
|
||||
end end end end end end end
|
||||
end end end end end end end
|
||||
|
|
|
@ -22,17 +22,17 @@ class Memory
|
|||
|
||||
# Page protection translation hash
|
||||
@@page_protection_map =
|
||||
{
|
||||
{
|
||||
PROT_NONE => PAGE_NOACCESS,
|
||||
PROT_EXEC => PAGE_EXECUTE,
|
||||
PROT_EXEC | PROT_READ => PAGE_EXECUTE_READ,
|
||||
PROT_EXEC | PROT_READ |
|
||||
PROT_EXEC | PROT_READ |
|
||||
PROT_WRITE => PAGE_EXECUTE_READWRITE,
|
||||
PROT_EXEC | PROT_READ |
|
||||
PROT_EXEC | PROT_READ |
|
||||
PROT_WRITE | PROT_COW => PAGE_EXECUTE_WRITECOPY,
|
||||
PROT_READ => PAGE_READONLY,
|
||||
PROT_READ | PROT_WRITE => PAGE_READWRITE,
|
||||
PROT_READ | PROT_WRITE |
|
||||
PROT_READ | PROT_WRITE |
|
||||
PROT_COW => PAGE_WRITECOPY,
|
||||
PROT_WRITE => PAGE_READWRITE
|
||||
}
|
||||
|
@ -52,10 +52,10 @@ class Memory
|
|||
end
|
||||
|
||||
#
|
||||
# Allocate storage of the supplied length and returns the
|
||||
# Allocate storage of the supplied length and returns the
|
||||
# address at which the memory was allocated.
|
||||
#
|
||||
def allocate(length, protection = nil, base = nil)
|
||||
def allocate(length, protection = nil, base = nil)
|
||||
allocation_type = MEM_COMMIT
|
||||
|
||||
# If no protection was supplied, default to the most flexible
|
||||
|
@ -225,7 +225,7 @@ class Memory
|
|||
end
|
||||
|
||||
#
|
||||
# Lock a region of memory into physical memory so that it can't be
|
||||
# Lock a region of memory into physical memory so that it can't be
|
||||
# swapped to disk. This can only be done in the context of the
|
||||
# process that is running the meterpreter server. The instance's
|
||||
# handle is ignored.
|
||||
|
@ -242,7 +242,7 @@ class Memory
|
|||
end
|
||||
|
||||
#
|
||||
# Unloock a region of memory into physical memory so that it can be
|
||||
# Unloock a region of memory into physical memory so that it can be
|
||||
# swapped to disk. This can only be done in the context of the
|
||||
# process that is running the meterpreter server. The instance's
|
||||
# handle is ignored.
|
||||
|
@ -322,7 +322,7 @@ protected
|
|||
# Translates specific protection flags to general protection flags.
|
||||
#
|
||||
def specific_prot_to_gen(prot)
|
||||
|
||||
|
||||
if (prot == nil)
|
||||
return PAGE_READONLY
|
||||
end
|
||||
|
@ -333,4 +333,4 @@ protected
|
|||
attr_accessor :process # :nodoc:
|
||||
end
|
||||
|
||||
end; end; end; end; end; end; end
|
||||
end; end; end; end; end; end; end
|
||||
|
|
|
@ -97,7 +97,7 @@ class Thread
|
|||
request.add_tlv(TLV_TYPE_CREATION_FLAGS, creation_flags)
|
||||
|
||||
# Transmit the request
|
||||
response = process.client.send_request(request)
|
||||
response = process.client.send_request(request)
|
||||
|
||||
|
||||
thread_id = response.get_tlv_value(TLV_TYPE_THREAD_ID)
|
||||
|
@ -138,4 +138,4 @@ protected
|
|||
|
||||
end
|
||||
|
||||
end; end; end; end; end; end; end
|
||||
end; end; end; end; end; end; end
|
||||
|
|
|
@ -29,7 +29,7 @@ class RegistryKey
|
|||
self.base_key = base_key
|
||||
self.perm = perm
|
||||
self.hkey = hkey
|
||||
|
||||
|
||||
ObjectSpace.define_finalizer( self, self.class.finalize(self.client, self.hkey) )
|
||||
end
|
||||
|
||||
|
@ -110,9 +110,9 @@ class RegistryKey
|
|||
return client.sys.registry.close_key(hkey)
|
||||
end
|
||||
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
# Instance method for the same
|
||||
def close()
|
||||
self.class.close(self.client, self.hkey)
|
||||
|
|
|
@ -28,7 +28,7 @@ class RegistryValue
|
|||
self.name = name
|
||||
self.type = type
|
||||
self.data = data
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Sets the value's data.
|
||||
|
@ -99,4 +99,4 @@ protected
|
|||
attr_writer :hkey, :name, :type, :data # :nodoc:
|
||||
end
|
||||
|
||||
end; end; end; end; end; end; end
|
||||
end; end; end; end; end; end; end
|
||||
|
|
|
@ -28,7 +28,7 @@ class RemoteRegistryKey
|
|||
self.root_key = root_key
|
||||
self.target_host = target_host
|
||||
self.hkey = hkey
|
||||
|
||||
|
||||
ObjectSpace.define_finalizer( self, self.class.finalize(self.client, self.hkey) )
|
||||
end
|
||||
|
||||
|
@ -109,9 +109,9 @@ class RemoteRegistryKey
|
|||
return client.sys.registry.close_key(hkey)
|
||||
end
|
||||
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
# Instance method for the same
|
||||
def close()
|
||||
self.class.close(self.client, self.hkey)
|
||||
|
|
|
@ -13,7 +13,7 @@ module Sys
|
|||
|
||||
##
|
||||
#
|
||||
# This class implements the Rex::Post::Thread interface which
|
||||
# This class implements the Rex::Post::Thread interface which
|
||||
# wrappers a logical thread for a given process.
|
||||
#
|
||||
##
|
||||
|
@ -123,7 +123,7 @@ class Thread < Rex::Post::Thread
|
|||
# Add all of the register that we're setting
|
||||
regs_hash.each_key { |name|
|
||||
t = request.add_tlv(TLV_TYPE_REGISTER)
|
||||
|
||||
|
||||
t.add_tlv(TLV_TYPE_REGISTER_NAME, name)
|
||||
t.add_tlv(TLV_TYPE_REGISTER_VALUE_32, regs_hash[name])
|
||||
}
|
||||
|
@ -139,13 +139,13 @@ class Thread < Rex::Post::Thread
|
|||
def pretty_regs
|
||||
regs = query_regs
|
||||
|
||||
buf = sprintf("eax=%.8x ebx=%.8x ecx=%.8x edx=%.8x esi=%.8x edi=%.8x\n",
|
||||
buf = sprintf("eax=%.8x ebx=%.8x ecx=%.8x edx=%.8x esi=%.8x edi=%.8x\n",
|
||||
regs['eax'], regs['ebx'], regs['ecx'], regs['edx'], regs['esi'], regs['edi'])
|
||||
buf += sprintf("eip=%.8x esp=%.8x ebp=%.8x\n",
|
||||
regs['eip'], regs['esp'], regs['ebp'])
|
||||
buf += sprintf("cs=%.4x ss=%.4x ds=%.4x es=%.4x fs=%.4x gs=%.4x\n",
|
||||
regs['cs'], regs['ss'], regs['ds'], regs['es'], regs['fs'], regs['gs'])
|
||||
|
||||
|
||||
return buf
|
||||
end
|
||||
|
||||
|
@ -165,14 +165,14 @@ class Thread < Rex::Post::Thread
|
|||
handle = nil
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
# Instance method
|
||||
def close
|
||||
self.class.close(self.process.client, self.handle)
|
||||
end
|
||||
|
||||
attr_reader :process, :handle, :tid # :nodoc:
|
||||
protected
|
||||
protected
|
||||
attr_writer :process, :handle, :tid # :nodoc:
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue