Land #7156, use windows_error gem for constants
commit
b027176799
|
@ -46,6 +46,7 @@ PATH
|
|||
sshkey
|
||||
tzinfo
|
||||
tzinfo-data
|
||||
windows_error
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
|
@ -278,6 +279,7 @@ GEM
|
|||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2016.6)
|
||||
tzinfo (>= 1.0.0)
|
||||
windows_error (0.0.2)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
yard (0.9.0)
|
||||
|
|
|
@ -16,6 +16,8 @@ require 'msf/sanity'
|
|||
# The framework-core depends on Rex
|
||||
require 'rex'
|
||||
require 'rex/ui'
|
||||
require 'rex/arch'
|
||||
include Rex::Arch
|
||||
|
||||
module Msf
|
||||
autoload :Author, 'msf/core/author'
|
||||
|
|
|
@ -120,3 +120,6 @@ require 'msf/core/exploit/kerberos/client'
|
|||
|
||||
# Fortinet
|
||||
require 'msf/core/exploit/fortinet'
|
||||
|
||||
# Other
|
||||
require 'msf/core/exploit/windows_constants'
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# -*- coding: binary -*-
|
||||
require 'rex/proto/dcerpc/svcctl'
|
||||
require 'windows_error'
|
||||
require 'windows_error/win32'
|
||||
|
||||
include WindowsError::Win32
|
||||
|
||||
module Msf
|
||||
|
||||
|
@ -13,7 +17,7 @@ module Msf
|
|||
|
||||
module Exploit::Remote::SMB::Client::Psexec
|
||||
|
||||
include Rex::Constants::Windows
|
||||
include Msf::Exploit::Windows_Constants
|
||||
include Msf::Exploit::Remote::DCERPC
|
||||
include Msf::Exploit::Remote::SMB::Client::Authenticated
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Rex::Constants
|
||||
module Windows
|
||||
module Msf
|
||||
module Exploit::Windows_Constants
|
||||
|
||||
##
|
||||
#
|
||||
|
@ -10,18 +10,6 @@ module Windows
|
|||
|
||||
STANDARD_RIGHTS_REQUIRED = 0x000F0000
|
||||
|
||||
##
|
||||
#
|
||||
# Errors
|
||||
#
|
||||
##
|
||||
|
||||
ERROR_SUCCESS = 0x0
|
||||
ERROR_FILE_NOT_FOUND = 0x2
|
||||
ERROR_ACCESS_DENIED = 0x5
|
||||
ERROR_SERVICE_REQUEST_TIMEOUT = 0x41D
|
||||
ERROR_SERVICE_EXISTS = 0x431
|
||||
|
||||
##
|
||||
#
|
||||
# SVCCTL Protocol Functions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
require 'msf/core'
|
||||
require 'msf/core/module/platform'
|
||||
require 'rex/constants'
|
||||
require 'rex/text'
|
||||
|
||||
#
|
||||
|
|
|
@ -59,7 +59,6 @@ require 'rex/struct2'
|
|||
require 'rex/ole'
|
||||
|
||||
# Generic classes
|
||||
require 'rex/constants'
|
||||
require 'rex/exceptions'
|
||||
require 'rex/transformer'
|
||||
require 'rex/random_identifier'
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
# -*- coding: binary -*-
|
||||
|
||||
#
|
||||
# Log severities
|
||||
#
|
||||
LOG_ERROR = 'error'
|
||||
LOG_DEBUG = 'debug'
|
||||
LOG_INFO = 'info'
|
||||
LOG_WARN = 'warn'
|
||||
LOG_RAW = 'raw'
|
||||
|
||||
##
|
||||
#
|
||||
# Log levels
|
||||
#
|
||||
##
|
||||
|
||||
#
|
||||
# LEV_0 - Default
|
||||
#
|
||||
# This log level is the default log level if none is specified. It should be
|
||||
# used when a log message should always be displayed when logging is enabled.
|
||||
# Very few log messages should occur at this level aside from necessary
|
||||
# information logging and error/warning logging. Debug logging at level zero
|
||||
# is not advised.
|
||||
#
|
||||
LEV_0 = 0
|
||||
|
||||
#
|
||||
# LEV_1 - Extra
|
||||
#
|
||||
# This log level should be used when extra information may be needed to
|
||||
# understand the cause of an error or warning message or to get debugging
|
||||
# information that might give clues as to why something is happening. This
|
||||
# log level should be used only when information may be useful to understanding
|
||||
# the behavior of something at a basic level. This log level should not be
|
||||
# used in an exhaustively verbose fashion.
|
||||
#
|
||||
LEV_1 = 1
|
||||
|
||||
#
|
||||
# LEV_2 - Verbose
|
||||
#
|
||||
# This log level should be used when verbose information may be needed to
|
||||
# analyze the behavior of the framework. This should be the default log
|
||||
# level for all detailed information not falling into LEV_0 or LEV_1.
|
||||
# It is recommended that this log level be used by default if you are
|
||||
# unsure.
|
||||
#
|
||||
LEV_2 = 2
|
||||
|
||||
#
|
||||
# LEV_3 - Insanity
|
||||
#
|
||||
# This log level should contain very verbose information about the
|
||||
# behavior of the framework, such as detailed information about variable
|
||||
# states at certain phases including, but not limited to, loop iterations,
|
||||
# function calls, and so on. This log level will rarely be displayed,
|
||||
# but when it is the information provided should make it easy to analyze
|
||||
# any problem.
|
||||
#
|
||||
LEV_3 = 3
|
||||
|
||||
|
||||
#
|
||||
# Architecture constants
|
||||
#
|
||||
ARCH_ANY = '_any_'
|
||||
ARCH_X86 = 'x86'
|
||||
ARCH_X86_64 = 'x86_64'
|
||||
ARCH_X64 = 'x64' # To be used for compatability with ARCH_X86_64
|
||||
ARCH_MIPS = 'mips'
|
||||
ARCH_MIPSLE = 'mipsle'
|
||||
ARCH_MIPSBE = 'mipsbe'
|
||||
ARCH_PPC = 'ppc'
|
||||
ARCH_PPC64 = 'ppc64'
|
||||
ARCH_CBEA = 'cbea'
|
||||
ARCH_CBEA64 = 'cbea64'
|
||||
ARCH_SPARC = 'sparc'
|
||||
ARCH_CMD = 'cmd'
|
||||
ARCH_PHP = 'php'
|
||||
ARCH_TTY = 'tty'
|
||||
ARCH_ARMLE = 'armle'
|
||||
ARCH_ARMBE = 'armbe'
|
||||
ARCH_JAVA = 'java'
|
||||
ARCH_RUBY = 'ruby'
|
||||
ARCH_DALVIK = 'dalvik'
|
||||
ARCH_PYTHON = 'python'
|
||||
ARCH_NODEJS = 'nodejs'
|
||||
ARCH_FIREFOX = 'firefox'
|
||||
ARCH_ZARCH = 'zarch'
|
||||
ARCH_TYPES =
|
||||
[
|
||||
ARCH_X86,
|
||||
ARCH_X86_64,
|
||||
ARCH_MIPS,
|
||||
ARCH_MIPSLE,
|
||||
ARCH_MIPSBE,
|
||||
ARCH_PPC,
|
||||
ARCH_PPC64,
|
||||
ARCH_CBEA,
|
||||
ARCH_CBEA64,
|
||||
ARCH_SPARC,
|
||||
ARCH_ARMLE,
|
||||
ARCH_ARMBE,
|
||||
ARCH_CMD,
|
||||
ARCH_PHP,
|
||||
ARCH_TTY,
|
||||
ARCH_JAVA,
|
||||
ARCH_RUBY,
|
||||
ARCH_DALVIK,
|
||||
ARCH_PYTHON,
|
||||
ARCH_NODEJS,
|
||||
ARCH_FIREFOX,
|
||||
ARCH_ZARCH,
|
||||
]
|
||||
|
||||
ARCH_ALL = ARCH_TYPES
|
||||
|
||||
#
|
||||
# Endian constants
|
||||
#
|
||||
ENDIAN_LITTLE = 0
|
||||
ENDIAN_BIG = 1
|
||||
|
||||
IS_ENDIAN_LITTLE = ( [1].pack('s') == "\x01\x00" ) ? true : false
|
||||
IS_ENDIAN_BIG = ( not IS_ENDIAN_LITTLE )
|
|
@ -1,4 +1,64 @@
|
|||
# -*- coding: binary -*-
|
||||
|
||||
require 'rex/constants' # for LEV_'s
|
||||
#
|
||||
# Log severities
|
||||
#
|
||||
LOG_ERROR = 'error'
|
||||
LOG_DEBUG = 'debug'
|
||||
LOG_INFO = 'info'
|
||||
LOG_WARN = 'warn'
|
||||
LOG_RAW = 'raw'
|
||||
|
||||
##
|
||||
#
|
||||
# Log levels
|
||||
#
|
||||
##
|
||||
|
||||
#
|
||||
# LEV_0 - Default
|
||||
#
|
||||
# This log level is the default log level if none is specified. It should be
|
||||
# used when a log message should always be displayed when logging is enabled.
|
||||
# Very few log messages should occur at this level aside from necessary
|
||||
# information logging and error/warning logging. Debug logging at level zero
|
||||
# is not advised.
|
||||
#
|
||||
LEV_0 = 0
|
||||
|
||||
#
|
||||
# LEV_1 - Extra
|
||||
#
|
||||
# This log level should be used when extra information may be needed to
|
||||
# understand the cause of an error or warning message or to get debugging
|
||||
# information that might give clues as to why something is happening. This
|
||||
# log level should be used only when information may be useful to understanding
|
||||
# the behavior of something at a basic level. This log level should not be
|
||||
# used in an exhaustively verbose fashion.
|
||||
#
|
||||
LEV_1 = 1
|
||||
|
||||
#
|
||||
# LEV_2 - Verbose
|
||||
#
|
||||
# This log level should be used when verbose information may be needed to
|
||||
# analyze the behavior of the framework. This should be the default log
|
||||
# level for all detailed information not falling into LEV_0 or LEV_1.
|
||||
# It is recommended that this log level be used by default if you are
|
||||
# unsure.
|
||||
#
|
||||
LEV_2 = 2
|
||||
|
||||
#
|
||||
# LEV_3 - Insanity
|
||||
#
|
||||
# This log level should contain very verbose information about the
|
||||
# behavior of the framework, such as detailed information about variable
|
||||
# states at certain phases including, but not limited to, loop iterations,
|
||||
# function calls, and so on. This log level will rarely be displayed,
|
||||
# but when it is the information provided should make it easy to analyze
|
||||
# any problem.
|
||||
#
|
||||
LEV_3 = 3
|
||||
|
||||
require 'rex/logging/log_dispatcher'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- coding: binary -*-
|
||||
require 'rex/constants'
|
||||
|
||||
module Rex
|
||||
module Logging
|
||||
|
|
|
@ -7,13 +7,16 @@ module Rex
|
|||
###
|
||||
module Proto::DCERPC::SVCCTL
|
||||
|
||||
require 'rex/constants/windows'
|
||||
require 'windows_error'
|
||||
require 'windows_error/win32'
|
||||
require 'msf/core/exploit/windows_constants'
|
||||
NDR = Rex::Encoder::NDR
|
||||
|
||||
|
||||
class Client
|
||||
|
||||
include Rex::Constants::Windows
|
||||
include WindowsError::Win32
|
||||
include Msf::Exploit::Windows_Constants
|
||||
|
||||
attr_accessor :dcerpc_client
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ Gem::Specification.new do |spec|
|
|||
spec.add_runtime_dependency 'sshkey'
|
||||
# BitStruct Library used for handling certain Protocol Header/Packet construction
|
||||
spec.add_runtime_dependency 'bit-struct'
|
||||
# Library for interpreting Windows error codes and strings
|
||||
spec.add_runtime_dependency 'windows_error'
|
||||
|
||||
#
|
||||
# Protocol Libraries
|
||||
|
|
Loading…
Reference in New Issue