Showing 15,831 of 21,886 total issues
Method rfc3330_reserved
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def rfc3330_reserved(ip)
case ip
when PacketFu::Octets
ip_x = ip.to_x
ip_i = ip.to_i
Method import_report
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def import_report(report, args, base_dir)
tmp = args[:ifd][:zip_tmp]
report_info = {}
report.elements.each do |e|
Method start_service
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_service
comm = _determine_server_comm(bindhost)
auth_handler = Rex::Proto::LDAP::Auth.new(
datastore['CHALLENGE'],
datastore['Domain'],
Method with_prepended_auto_check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def with_prepended_auto_check
unless datastore['AutoCheck']
print_warning('AutoCheck is disabled, proceeding with exploitation')
return yield
end
Method start_payload_listeners
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_payload_listeners
# Spawn nothing if the user doesn't want to pop sessions.
return if datastore['MaxSessionCount'] == 0
# Don't repeat launching payload handlers
Method splunk_login
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def splunk_login(username, password, timeout = 20)
# gets cval cookies
cookie = splunk_helper_extract_token(timeout)
if cookie.nil?
vprint_error('Unable to extract login tokens')
Method postgres_upload_binary_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def postgres_upload_binary_data(data, remote_fname=nil)
remote_fname ||= Rex::Text::rand_text_alpha(8) + ".dll"
# From the Postgres documentation:
# SELECT lo_creat(-1); -- returns OID of new, empty large object
Method build_pa_for_user
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_pa_for_user(opts = {})
auth_package = 'Kerberos'.b
checksum_data = [Rex::Proto::Kerberos::Model::NameType::NT_PRINCIPAL].pack('I<')
checksum_data << opts[:username].b
Method connect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def connect(global=true, versions: [], backend: nil, direct: nil)
if versions.nil? || versions.empty?
versions = datastore['SMB::ProtocolVersion'].split(',').map(&:strip).reject(&:blank?).map(&:to_i)
# if the user explicitly set the protocol version to 1, still use ruby_smb
backend ||= :ruby_smb if versions == [1]
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info={})
super(update_info(info,
'Platform' => %w{ java linux osx solaris win },
'Payload' => { 'BadChars' => '', 'DisableNops' => true },
'Targets' =>
Method probe_gateway
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def probe_gateway(addr)
dst_host = datastore['GATEWAY_PROBE_HOST']
dst_port = datastore['GATEWAY_PROBE_PORT'].to_i == 0 ? rand(30000) + 1024 : datastore['GATEWAY_PROBE_PORT']
preamble = [datastore['SECRET']].pack("N")
secret = "#{preamble}#{Rex::Text.rand_text(rand(0xff)+1)}"
Method merge_check_key
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def merge_check_key(info, name, val)
if (self.respond_to?("merge_info_#{name.downcase}", true))
self.send("merge_info_#{name.downcase}", info, val)
else
# If the info hash already has an entry for this name
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(options={})
self.options = options
# call super to initialize MonitorMixin. #synchronize won't work without this.
super()
Method make_nops
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def make_nops(count)
# If we're debugging, then make_nops will return a safe sled. We
# currently assume x86.
if debugging?
return "\x90" * count
Method asm_invoke_dll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def asm_invoke_dll(opts={})
asm = %Q^
; prologue
dec ebp ; 'M'
pop edx ; 'Z'
Method create_object_symlink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_object_symlink(_root, link_name, target_name)
process = session.sys.process.open
unicode_str = setup_unicode_str_in_memory(process, link_name)
return nil unless unicode_str
Method bind_default_ldap_server
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def bind_default_ldap_server(size_limit, domain = nil)
vprint_status('Initializing LDAP connection.')
# If domain is still null the API may be able to handle it...
init_result = wldap32.ldap_sslinitA(domain, 389, 0)
Method write_data_by_id
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def write_data_by_id(bus, src_id, dst_id, id, data, opt = {})
unless client.automotive
print_error("Not an automotive hwbridge session")
return {}
end
Method add_reg_key_value
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def add_reg_key_value(reg_key, reg_value, reg_data, reg_type, opts = {})
log_and_print('[Task Scheduler] Restoring the Security Descriptor registry key value to unhide the task')
# Override by default. It has to be explicitly set to false if we don't want the key to be overridden.
unless opts[:override].nil? || opts[:override]
Method jtr_to_db
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.jtr_to_db(cred_type)
case cred_type
when 'descrypt' # from aix module
return ['des']
when 'oracle' # from databases module