Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/rex/proto/dcerpc/exceptions.rb
Views: 11704
# -*- coding: binary -*-1module Rex2module Proto3module DCERPC4module Exceptions56class Error < ::RuntimeError78@@errors = {90x00000000 => "stub-defined",100x00000001 => "nca_s_fault_other",110x00000005 => "nca_s_fault_access_denied",120x000006d8 => "nca_s_fault_cant_perform",130x000006f7 => "nca_s_fault_ndr",140x16c9a001 => "rpc_s_op_rng_error",150x16c9a006 => "rpc_s_wrong_boot_time",160x16c9a012 => "rpc_s_no_memory",170x16c9a016 => "rpc_s_comm_failure",180x16c9a01b => "rpc_s_fault_object_not_found",190x16c9a02c => "rpc_s_unknown_if",200x16c9a02d => "rpc_s_unsupported_type",210x16c9a030 => "rpc_s_cancel_timeout",220x16c9a031 => "rpc_s_call_cancelled",230x16c9a036 => "rpc_s_connection_closed",240x16c9a041 => "rpc_s_connect_timed_out",250x16c9a042 => "rpc_s_connect_rejected",260x16c9a043 => "rpc_s_network_unreachable",270x16c9a044 => "rpc_s_connect_no_resources",280x16c9a045 => "rpc_s_rem_network_shutdown",290x16c9a046 => "rpc_s_too_many_rem_connects",300x16c9a047 => "rpc_s_no_rem_endpoint",310x16c9a048 => "rpc_s_rem_host_down",320x16c9a049 => "rpc_s_host_unreachable",330x16c9a04a => "rpc_s_access_control_info_inv",340x16c9a04b => "rpc_s_loc_connect_aborted",350x16c9a04c => "rpc_s_connect_closed_by_rem",360x16c9a04d => "rpc_s_rem_host_crashed",370x16c9a074 => "rpc_s_fault_addr_error",380x16c9a075 => "rpc_s_fault_context_mismatch",390x16c9a076 => "rpc_s_fault_fp_div_by_zero",400x16c9a077 => "rpc_s_fault_fp_error",410x16c9a078 => "rpc_s_fault_fp_overflow",420x16c9a079 => "rpc_s_fault_fp_underflow",430x16c9a07a => "rpc_s_fault_ill_inst",440x16c9a07b => "rpc_s_fault_int_div_by_zero",450x16c9a07c => "rpc_s_fault_int_overflow",460x16c9a07d => "rpc_s_fault_invalid_bound",470x16c9a07e => "rpc_s_fault_invalid_tag",480x16c9a07f => "rpc_s_fault_pipe_closed",490x16c9a080 => "rpc_s_fault_pipe_comm_error",500x16c9a081 => "rpc_s_fault_pipe_discipline",510x16c9a082 => "rpc_s_fault_pipe_empty",520x16c9a083 => "rpc_s_fault_pipe_memory",530x16c9a084 => "rpc_s_fault_pipe_order",540x16c9a085 => "rpc_s_fault_remote_comm_failure",550x16c9a086 => "rpc_s_fault_remote_no_memory",560x16c9a087 => "rpc_s_fault_unspec",570x16c9a0a8 => "rpc_s_no_ns_permission",580x16c9a0b5 => "rpc_s_no_more_bindings",590x16c9a113 => "rpc_s_fault_user_defined",600x16c9a116 => "rpc_s_fault_tx_open_failed",610x16c9a16e => "rpc_s_fault_codeset_conv_error",620x16c9a170 => "rpc_s_fault_no_client_stub",630x1c000001 => "nca_s_fault_int_div_by_zero",640x1c000002 => "nca_s_fault_addr_error",650x1c000003 => "nca_s_fault_fp_div_zero",660x1c000004 => "nca_s_fault_fp_underflow",670x1c000005 => "nca_s_fault_fp_overflow",680x1c000006 => "nca_s_fault_invalid_tag",690x1c000007 => "nca_s_fault_invalid_bound",700x1c000008 => "nca_rpc_version_mismatch",710x1c000009 => "nca_unspec_reject",720x1c00000a => "nca_s_bad_actid",730x1c00000b => "nca_who_are_you_failed",740x1c00000c => "nca_manager_not_entered",750x1c00000d => "nca_s_fault_cancel",760x1c00000e => "nca_s_fault_ill_inst",770x1c00000f => "nca_s_fault_fp_error",780x1c000010 => "nca_s_fault_int_overflow",790x1c000014 => "nca_s_fault_pipe_empty",800x1c000015 => "nca_s_fault_pipe_closed",810x1c000016 => "nca_s_fault_pipe_order",820x1c000017 => "nca_s_fault_pipe_discipline",830x1c000018 => "nca_s_fault_pipe_comm_error",840x1c000019 => "nca_s_fault_pipe_memory",850x1c00001a => "nca_s_fault_context_mismatch",860x1c00001b => "nca_s_fault_remote_no_memory",870x1c00001c => "nca_invalid_pres_context_id",880x1c00001d => "nca_unsupported_authn_level",890x1c00001f => "nca_invalid_checksum",900x1c000020 => "nca_invalid_crc",910x1c000021 => "ncs_s_fault_user_defined",920x1c000022 => "nca_s_fault_tx_open_failed",930x1c000023 => "nca_s_fault_codeset_conv_error",940x1c000024 => "nca_s_fault_object_not_found",950x1c000025 => "nca_s_fault_no_client_stub",960x1c010002 => "nca_op_rng_error",970x1c010003 => "nca_unk_if",980x1c010006 => "nca_wrong_boot_time",990x1c010009 => "nca_s_you_crashed",1000x1c01000b => "nca_proto_error",1010x1c010013 => "nca_out_args_too_big",1020x1c010014 => "nca_server_too_busy",1030x1c010017 => "nca_unsupported_type"104}105106def initialize(*args)107super(*args)108end109110# returns an error string if it exists, otherwise just the error code111def get_error(error)112string = ''113if @@errors[error]114string = @@errors[error]115else116string = sprintf('0x%.8x',error)117end118end119end120121class Fault < Error122attr_accessor :fault123def to_s124'DCERPC FAULT => ' + get_error(self.fault)125end126end127128class NoResponse < Error129def to_s130'no response from dcerpc service'131end132end133134class BindError < Error135def initialize(message=nil)136@message = message137end138139def to_s140str = 'Failed to bind.'141if @message142str += " #{@message}"143end144end145end146147class InvalidSocket < Error148def initialize(message=nil)149@message = message150end151152def to_s153str = 'Invalid Socket.'154if @message155str += " #{@message}"156end157end158end159160class InvalidPacket < Error161def initialize(message = nil)162@message = message163end164165def to_s166str = 'Invalid packet.'167if (@message)168str += " #{@message}"169end170end171end172173end174end175end176end177178179