Showing 16,065 of 22,177 total issues
Method start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start
if serve_udp
@udp_sock = Rex::Socket::Udp.create(sock_options)
self.listener_thread = Rex::ThreadFactory.spawn('UDPLDAPServerListener', false) do
monitor_listener
Method from_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.from_data(data)
message = Message.from_data(data)
# abort if this isn't a valid response
return unless message
return unless message.type == BOOTSTRAP_RESPONSE
Method dial
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def dial(number)
self.client.send_new(self, number)
res = wait_for(Constants::IAX_SUBTYPE_AUTHREQ, Constants::IAX_SUBTYPE_ACCEPT)
return if not res
Method mssql_upload_exec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def mssql_upload_exec(exe, debug=false)
hex = exe.unpack("H*")[0]
var_bypass = Rex::Text.rand_text_alpha(8)
var_payload = Rex::Text.rand_text_alpha(8)
Method dn_expand
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def dn_expand(packet,offset)
name = ""
packetlen = packet.size
while true
raise ExpandError, "offset is greater than packet length!" if packetlen < (offset+1)
Method monitor_server_sock
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def monitor_server_sock
yield "Listening for incoming ACKs" if block_given?
res = self.server_sock.recvfrom(65535)
if res and res[0]
code, type, data = parse_tftp_response(res[0])
Method on_data_read
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_data_read(data, _data_type)
return data if data.blank?
ssm_frame = SsmFrame.read(data)
case ssm_frame.header.message_type.strip
Method make_alter_context
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.make_alter_context(uuid, vers)
u = Rex::Proto::DCERPC::UUID
# Process the version strings ("1.0", 1.0, "1", 1)
bind_vers_maj, bind_vers_min = UUID.vers_to_nums(vers)
Method make_request_chunk
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.make_request_chunk(flags=3, opnum=0, data="", ctx=0, object_id = '')
flags = flags.to_i
opnum = opnum.to_i
ctx = ctx.to_i
Method start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start
self.listener = Rex::Socket::TcpServer.create(
'LocalHost' => self.listen_host,
'LocalPort' => self.listen_port,
'Context' => self.context,
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(config = {})
raise ResolverArgumentError, "Argument has to be Hash" unless config.kind_of? Hash
# config.key_downcase!
@config = Defaults.merge config
@config[:config_file] ||= self.class.default_config_file
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create(filename, disposition = 1, impersonation = 2, do_recv = true)
pkt = CONST::SMB_CREATE_PKT.make_struct
self.smb_defaults(pkt['Payload']['SMB'])
Method read_ruby_smb
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def read_ruby_smb(length, offset, depth = 0)
file_size = client.open_files[client.last_file_id].size
file_size_remaining = file_size - offset
if length.nil?
max_size = file_size_remaining
Method sud_syscall_hook
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.sud_syscall_hook(opts = {})
r0_recovery = opts['RecoveryStub'] || Recovery.default
r3_payload = opts['UserModeStub'] || ''
r3_prefix = _run_only_in_win32proc_stub("\xff\x25\x08\x03\xfe\x7f", opts)
r3_size = ((r3_prefix.length + r3_payload.length + 3) & ~0x3) / 4
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(wildcard: '*', resolvers: [], comm: nil)
::ArgumentError.new("Invalid wildcard text: #{wildcard}") unless self.class.valid_wildcard?(wildcard)
@wildcard = wildcard
socket_options = {}
socket_options['Comm'] = comm unless comm.nil?
Method send
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def send(argument, type = Dnsruby::Types::A, cls = Dnsruby::Classes::IN)
case argument
when Dnsruby::Message
req = argument
when Net::DNS::Packet, Resolv::DNS::Message
Method report_web_page
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def report_web_page(&block)
return unless(in_issue && has_text)
return unless @state[:web_site].present?
return unless @state[:response_headers].present?
return unless @state[:uri].present?
Method tag_start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def tag_start(name, attributes)
case name
when "host"
@host['hid'] = attributes['persistent_id']
when "ip"
Method generate_ssl_context
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_ssl_context
ctx = nil
ssl_cert_info = nil
Method sizeof_type
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sizeof_type(type)
if is_pointer_type?(type)
return pointer_size
end