rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  list = ['123456','password','12345678','qwerty','abc123','111111','letmein','trustno1','superman',
    'iloveyou','sunshine','1234','princess','starwars','princess','nintendo','computer','Password',
    'passw0rd','michael','football','whatever','shadow','pokemon','666666','forgetyou','blahblah',
    'cowboys','yankees','ravens','orioles','pirates','dabears','tiger','fairies','sushi','money',
    'killzone','sandbox','rotflmao','subway','knicks','lakers','chargers','kermit','pigskin','baseball']
Severity: Major
Found in lib/msf/core/auxiliary/pii.rb and 1 other location - About 1 hr to fix
lib/rubocop/cop/lint/detect_invalid_pack_directives.rb on lines 28..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    super(update_info(info,
      'Name'           => 'rc.local Persistence',
      'Description'    => %q(
        This module will edit /etc/rc.local in order to persist a payload.
        The payload will be executed on the next reboot.
Severity: Major
Found in modules/exploits/linux/local/rc_local_persistence.rb and 1 other location - About 1 hr to fix
modules/exploits/linux/local/autostart_persistence.rb on lines 13..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      users.keys.sort { |a, b| a <=> b }.each do |rid|
        # If we have a hint then print it
        if !users[rid][:UserPasswordHint].nil? && !users[rid][:UserPasswordHint].empty?
          print_good("\t#{users[rid][:Name]}:\"#{users[rid][:UserPasswordHint]}\"")
          hint_count += 1
Severity: Major
Found in modules/post/windows/gather/smart_hashdump.rb and 1 other location - About 1 hr to fix
modules/post/windows/gather/hashdump.rb on lines 60..65

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def check
    get_terramaster_info
    return CheckCode::Safe if @terramaster.empty?

    if Rex::Version.new(@terramaster['tos_version']) <= Rex::Version.new('4.2.29')
modules/exploits/linux/http/terramaster_unauth_rce_cve_2021_45837.rb on lines 244..252

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    privs_enable.each do |priv|
      items.each do |item|
       request_parameters = {
        'method'    => 'POST',
        'uri'       => normalize_uri(@uri.path, "/command/#{targetdb}/sql/-/20"),
Severity: Major
Found in modules/exploits/multi/http/orientdb_exec.rb and 1 other location - About 1 hr to fix
modules/exploits/multi/http/orientdb_exec.rb on lines 245..255

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'D-Link DIR-600 / DIR-300 Unauthenticated Remote Command Execution',
modules/auxiliary/gather/eventlog_cred_disclosure.rb on lines 12..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    while (Time.now.to_f < etime)
      while(reply = getreply())
        next if not reply.is_arp?
        if @dhosts.include? reply.arp_saddr_ip
          print_good("#{reply.arp_saddr_ip} appears to be up.")
Severity: Major
Found in modules/auxiliary/spoof/arp/arp_poisoning.rb and 1 other location - About 1 hr to fix
modules/auxiliary/spoof/arp/arp_poisoning.rb on lines 228..237

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module Rex
  module Post
    module LDAP
      module Ui
        ###
Severity: Major
Found in lib/rex/post/ldap/ui/console/command_dispatcher/core.rb and 1 other location - About 1 hr to fix
lib/rex/post/smb/ui/console/command_dispatcher/core.rb on lines 5..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    super(update_info(info,
      'Name'           => 'Autostart Desktop Item Persistence',
      'Description'    => %q(
        This module will create an autostart entry to execute a payload.
        The payload will be executed when the users logs in.
Severity: Major
Found in modules/exploits/linux/local/autostart_persistence.rb and 1 other location - About 1 hr to fix
modules/exploits/linux/local/rc_local_persistence.rb on lines 13..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function check_logins has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def check_logins(rhost, rport, targeturi, domain, usernames, passwords, timeout, user_agent):
Severity: Major
Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 1 hr to fix

    Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, command='', username='', password='', domain='', hashes=None, share=None,
    Severity: Major
    Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py - About 1 hr to fix

      Function check_login has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def check_login(rhost, rport, targeturi, domain, username, password, timeout, user_agent):
      Severity: Major
      Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 1 hr to fix

        Function _encdec has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _encdec(self, data, K, s, S, L1, L2, L3, L4):
        Severity: Major
        Found in data/meterpreter/python/met_aes.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                              if ((node.is_leaf? && !strpath.include?('.')) || node.is_root? || !node.is_leaf?) && (!usinginipath || (usinginipath && strpath.match(inipathname)))
          
                                modopts['PATH'] = strpath
                                print_status("Path: #{strpath}")
          
          
          Severity: Major
          Found in plugins/wmap.rb - About 1 hr to fix

            Method scheduleremote has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def scheduleremote(session,schtype,cmd,tmmod,cmdopt,targetsys,username,password)
            Severity: Major
            Found in scripts/meterpreter/scheduleme.rb - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                  return CheckCode::Safe("Detected Magento #{edition} edition version #{version} which is not vulnerable") unless
                    version <= (Rex::Version.new('2.4.7')) ||
                    version <= (Rex::Version.new('2.4.6-p5')) ||
                    version <= (Rex::Version.new('2.4.5-p7')) ||
                    version <= (Rex::Version.new('2.4.4-p8')) ||
              Severity: Major
              Found in modules/auxiliary/gather/magento_xxe_cve_2024_34102.rb - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if res && res.code == 200 && res.body &&
                       res.body.to_s =~ /ManageEngine Password Manager Pro/ &&
                       (
                         res.body.to_s =~ /login\.css\?([0-9]+)/ ||                            # PMP v6
                         res.body.to_s =~ /login\.css\?version=([0-9]+)/ ||                    # PMP v6
                Severity: Major
                Found in modules/auxiliary/admin/http/manageengine_pmp_privesc.rb - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if xmlResponse.include?('NET5501') || xmlResponse.include?('NET5501-I') || xmlResponse.include?('NET5501-XT') || xmlResponse.include?('NET5504') || xmlResponse.include?('NET5500') || xmlResponse.include?('NET5516') || xmlResponse.include?('NET5508')
                        return Exploit::CheckCode::Appears
                      end
                  Severity: Major
                  Found in modules/exploits/unix/http/schneider_electric_net55xx_encoder.rb - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                          if (version[0].to_i < 11) or
                          (version[0].to_i == 11 and version[1].to_i <= 3) or
                          (version[0].to_i == 11 and version[1].to_i == 3 and version[2].to_i == 0 and version[3].to_i < 999)
                            ctx = { 'Msf' => framework, 'MsfExploit' => self }
                            sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => datastore['RPORT_REMOTING'], 'Context' => ctx })
                    Severity: Major
                    Found in modules/exploits/windows/http/trackit_file_upload.rb - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                elsif (error[0].empty? or (error[0].unpack('C')[0] & 3) == 0) and # fd_nextsize
                                      (error[1].empty? or (error[1].unpack('C')[0] & 3) == 0) and # fd
                                      (error[2] =~ /\A503 [^s].?\z/mn) and ((error[2].unpack('C*')[4] & 7) == PREV_INUSE) and # size
                                      (error[3] == "177") # the last \x7F of our BAD1 command, encoded as \\177 by string_printing()
                                  leaked_arch = ARCH_X86
                      Severity: Major
                      Found in modules/exploits/linux/smtp/exim_gethostbyname_bof.rb - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language