Showing 7,361 of 22,177 total issues
Method attempt_login
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def attempt_login(credential)
begin
connect
rescue ::Rex::ConnectionError => e
result = Result.new(
Method exploit
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def exploit
if @exploit_method.nil? # this means the user has disabled autocheck so we should try the default exploit method
@exploit_method = 'default'
elsif @exploit_method == 'cve_2021_42847' && datastore['PAYLOAD'] =~ /meterpreter/
print_warning('Exploitation is possible only via CVE-2021-42847. This attack vector may fail in combination with a meterpreter payload.')
Method build_javascript
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_javascript(my_target)
p = get_payload(my_target)
js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(my_target.arch))
js_nops = Rex::Text.to_unescape("\x0c"*4, Rex::Arch.endian(my_target.arch))
Method run
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run
return unless load_kiwi
user = datastore['USER']
domain = datastore['DOMAIN']
Method list
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def list
tbl = Rex::Text::Table.new(
'Header' => 'Device Information',
'Indent' => 1,
'Columns' =>
Method run
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run
fail_with(Failure::BadConfig, 'Root privileges are required') unless is_root?
user_data = get_user_names_and_hashes
fail_with(Failure::UnexpectedReply, 'Failed to retrieve user information') if user_data.empty?
password_data = configure_passwords(user_data)
Method decode_reply
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.decode_reply(data)
res = {}
r_magic = data[0,4]
r_ptype = data[4,2].unpack("n").first
r_plen = data[6,2].unpack("n").first
Method end_element
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name=nil)
block = @block
case name
when "Scan"
# Clears most of the @state out, we're done with this web site.
Method cmd_dump_contacts
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def cmd_dump_contacts(*args)
path = "contacts_dump_#{::Time.new.strftime('%Y%m%d%H%M%S')}"
format = :text
dump_contacts_opts = Rex::Parser::Arguments.new(
Method download_file
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def File.download_file(dest_file, src_file, opts = {}, &stat)
stat ||= lambda { |a,b,c| }
adaptive = opts["adaptive"]
block_size = opts["block_size"] || 1024 * 1024
Method to_win32pe
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.to_win32pe(framework, code, opts = {})
# For backward compatibility, this is roughly equivalent to 'exe-small' fmt
if opts[:sub_method]
if opts[:inject]
Method juniper_screenos_config_eater
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def juniper_screenos_config_eater(thost, tport, config)
# this is for the netscreen OS, which came on SSG (ie SSG5) type devices.
# It is similar to cisco, however it doesn't always put all fields we care
# about on one line.
# Docs: snmp -> https://kb.juniper.net/InfoCenter/index?page=content&id=KB4223
Method asm_reverse_tcp
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def asm_reverse_tcp(opts={})
# TODO: reliability is coming
retry_count = opts[:retry_count]
reliable = opts[:reliable]
encoded_port = "%.8x" % [opts[:port].to_i,2].pack("vn").unpack("N").first
Method generate_reverse_tcp
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_reverse_tcp(opts={})
encoded_port = "%.8x" % [datastore['LPORT'].to_i,2].pack("vv").unpack("N").first
encoded_host = "%.8x" % Rex::Socket.addr_aton(datastore['LHOST']||"127.127.127.127").unpack("V").first
retry_count = datastore['StagerRetryCount']
seconds = datastore['StagerRetryWait']
Method run
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run
open_pcap({'SNAPLEN' => 68, 'FILTER' => "arp[6:2] == 0x0002"})
@netifaces = true
if not netifaces_implemented?
print_error("WARNING : Pcaprub is not up-to-date, some functionality will not be available")
Method hash_dump
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def hash_dump(config_uri, cookie)
random_filename = Rex::Text::rand_text_alpha(8)
command = 'cp /etc/passwd /www/' + random_filename
inject = '|' + "#{command}" + ' ||'
clean_inject = CGI.unescapeHTML(inject.to_s)
Method run_host
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run_host(ip)
conn = true
ecode = nil
emesg = nil
Method run_host
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run_host(ip)
cred_collection = build_credential_collection(
realm: datastore['DOMAIN'],
username: datastore['USERNAME'],
password: datastore['PASSWORD']
Method execute_payload
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def execute_payload
# Drop table if it exists
query = "DROP TABLE IF EXISTS #{tablename.inspect};"
drop_query = postgres_query(query)
case drop_query.keys[0]
Method get_pidgin_creds
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_pidgin_creds(paths)
case paths
when /#{@user}\\(.*)\\/
sys_user = ::Regexp.last_match(1)
when %r{home/(.*)/}