rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method cmd_webcam_snap has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def cmd_webcam_snap(*args)
    if client.webcam.webcam_list.length == 0
      print_error("Target does not have a webcam")
      return
    end

    Method dump_sessions_verbose has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.dump_sessions_verbose(framework, opts={})
        out = "Active sessions\n" +
              "===============\n\n"
    
        if framework.sessions.length == 0
    Severity: Major
    Found in lib/msf/base/serializer/readable_text.rb - About 2 hrs to fix

      Method rpc_info has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def rpc_info(mtype, mname)
          m = _find_module(mtype,mname)
          res = module_short_info(m)
          res['description'] = Rex::Text.compress(m.description)
          res['license'] = m.license
      Severity: Major
      Found in lib/msf/core/rpc/v10/rpc_module.rb - About 2 hrs to fix

        Method rpc_del_service has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def rpc_del_service(xopts)
          ::ApplicationRecord.connection_pool.with_connection {
            opts, wspace = init_db_opts_workspace(xopts)
            hosts  = []
            services = []
        Severity: Major
        Found in lib/msf/core/rpc/v10/rpc_db.rb - About 2 hrs to fix

          Method nagios_xi_rce_check has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def nagios_xi_rce_check(version)
              matching_exploits = {}
          
              # Storage area for known exploits that affect versions prior to the one in the hash key
              nagios_rce_version_prior = {
          Severity: Major
          Found in lib/msf/core/exploit/remote/http/nagios_xi/rce_check.rb - About 2 hrs to fix

            Method upload_payload_plugin has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def upload_payload_plugin(webshell_jar, admin_username, admin_password)
                vprint_status('Uploading payload plugin')
                post_data = Rex::MIME::Message.new
                post_data.add_part(webshell_jar, 'application/java-archive', 'binary', "form-data; name=\"plugin\"; filename=\"#{rand_text_alphanumeric(8..16)}.jar\"")
                post_data.add_part('', nil, nil, 'form-data; name="url"')

              Method ping6 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def ping6(dhost, opts={})
                  check_pcaprub_loaded
              
                  dhost_intf = dhost + '%' + ipv6_interface(opts)
              
              
              Severity: Major
              Found in lib/msf/core/exploit/remote/ipv6.rb - About 2 hrs to fix

                Method authenticate_via_kdc has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def authenticate_via_kdc(options = {})
                    realm = self.realm.upcase
                    client_name = username
                    server_name = "krbtgt/#{realm}"
                
                
                Severity: Major
                Found in lib/msf/core/exploit/remote/kerberos/service_authenticator/base.rb - About 2 hrs to fix

                  Method validate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def validate(datastore)
                        # First mutate the datastore and normalize all valid values before validating permutations of RHOST/etc.
                        each_pair do |name, option|
                          if option.valid?(datastore[name]) && (val = option.normalize(datastore[name])) != nil
                            # This *will* result in a module that previously used the
                  Severity: Major
                  Found in lib/msf/core/option_container.rb - About 2 hrs to fix

                    Method to_xml_file has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def to_xml_file(path, &block)
                    
                        yield(:status, STATUS_START, "report") if block_given?
                        extract_target_entries
                        report_file = ::File.open(path, "wb")
                    Severity: Major
                    Found in lib/msf/core/db_export.rb - About 2 hrs to fix

                      Method jsp_bind_tcp has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def jsp_bind_tcp
                          # Modified from: http://www.security.org.sg/code/jspreverse.html
                          generator = Rex::RandomIdentifier::Generator.new({ language: :jsp })
                      
                          var_is = generator.generate(2)
                      Severity: Major
                      Found in lib/msf/core/payload/jsp.rb - About 2 hrs to fix

                        Method attempt_login has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def attempt_login(credential)
                                  result_opts = {
                                      credential: credential,
                                      host: host,
                                      port: port,
                        Severity: Major
                        Found in lib/metasploit/framework/login_scanner/ipboard.rb - About 2 hrs to fix

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

                              frag0 =
                                "\x90" + # nop
                                "\x58" + # pop eax
                                "\x61" + # popa
                                "\xc3"   # ret
                          Severity: Major
                          Found in modules/exploits/osx/http/evocam_webserver.rb and 2 other locations - About 2 hrs to fix
                          modules/exploits/osx/misc/ufo_ai.rb on lines 62..90
                          modules/exploits/osx/rtsp/quicktime_rtsp_content_type.rb on lines 90..118

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

                          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 3 locations. Consider refactoring.
                          Open

                              frag0 =
                                "\x90" + # nop
                                "\x58" + # pop eax
                                "\x61" + # popa
                                "\xc3"   # ret
                          Severity: Major
                          Found in modules/exploits/osx/rtsp/quicktime_rtsp_content_type.rb and 2 other locations - About 2 hrs to fix
                          modules/exploits/osx/http/evocam_webserver.rb on lines 74..102
                          modules/exploits/osx/misc/ufo_ai.rb on lines 62..90

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

                          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 3 locations. Consider refactoring.
                          Open

                              frag0 =
                                "\x90" + # nop
                                "\x58" + # pop eax
                                "\x61" + # popa
                                "\xc3"   # ret
                          Severity: Major
                          Found in modules/exploits/osx/misc/ufo_ai.rb and 2 other locations - About 2 hrs to fix
                          modules/exploits/osx/http/evocam_webserver.rb on lines 74..102
                          modules/exploits/osx/rtsp/quicktime_rtsp_content_type.rb on lines 90..118

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

                          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

                                    alias1, alias2 = 2.times.map { Rex::Text.rand_text_alpha(rand(2..9)) }
                                    if @truncation_length
                                      retrieved_data = truncated_query('select substr(group_concat(' \
                                      "#{alias1},'#{@concat_separator}'),"\
                                      "^OFFSET^,#{@truncation_length}) from (select cast(#{columns} as blob) #{alias1} from #{table}"\
                          Severity: Major
                          Found in lib/msf/core/exploit/sqli/sqlitei/common.rb and 1 other location - About 2 hrs to fix
                          lib/msf/core/exploit/sqli/postgresqli/common.rb on lines 157..165

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

                          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'           => 'Samba trans2open Overflow (*BSD x86)',
                                'Description'    => %q{
                                    This exploits the buffer overflow found in Samba versions
                          Severity: Major
                          Found in modules/exploits/freebsd/samba/trans2open.rb and 1 other location - About 2 hrs to fix
                          modules/exploits/linux/samba/trans2open.rb on lines 12..69

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

                          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'           => 'Samba trans2open Overflow (Linux x86)',
                                'Description'    => %q{
                                    This exploits the buffer overflow found in Samba versions
                          Severity: Major
                          Found in modules/exploits/linux/samba/trans2open.rb and 1 other location - About 2 hrs to fix
                          modules/exploits/freebsd/samba/trans2open.rb on lines 12..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 78.

                          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

                              if res && res.code == 200 && res.body.include?('webNasIPS successful')
                                # Parse the JSON response and get the data such as admin password hash and MAC address
                                res_json = res.get_json_document
                                unless res_json.blank?
                                  @data['password'] = res_json['data'].split('PWD:')[1].split('SAT')[0].strip
                          modules/exploits/linux/http/terramaster_unauth_rce_cve_2021_45837.rb on lines 108..119

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

                          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

                                    alias1, alias2 = 2.times.map { Rex::Text.rand_text_alpha(rand(2..9)) }
                                    if @truncation_length
                                      retrieved_data = truncated_query('select substr(string_agg(' \
                                      "#{alias1}, '#{@concat_separator}'),"\
                                      "^OFFSET^,#{@truncation_length}) from (select #{columns}::text #{alias1} from #{table}"\
                          Severity: Major
                          Found in lib/msf/core/exploit/sqli/postgresqli/common.rb and 1 other location - About 2 hrs to fix
                          lib/msf/core/exploit/sqli/sqlitei/common.rb on lines 112..120

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language