rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method load_library has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def load_library(opts)
    library_path = opts['LibraryFilePath']
    library_image = opts['LibraryFileImage']
    target_path  = opts['TargetFilePath']
    load_flags   = LOAD_LIBRARY_FLAG_LOCAL
Severity: Major
Found in lib/rex/post/meterpreter/client_core.rb - About 2 hrs to fix

    Method cmd_dns_tabs has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def cmd_dns_tabs(str, words)
        return if driver.framework.dns_resolver.nil?
    
        subcommands = %w[ add add-static delete flush-cache flush-entries flush-static help print query remove remove-static reset-config resolve ]
        if words.length == 1
    Severity: Major
    Found in lib/msf/ui/console/command_dispatcher/dns.rb - About 2 hrs to fix

      Method resolve_dns has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def resolve_dns(*args)
          names = []
          query_type = Dnsruby::Types::A
      
          @@resolve_opts.parse(args) do |opt, idx, val|
      Severity: Major
      Found in lib/msf/ui/console/command_dispatcher/dns.rb - About 2 hrs to fix

        Method exploit has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def exploit
            # Is the selected target a brute force target?
            if (target.bruteforce?)
              # The step direction is automatically calculated
              direction = {}
        Severity: Major
        Found in lib/msf/core/exploit/brute.rb - About 2 hrs to fix

          Method report_web_site has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def report_web_site(opts)
              return if not active
            ::ApplicationRecord.connection_pool.with_connection { |conn|
              opts = opts.clone() # protect the original caller's opts
              wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
          Severity: Major
          Found in lib/msf/core/db_manager/web.rb - About 2 hrs to fix

            Method MemoryDiscl has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    ulong MemoryDiscl()
                    {
                        try
                        {
                            // prepare malicious MemoryStream
            Severity: Major
            Found in external/source/exploits/cve-2013-0074/SilverApp1/MainPage.xaml.cs - About 2 hrs to fix

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

                def gen_psh(url, *method)
                  ignore_cert = Rex::Powershell::PshMethods.ignore_ssl_certificate if ssl
              
                  if method.include? 'string'
                    download_string = datastore['PSH-Proxy'] ? (Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)) : (Rex::Powershell::PshMethods.download_and_exec_string(url))
              Severity: Major
              Found in modules/exploits/windows/fileformat/office_dde_delivery.rb and 2 other locations - About 2 hrs to fix
              modules/exploits/windows/fileformat/office_excel_slk.rb on lines 76..100
              modules/exploits/windows/fileformat/office_ms17_11882.rb on lines 251..275

              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 88.

              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

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

                def gen_psh(url, *method)
                  ignore_cert = Rex::Powershell::PshMethods.ignore_ssl_certificate if ssl
              
                  if method.include? 'string'
                    download_string = datastore['PSH-Proxy'] ? (Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)) : (Rex::Powershell::PshMethods.download_and_exec_string(url))
              Severity: Major
              Found in modules/exploits/windows/fileformat/office_ms17_11882.rb and 2 other locations - About 2 hrs to fix
              modules/exploits/windows/fileformat/office_dde_delivery.rb on lines 53..77
              modules/exploits/windows/fileformat/office_excel_slk.rb on lines 76..100

              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 88.

              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

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

                def gen_psh(url, *method)
                  ignore_cert = Rex::Powershell::PshMethods.ignore_ssl_certificate if ssl
              
                  if method.include? 'string'
                    download_string = datastore['PSH-Proxy'] ? (Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)) : (Rex::Powershell::PshMethods.download_and_exec_string(url))
              Severity: Major
              Found in modules/exploits/windows/fileformat/office_excel_slk.rb and 2 other locations - About 2 hrs to fix
              modules/exploits/windows/fileformat/office_dde_delivery.rb on lines 53..77
              modules/exploits/windows/fileformat/office_ms17_11882.rb on lines 251..275

              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 88.

              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

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

                def do_login(user=nil,pass=nil,database=nil)
                  begin
                    password = pass || postgres_password
                    vprint_status("Trying #{user}:#{password}@#{rhost}:#{rport}/#{database}") unless self.postgres_conn
                    result = postgres_fingerprint(
              Severity: Major
              Found in modules/exploits/linux/postgres/postgres_payload.rb and 1 other location - About 2 hrs to fix
              modules/exploits/windows/postgres/postgres_payload.rb on lines 116..139

              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 88.

              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

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

                def do_login(user=nil,pass=nil,database=nil)
                  begin
                    password = pass || postgres_password
                    vprint_status("Trying #{user}:#{password}@#{rhost}:#{rport}/#{database}") unless self.postgres_conn
                    result = postgres_fingerprint(
              Severity: Major
              Found in modules/exploits/windows/postgres/postgres_payload.rb and 1 other location - About 2 hrs to fix
              modules/exploits/linux/postgres/postgres_payload.rb on lines 123..146

              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 88.

              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

                      case val.tag
                      when 0  # flags               [0] TicketFlags
                        self.flags = decode_flags(val)
                      when 1  # key                 [1] EncryptionKey
                        self.key = decode_key(val)
              Severity: Major
              Found in lib/rex/proto/kerberos/model/ticket_enc_part.rb and 1 other location - About 2 hrs to fix
              lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 190..214

              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 88.

              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

                            case val.tag
                            when 0
                              self.key = decode_key(val)
                            when 1
                              self.prealm = decode_prealm(val)
              Severity: Major
              Found in lib/rex/proto/kerberos/model/krb_cred_info.rb and 1 other location - About 2 hrs to fix
              lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 99..123

              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 88.

              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 sprayArrays has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var sprayArrays=function() {
                var mArray = new Array(0x1fffe)  
                var arrBuf = new ArrayBuffer(0x100000);
                var dwArray =  new Uint32Array(arrBuf)
                var qwArray = new Float64Array(arrBuf, 0x10)
              Severity: Major
              Found in data/exploits/firefox_smil_uaf/worker.js - About 2 hrs to fix

                Method cmd_nessus_db_scan_workspace has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def cmd_nessus_db_scan_workspace(*args)
                        if args[0] == '-h'
                          print_status('nessus_db_scan_workspace <policy ID> <scan name> <scan description> <workspace>')
                          print_status('Creates a scan based on all the hosts listed in db_hosts for a given workspace.')
                          print_status('Use nessus_policy_list to list all available policies with their corresponding policy IDs')
                Severity: Major
                Found in plugins/nessus.rb - About 2 hrs to fix

                  Method cmd_nessus_db_import has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def cmd_nessus_db_import(*args)
                          if args[0] == '-h'
                            print_status('nessus_db_import <scan ID>')
                            print_status('Example:> nessus_db_import 500')
                            print_status('Use nessus_scan_list -c to list all completed scans')
                  Severity: Major
                  Found in plugins/nessus.rb - About 2 hrs to fix

                    Method process_openssl_cleartext_request has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def process_openssl_cleartext_request(c, data)
                        message_type, message_version, protocol_version = data.unpack("Cn@9n")
                    
                        if message_type == 0x15 and data.length >= 7
                          message_level, message_reason = data[5,2].unpack("CC")
                    Severity: Major
                    Found in modules/auxiliary/server/openssl_heartbeat_client_memory.rb - About 2 hrs to fix

                      Method prepare_packet has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def prepare_packet(bmc)
                          #
                          # ConfigurationService packet structure:
                          #
                          # packet_header_pre_packet_size
                      Severity: Major
                      Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 2 hrs to fix

                        Method exploit_js has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def exploit_js
                            js_obfuscate %Q|
                              window.onmessage = function(e) {
                                var x = new XMLHttpRequest;
                                x.open("POST", location.href);
                        Severity: Major
                        Found in modules/auxiliary/gather/android_browser_file_theft.rb - About 2 hrs to fix

                          Method check has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def check
                              targ = rhost
                          
                              srv_sock = Rex::Socket.create_udp(
                                'PeerHost' => targ,
                          Severity: Major
                          Found in modules/auxiliary/spoof/dns/bailiwicked_domain.rb - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language