rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def exploit
    version = get_version

    # 1: get the cookies, the login_url and the password_form and username form names (they varies between versions)
    res = send_request_cgi({
Severity: Major
Found in modules/exploits/multi/http/novell_servicedesk_rce.rb - About 4 hrs to fix

    Method on_request_uri has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def on_request_uri(cli, request)
    
        return if ((p = regenerate_payload(cli)) == nil)
    
        print_status("Sending exploit HTML")
    Severity: Major
    Found in modules/exploits/windows/browser/java_docbase_bof.rb - About 4 hrs to fix

      Method initialize has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'MS08-068 Microsoft Windows SMB Relay Code Execution',
      Severity: Major
      Found in modules/exploits/windows/smb/smb_relay.rb - About 4 hrs to fix

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

          def exploit
        
            if check != CheckCode::Appears
              fail_with(Failure::NotVulnerable, 'Target not vulnerable! punt!')
            end
        Severity: Major
        Found in modules/exploits/linux/local/overlayfs_priv_esc.rb - About 4 hrs to fix

          Method token_generation_endpoints has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def token_generation_endpoints
              %w[
                /access/file-path-manager/indexing
                /cm/autodeploy/cluster-software-images/indexing
                /cm/autodeploy/qkview/indexing
          Severity: Major
          Found in modules/exploits/linux/http/f5_icontrol_rest_ssrf_rce.rb - About 4 hrs to fix

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

              def initialize(info = {})
                super(update_info(info,
                  'Name'        => 'Borland InterBase isc_create_database() Buffer Overflow',
                  'Description'    => %q{
                    This module exploits a stack buffer overflow in Borland InterBase
            Severity: Major
            Found in modules/exploits/windows/misc/ib_isc_create_database.rb and 2 other locations - About 4 hrs to fix
            modules/exploits/windows/misc/ib_isc_attach_database.rb on lines 12..103
            modules/exploits/windows/misc/ib_svc_attach.rb on lines 12..103

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

            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

              def initialize(info = {})
                super(update_info(info,
                  'Name'        => 'Borland InterBase isc_attach_database() Buffer Overflow',
                  'Description'    => %q{
                    This module exploits a stack buffer overflow in Borland InterBase
            Severity: Major
            Found in modules/exploits/windows/misc/ib_isc_attach_database.rb and 2 other locations - About 4 hrs to fix
            modules/exploits/windows/misc/ib_isc_create_database.rb on lines 12..103
            modules/exploits/windows/misc/ib_svc_attach.rb on lines 12..103

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

            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

              def initialize(info = {})
                super(update_info(info,
                  'Name'        => 'Borland InterBase SVC_attach() Buffer Overflow',
                  'Description'    => %q{
                    This module exploits a stack buffer overflow in Borland InterBase
            Severity: Major
            Found in modules/exploits/windows/misc/ib_svc_attach.rb and 2 other locations - About 4 hrs to fix
            modules/exploits/windows/misc/ib_isc_attach_database.rb on lines 12..103
            modules/exploits/windows/misc/ib_isc_create_database.rb on lines 12..103

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

            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

            Method initialize has 111 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def initialize(info = {})
                super(merge_info(info,
                  'Name'          => 'Windows x86 Pingback, Bind TCP Inline',
                  'Description'   => 'Open a socket and report UUID when a connection is received (Windows x86)',
                  'Author'        => [ 'bwatters-r7' ],
            Severity: Major
            Found in modules/payloads/singles/windows/pingback_bind_tcp.rb - About 4 hrs to fix

              Method initialize has 111 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'Wordpress File Manager Advanced Shortcode 2.3.2 - Unauthenticated Remote Code Execution through shortcode',
              Severity: Major
              Found in modules/exploits/multi/http/wp_plugin_fma_shortcode_unauth_rce.rb - About 4 hrs to fix

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

                  def exploit
                    return unless check == Exploit::CheckCode::Appears
                
                    uri = target_uri.path
                    vprint_status("#{peer} - Grabbing CSRF token...")
                Severity: Major
                Found in modules/exploits/multi/http/phpmyadmin_null_termination_exec.rb - About 4 hrs to fix

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

                    def exploit
                        init = send_request_cgi({
                          'uri' => normalize_uri(target_uri.path, 'index.php')
                        })
                  
                  
                  Severity: Major
                  Found in modules/exploits/linux/http/sophos_wpa_iface_exec.rb - About 4 hrs to fix

                    Method win32_rwx_exec_thread has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.win32_rwx_exec_thread(code, block_offset, which_offset='start')
                        stub_block = Rex::Payloads::Shuffle.from_graphml_file(
                          File.join(Msf::Config.install_root, 'data', 'shellcode', 'block_api.x86.graphml'),
                          arch: ARCH_X86,
                          name: 'api_call'
                    Severity: Major
                    Found in lib/msf/util/exe.rb - About 4 hrs to fix

                      Method plugin_search has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def plugin_search(tpath, papp, ip, osize)
                          res = send_request_cgi({
                            'uri' => "#{tpath}#{papp}",
                            'method' => 'GET'
                          })
                      Severity: Major
                      Found in modules/auxiliary/scanner/http/joomla_plugins.rb - About 4 hrs to fix

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

                          def exploit
                            #
                            # 1. Leverage the auth bypass to generate a new administrator access token. Older version of TeamCity (circa 2018)
                            #    do not have support for access token, so we fall back to creating a new administrator account. The benefit
                            #    of using an access token is we can delete it when we are finished, unlike a user account.
                        Severity: Major
                        Found in modules/exploits/multi/http/jetbrains_teamcity_rce_cve_2024_27198.rb - About 4 hrs to fix

                          Method generate_html has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def generate_html(payload)
                          
                              enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
                              enc_nops = Rex::Text.to_unescape(make_nops(4), Rex::Arch.endian(target.arch))
                              enc_ret  = Rex::Text.to_unescape(
                          Severity: Major
                          Found in modules/exploits/multi/browser/firefox_escape_retval.rb - About 4 hrs to fix

                            Method initialize has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def initialize(info = {})
                                super(
                                  update_info(
                                    info,
                                    'Name' => 'Dup Scout Enterprise GET Buffer Overflow',
                            Severity: Major
                            Found in modules/exploits/windows/http/dupscts_bof.rb - About 4 hrs to fix

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

                                  sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
                                  response_data = response_data[11..-1] # cut out acpi data
                                  if sq_bit.eql?(0b10000000)
                                    response_data = response_data[11..-1]
                                    ioa = response_data[0..3]
                              Severity: Major
                              Found in modules/auxiliary/client/iec104/iec104.rb and 4 other locations - About 4 hrs to fix
                              modules/auxiliary/client/iec104/iec104.rb on lines 229..247
                              modules/auxiliary/client/iec104/iec104.rb on lines 325..343
                              modules/auxiliary/client/iec104/iec104.rb on lines 348..366
                              modules/auxiliary/client/iec104/iec104.rb on lines 394..412

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

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

                                  sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
                                  response_data = response_data[11..-1] # cut out acpi data
                                  if sq_bit.eql?(0b10000000)
                                    ioa = response_data[0..3]
                                    response_data = response_data[3..-1]
                              Severity: Major
                              Found in modules/auxiliary/client/iec104/iec104.rb and 4 other locations - About 4 hrs to fix
                              modules/auxiliary/client/iec104/iec104.rb on lines 229..247
                              modules/auxiliary/client/iec104/iec104.rb on lines 325..343
                              modules/auxiliary/client/iec104/iec104.rb on lines 371..389
                              modules/auxiliary/client/iec104/iec104.rb on lines 394..412

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

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

                                  sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
                                  response_data = response_data[11..-1] # cut out acpi data
                                  if sq_bit.eql?(0b10000000)
                                    ioa = response_data[0..3]
                                    response_data = response_data[3..-1]
                              Severity: Major
                              Found in modules/auxiliary/client/iec104/iec104.rb and 4 other locations - About 4 hrs to fix
                              modules/auxiliary/client/iec104/iec104.rb on lines 325..343
                              modules/auxiliary/client/iec104/iec104.rb on lines 348..366
                              modules/auxiliary/client/iec104/iec104.rb on lines 371..389
                              modules/auxiliary/client/iec104/iec104.rb on lines 394..412

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

                              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